diff --git a/alib2data/src/grammar/ContextFree/CFG.cpp b/alib2data/src/grammar/ContextFree/CFG.cpp index 4bcde860363b1d383e31e983421d7d873ac1eeda..5a49d3dfeb8b18157c3e308450c46114f167f62e 100644 --- a/alib2data/src/grammar/ContextFree/CFG.cpp +++ b/alib2data/src/grammar/ContextFree/CFG.cpp @@ -33,9 +33,6 @@ GrammarBase* CFG::plunder() && { bool CFG::removeTerminalSymbol(const alphabet::Symbol& symbol) { for(const std::pair<alphabet::Symbol, std::set<std::vector<alphabet::Symbol>>>& rule : rules) { - if(rule.first == symbol) - throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule."); - for(const std::vector<alphabet::Symbol>& rhs : rule.second) if(std::find(rhs.begin(), rhs.end(), symbol) != rhs.end()) throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule."); diff --git a/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.cpp b/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.cpp index d0facd7c198874b447527027449e146c680b2879..9ed84f4ac13c3cc469d250ffc2c3ac00103407f1 100644 --- a/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.cpp +++ b/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.cpp @@ -33,9 +33,6 @@ GrammarBase* EpsilonFreeCFG::plunder() && { bool EpsilonFreeCFG::removeTerminalSymbol(const alphabet::Symbol& symbol) { for(const std::pair<alphabet::Symbol, std::set<std::vector<alphabet::Symbol>>>& rule : rules) { - if(rule.first == symbol) - throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule."); - for(const std::vector<alphabet::Symbol>& rhs : rule.second) if(std::find(rhs.begin(), rhs.end(), symbol) != rhs.end()) throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");