Debian Codegraph @

Source/Reasoner/Query/CAreClassesDisjointQuery.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 "CAreClassesDisjointQuery.h"
22
23
24 namespace Konclude {
25
26 namespace Reasoner {
27
28 namespace Query {
29
30
31 CAreClassesDisjointQuery::CAreClassesDisjointQuery(QStringList classNames, const QString& queryName) {
32 QString classNamesString;
33 bool hasClassName = false;
34 while (!classNames.isEmpty()) {
35 QString nextClassName = classNames.takeFirst();
36 if (hasClassName) {
37 if (classNames.isEmpty()) {
38 classNamesString += QString(" and ");
39 } else {
40 classNamesString += QString(", ");
41 }
42 }
43 classNamesString += nextClassName;
44 hasClassName = true;
45 }
46 CSatisfiableCalculationJobsQuery::setQueryName(queryName);
47 QString queryString = QString("Are classes '%1' disjoint?").arg(classNamesString);
48 CSatisfiableCalculationJobsQuery::setQueryString(queryString);
49 QString answerStringYes = QString("Yes");
50 QString answerStringNo = QString("No");
51 QString answerStringUnknown = QString("Unknown");
52 CSatisfiableCalculationJobsQuery::setAnswerString(answerStringYes,answerStringNo,answerStringUnknown);
53 }
54
55
56 bool CAreClassesDisjointQuery::areClassesDisjoint() {
57 return getResult();
58 }
59
60
61 CAreClassesDisjointQuery::~CAreClassesDisjointQuery() {
62 }
63
64 }; // end namespace Query
65
66 }; // end namespace Reasoner
67
68 }; // end namespace Konclude