diff --git a/src/ir/Command.cpp b/src/ir/Command.cpp index ea2141bf0..673a1bd14 100644 --- a/src/ir/Command.cpp +++ b/src/ir/Command.cpp @@ -27,9 +27,6 @@ Command::Command(std::string actionName, std::shared_ptr& renaming, const std::map& bools, const std::map& ints) : actionName(cmd.actionName), guardExpression(cmd.guardExpression->clone(renaming, bools, ints)) { - std::cout << "Cloning command" << std::endl; - std::cout << cmd.guardExpression->dump("\t"); - std::cout << this->guardExpression->dump("\t"); if (renaming.count(this->actionName) > 0) { this->actionName = renaming.at(this->actionName); } diff --git a/src/ir/Module.cpp b/src/ir/Module.cpp index c3049a0ea..2d1482846 100644 --- a/src/ir/Module.cpp +++ b/src/ir/Module.cpp @@ -23,7 +23,8 @@ Module::Module() : moduleName(), booleanVariables(), integerVariables(), boolean } // Initializes all members according to the given values. -Module::Module(std::string moduleName, std::vector booleanVariables, +Module::Module(std::string moduleName, + std::vector booleanVariables, std::vector integerVariables, std::map booleanVariableToIndexMap, std::map integerVariableToIndexMap, @@ -41,7 +42,6 @@ Module::Module(const Module& module, const std::string& moduleName, const std::m for (auto it: renaming) { std::cout << "\t" << it.first << " -> " << it.second << std::endl; } - std::cout << "Current module " << &module << ":" << std::endl << module.toString() << std::endl; this->booleanVariables.reserve(module.booleanVariables.size()); for (BooleanVariable it: module.booleanVariables) { if (renaming.count(it.getName()) > 0) { @@ -69,10 +69,9 @@ Module::Module(const Module& module, const std::string& moduleName, const std::m this->commands.reserve(module.commands.size()); for (std::shared_ptr cmd: module.commands) { - std::cout << "2: Current command: " << cmd->toString() << std::endl; - this->commands.emplace_back(new Command(*cmd, renaming, this->booleanVariablesToIndexMap, this->integerVariablesToIndexMap)); + Command* c = new Command(*cmd, renaming, this->booleanVariablesToIndexMap, this->integerVariablesToIndexMap); + this->commands.emplace_back(c); } - this->collectActions(); } diff --git a/src/ir/Program.cpp b/src/ir/Program.cpp index 01a77298f..d153a1bc6 100644 --- a/src/ir/Program.cpp +++ b/src/ir/Program.cpp @@ -9,6 +9,7 @@ #include "exceptions/InvalidArgumentException.h" #include +#include #include "log4cplus/logger.h" #include "log4cplus/loggingmacros.h" diff --git a/src/ir/expressions/BinaryRelationExpression.h b/src/ir/expressions/BinaryRelationExpression.h index 99e4232c2..8d6184ff7 100644 --- a/src/ir/expressions/BinaryRelationExpression.h +++ b/src/ir/expressions/BinaryRelationExpression.h @@ -22,7 +22,6 @@ public: enum RelationType {EQUAL, NOT_EQUAL, LESS, LESS_OR_EQUAL, GREATER, GREATER_OR_EQUAL}; BinaryRelationExpression(std::shared_ptr left, std::shared_ptr right, RelationType relationType) : BinaryExpression(bool_, left, right), relationType(relationType) { - std::cerr << "BinaryRelationExpression: " << left.get() << " " << relationType << " " << right.get() << " ?" << std::endl; } virtual ~BinaryRelationExpression() { @@ -30,9 +29,7 @@ public: } virtual std::shared_ptr clone(const std::map& renaming, const std::map& bools, const std::map& ints) { - auto res = std::shared_ptr(new BinaryRelationExpression(this->getLeft()->clone(renaming, bools, ints), this->getRight()->clone(renaming, bools, ints), this->relationType)); - std::cout << "Cloning " << this->toString() << " to " << res->toString() << std::endl; - return res; + return std::shared_ptr(new BinaryRelationExpression(this->getLeft()->clone(renaming, bools, ints), this->getRight()->clone(renaming, bools, ints), this->relationType)); } virtual bool getValueAsBool(std::pair, std::vector> const* variableValues) const { diff --git a/src/ir/expressions/VariableExpression.h b/src/ir/expressions/VariableExpression.h index 3aa57ee3e..d0fc4cf30 100644 --- a/src/ir/expressions/VariableExpression.h +++ b/src/ir/expressions/VariableExpression.h @@ -30,17 +30,11 @@ public: } virtual ~VariableExpression() { - } virtual std::shared_ptr clone(const std::map& renaming, const std::map& bools, const std::map& ints) { - std::cout << this << " Cloning VarExpr " << this->variableName << " (" << renaming.size() << " renamings)" << std::endl; - for (auto it: renaming) { - std::cout << "\t" << it.first << " -> " << it.second << std::endl; - } if (renaming.count(this->variableName) > 0) { std::string newName = renaming.at(this->variableName); - std::cout << "index of " << newName << " are " << bools.at(newName) << " and " << ints.at(newName) << std::endl; if (this->getType() == bool_) { return std::shared_ptr(new VariableExpression(bool_, bools.at(newName), newName, this->lowerBound, this->upperBound)); } else if (this->getType() == int_) { diff --git a/src/parser/PrismParser.cpp b/src/parser/PrismParser.cpp index 2714d369e..5b29913bc 100644 --- a/src/parser/PrismParser.cpp +++ b/src/parser/PrismParser.cpp @@ -173,14 +173,14 @@ PrismParser::PrismGrammar::PrismGrammar() : PrismParser::PrismGrammar::base_type // This block defines all entities that are needed for parsing a module. moduleDefinition = (qi::lit("module") >> prism::FreeIdentifierGrammar::instance(this->state)[phoenix::bind(&prism::VariableState::startModule, *this->state)] >> *(variableDefinition(qi::_a, qi::_b, qi::_c, qi::_d)) >> +commandDefinition > qi::lit("endmodule")) - [phoenix::bind(&PrismParser::PrismGrammar::createModule, this, qi::_1, qi::_a, qi::_b, qi::_c, qi::_d, qi::_2)]; + [qi::_val = phoenix::bind(&PrismParser::PrismGrammar::createModule, this, qi::_1, qi::_a, qi::_b, qi::_c, qi::_d, qi::_2)]; moduleDefinition.name("module"); moduleRenaming = (qi::lit("module") >> prism::FreeIdentifierGrammar::instance(this->state) >> qi::lit("=") > this->state->moduleNames_ > qi::lit("[") > *( (prism::IdentifierGrammar::instance(this->state) > qi::lit("=") > prism::IdentifierGrammar::instance(this->state) >> -qi::lit(","))[phoenix::insert(qi::_a, phoenix::construct>(qi::_1, qi::_2))] ) > qi::lit("]") > qi::lit("endmodule")) - [phoenix::bind(&PrismParser::PrismGrammar::renameModule, this, qi::_1, qi::_2, qi::_a)]; + [qi::_val = phoenix::bind(&PrismParser::PrismGrammar::renameModule, this, qi::_1, qi::_2, qi::_a)]; moduleRenaming.name("renamed module"); moduleDefinitionList %= +(moduleDefinition | moduleRenaming); moduleDefinitionList.name("module list");