Debian Codegraph @

Source/Control/Interface/CommandLine/CCLISatisfiabilityComandLinePreparationTranslator.cpp

raw
1 /*
2 * Copyright (C) 2013-2015, 2019 by the Konclude Developer Team.
3 *
4 * This file is part of the reasoning system Konclude.
5 * For details and support, see <http://konclude.com/>.
6 *
7 * Konclude is free software: you can redistribute it and/or modify
8 * it under the terms of version 3 of the GNU Lesser General Public
9 * License (LGPLv3) as published by the Free Software Foundation.
10 *
11 * Konclude is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU (Lesser) General Public License for more details.
15 *
16 * You should have received a copy of the GNU (Lesser) General Public
17 * License along with Konclude. If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21 #include "CCLISatisfiabilityComandLinePreparationTranslator.h"
22
23
24 namespace Konclude {
25
26 namespace Control {
27
28 namespace Interface {
29
30 namespace CommandLine {
31
32 CCLISatisfiabilityComandLinePreparationTranslator::CCLISatisfiabilityComandLinePreparationTranslator(CLoaderFactory *loaderFactory) : CCLIComandLinePreparationTranslator(loaderFactory) {
33 mOperationTypeString = QString("Satisfiability");
34 mMinNecessaryArguments = true;
35 mFirstArgumentTranslation = false;
36 mLoaderTypeString = QString("-CLISatisfiabilityBatchProcessingLoader");
37 }
38
39
40 CCLISatisfiabilityComandLinePreparationTranslator::~CCLISatisfiabilityComandLinePreparationTranslator() {
41 }
42
43 bool CCLISatisfiabilityComandLinePreparationTranslator::hasNeccessaryParameters() {
44 bool minNecessaryArguments = true;
45 if (!mFirstArgumentTranslation) {
46 minNecessaryArguments = false;
47 }
48 if (!mRequestFileTranslated) {
49 LOG(ERROR,getLogDomain(),logTr("%1 request file not specified.").arg(mOperationTypeString),this);
50 minNecessaryArguments = false;
51 }
52 if (!mIRITranslated) {
53 LOG(ERROR,getLogDomain(),logTr("Class IRI not specified for satisfiability checking."),this);
54 minNecessaryArguments = false;
55 }
56 return minNecessaryArguments;
57 }
58
59 bool CCLISatisfiabilityComandLinePreparationTranslator::translate(const QString& argumentText, QStringList& remainingArgList) {
60
61 bool argumentTranslated = false;
62
63
64 QString modArgText = argumentText.trimmed();
65 if (!mSkipTranslation) {
66 if (CCommandLinePreparationTranslator::translate(argumentText,remainingArgList)) {
67 argumentTranslated = true;
68 } else {
69 if (modArgText.indexOf("-") == 0) {
70 } else if (modArgText == "satisfiability" || modArgText == "sat") {
71 argumentTranslated = true;
72 mFirstArgumentTranslation = true;
73 }
74 }
75 }
76 return argumentTranslated;
77 }
78
79 bool CCLISatisfiabilityComandLinePreparationTranslator::canTranslate(const QString& string) {
80 if (QString::compare(string,"satisfiability",Qt::CaseInsensitive) == 0 || QString::compare(string,"sat",Qt::CaseInsensitive) == 0) {
81 return true;
82 }
83 return false;
84 }
85
86
87 }; // end namespace CommandLine
88
89 }; // end namespace Interface
90
91 }; // end namespace Control
92
93 }; // end namespace Konclude