From f9368be970a059d342656e4b9309f09987a7acf0 Mon Sep 17 00:00:00 2001 From: Stefan Pranger Date: Fri, 29 Jan 2021 08:08:15 +0100 Subject: [PATCH] refactor Coalition to use boost variant --- .../parser/FormulaParserGrammar.cpp | 4 +-- src/storm/logic/Coalition.cpp | 23 -------------- src/storm/logic/Coalition.h | 30 ------------------- 3 files changed, 2 insertions(+), 55 deletions(-) delete mode 100644 src/storm/logic/Coalition.cpp delete mode 100644 src/storm/logic/Coalition.h diff --git a/src/storm-parsers/parser/FormulaParserGrammar.cpp b/src/storm-parsers/parser/FormulaParserGrammar.cpp index ed355dcc4..14edbe53e 100644 --- a/src/storm-parsers/parser/FormulaParserGrammar.cpp +++ b/src/storm-parsers/parser/FormulaParserGrammar.cpp @@ -144,9 +144,9 @@ namespace storm { coalitionOperator = (qi::lit("<<") > *( (identifier[phoenix::push_back(qi::_a, qi::_1)] - | qi::int_[phoenix::push_back(qi::_b, qi::_1)]) % ',' + | qi::int_[phoenix::push_back(qi::_a, qi::_1)]) % ',' ) - > qi::lit(">>"))[qi::_val = phoenix::bind(&FormulaParserGrammar::createCoalition, phoenix::ref(*this), qi::_a, qi::_b)]; + > qi::lit(">>"))[qi::_val = phoenix::bind(&FormulaParserGrammar::createCoalition, phoenix::ref(*this), qi::_a)]; coalitionOperator.name("coalition operator"); // only LRA for now, need to adapt this (beware of cyclic gameFormula pass!) diff --git a/src/storm/logic/Coalition.cpp b/src/storm/logic/Coalition.cpp deleted file mode 100644 index ff67d735b..000000000 --- a/src/storm/logic/Coalition.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#include "storm/logic/Coalition.h" - -namespace storm { - namespace logic { - - Coalition::Coalition(std::vector const& playerNames, - std::vector const& playerIds) : playerNames(playerNames), playerIds(playerIds) { - // Intentionally left empty. - } - - std::ostream& operator<<(std::ostream& stream, Coalition const& coalition) { - stream << "<<"; - for (auto const& playerName : coalition.playerNames) { - stream << playerName << ", "; - } - for (auto const& playerId : coalition.playerIds) { - stream << playerId << ", "; - } - stream << ">>"; - return stream; - } - } -} diff --git a/src/storm/logic/Coalition.h b/src/storm/logic/Coalition.h deleted file mode 100644 index 108ea53ef..000000000 --- a/src/storm/logic/Coalition.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef STORM_LOGIC_COALITION_H_ -#define STORM_LOGIC_COALITION_H_ - -#include -#include - -#include -#include "storm/storage/BoostTypes.h" -#include "storm/utility/OsDetection.h" - -namespace storm { - namespace logic { - - class Coalition { - public: - Coalition() = default; - Coalition(std::vector const& playerNames, std::vector const& playerIds); - Coalition(Coalition const& other) = default; - - friend std::ostream& operator<<(std::ostream& stream, Coalition const& coalition); - - private: - std::vector playerNames; - std::vector playerIds; - }; - } -} - - -#endif /* STORM_LOGIC_COALITION_H_ */