diff --git a/alib2data/src/alphabet/Symbol.cpp b/alib2data/src/alphabet/Symbol.cpp index 31ec27637d9f977d663383e376f62de92bc57df7..b6e64a111ca74931b70b2bb3784e98e51055d4dc 100644 --- a/alib2data/src/alphabet/Symbol.cpp +++ b/alib2data/src/alphabet/Symbol.cpp @@ -93,9 +93,11 @@ alphabet::Symbol Symbol::createUniqueSymbol(const alphabet::Symbol& base, const if(baseSymbol == NULL) throw exception::AlibException("Could not create unique symbol with nonlabeled base symbol " + (std::string) base.getSymbol() + "." ); + label::Label nextLabel = baseSymbol->getLabel(); + int i = 0; do { - label::Label nextLabel = nextLabelCreator.nextLabel(baseSymbol->getLabel()); + nextLabel = nextLabelCreator.nextLabel(nextLabel); alphabet::Symbol attempt = alphabet::Symbol(alphabet::LabeledSymbol(nextLabel)); if(terminalAlphabet.count(attempt) == 0 && nonterminalAlphabet.count(attempt) == 0) return attempt; diff --git a/alib2data/src/automaton/Automaton.cpp b/alib2data/src/automaton/Automaton.cpp index 6625e57fe5eec9b8fa6d0e00962b2bb15a6bd5b8..667ba945dabee7a19889e4a612fdffef2eb31b02 100644 --- a/alib2data/src/automaton/Automaton.cpp +++ b/alib2data/src/automaton/Automaton.cpp @@ -80,9 +80,11 @@ std::ostream& operator<<(std::ostream& os, const Automaton& automaton) { State Automaton::createUniqueState(const State& base, const std::set<State>& other) { label::NextLabel nextLabelCreator; + label::Label nextLabel = base.getName(); + int i = 0; do { - label::Label nextLabel = nextLabelCreator.nextLabel(base.getName()); + nextLabel = nextLabelCreator.nextLabel(nextLabel); if(other.count(State(nextLabel)) == 0) return State(nextLabel); } while(++i < INT_MAX);