Skip to content
Snippets Groups Projects
Commit a2052479 authored by Jan Trávníček's avatar Jan Trávníček
Browse files

fix determinisation of PDAs

parent 9813f3f1
No related branches found
No related tags found
No related merge requests found
......@@ -205,7 +205,7 @@ std::tuple<std::set<std::variant<string::Epsilon, alphabet::Symbol>>, std::set<s
ret.insert(std::get<1>(transition.first));
}
 
return std::make_tuple(local, call, ret);
return std::make_tuple(std::move(local), std::move(call), std::move(ret));
}
 
automaton::RealTimeHeightDeterministicDPDA Determinize::determinize(const automaton::RealTimeHeightDeterministicNPDA& n) {
......
......@@ -197,22 +197,20 @@ std::set<std::pair<automaton::State, alphabet::Symbol>> existsDirtyStateSymbol(c
for(const automaton::State& state : states) {
const label::Label& stateLabel = state.getName();
 
std::set<label::Label> lc { stateLabel };
localClosure(lc, std::set<label::Label>{stateLabel}, d); //intentional copy
bool originalPops = false;
for(const label::Label& localState : lc) {
const std::set<label::Label> dSubSet = retrieveDSubSet(unpackFromStateLabel(localState));
const std::set<label::Label> dSubSet = retrieveDSubSet(unpackFromStateLabel(stateLabel));
 
for(const auto& transition : n.getReturnTransitions()) {
if(dSubSet.count(std::get<0>(transition.first).getName())) {
originalPops = true;
goto break2;
}
for(const auto& transition : n.getReturnTransitions()) {
if(dSubSet.count(std::get<0>(transition.first).getName())) {
originalPops = true;
goto break2;
}
}
break2: if(!originalPops) continue;
 
std::set<label::Label> lc { stateLabel };
localClosure(lc, std::set<label::Label>{stateLabel}, d); //intentional copy
std::set<alphabet::Symbol> topSymbols;
for(const label::Label& localState : lc) {
for(const auto& transition : callTransitions) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment