coli-saar / alto

Alto, the Algebraic Language Toolkit
Other
16 stars 2 forks source link

asConcreteAutomatonBottomUp is broken #18

Closed akoehn closed 6 years ago

akoehn commented 8 years ago

Original report by Christoph Teichmann (Bitbucket: cteichmann, GitHub: CTNLP).


In TreeAutomaton.asConcreteAutomatonBottomUp the two lines:

processAllRulesBottomUp(rule -> ret.addRule(ret.createRule(getStateForId(rule.getParent()), rule.getLabel(this), getStatesFromIds(rule.getChildren())))); finalStates.stream().forEach(finalState -> ret.addFinalState(finalState));

are wrong. The final states are only added correctly, if the new automaton numbers the states in the same way that the old automaton does (not guaranteed). For the rules, the weight is not copied.

akoehn commented 6 years ago

Original comment by Christoph Teichmann (Bitbucket: cteichmann, GitHub: CTNLP).


Has been fixed with the most recent change.

akoehn commented 6 years ago

Original changes by Christoph Teichmann (Bitbucket: cteichmann, GitHub: CTNLP).


changed state from "new" to "closed"