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

change determinize internal api

parent dad03b02
No related branches found
No related tags found
No related merge requests found
...@@ -53,7 +53,7 @@ void retInitial(const automaton::State& state, const alphabet::Symbol& pdaSymbol ...@@ -53,7 +53,7 @@ void retInitial(const automaton::State& state, const alphabet::Symbol& pdaSymbol
   
void ret(const automaton::State& state, const alphabet::Symbol& pdaSymbol, const std::variant<string::Epsilon, alphabet::Symbol>& input, const automaton::RealTimeHeightDeterministicNPDA& nondeterministic, automaton::RealTimeHeightDeterministicDPDA& deterministic) { void ret(const automaton::State& state, const alphabet::Symbol& pdaSymbol, const std::variant<string::Epsilon, alphabet::Symbol>& input, const automaton::RealTimeHeightDeterministicNPDA& nondeterministic, automaton::RealTimeHeightDeterministicDPDA& deterministic) {
std::set<std::pair<label::Label, label::Label>> S = unpackFromStateLabel(state.getName()); std::set<std::pair<label::Label, label::Label>> S = unpackFromStateLabel(state.getName());
std::pair<std::set<std::pair<label::Label, label::Label>>, std::variant<string::Epsilon, alphabet::Symbol>> pdaSymbolUnpack = unpackFromDRHDPDAStackSymbolLabel(static_cast<const alphabet::LabeledSymbol&>(pdaSymbol.getData()).getLabel()); std::pair<std::set<std::pair<label::Label, label::Label>>, std::variant<string::Epsilon, alphabet::Symbol>> pdaSymbolUnpack = unpackFromDRHDPDAStackSymbol(pdaSymbol);
const std::set<std::pair<label::Label, label::Label>>& S1 = pdaSymbolUnpack.first; const std::set<std::pair<label::Label, label::Label>>& S1 = pdaSymbolUnpack.first;
   
std::set<std::pair<label::Label, label::Label>> update; std::set<std::pair<label::Label, label::Label>> update;
......
...@@ -52,7 +52,7 @@ void retInitial(const automaton::State& state, const alphabet::Symbol& pdaSymbol ...@@ -52,7 +52,7 @@ void retInitial(const automaton::State& state, const alphabet::Symbol& pdaSymbol
   
void ret(const automaton::State& state, const alphabet::Symbol& pdaSymbol, const alphabet::Symbol& input, const automaton::VisiblyPushdownNPDA& nondeterministic, automaton::VisiblyPushdownDPDA& deterministic) { void ret(const automaton::State& state, const alphabet::Symbol& pdaSymbol, const alphabet::Symbol& input, const automaton::VisiblyPushdownNPDA& nondeterministic, automaton::VisiblyPushdownDPDA& deterministic) {
std::set<std::pair<label::Label, label::Label>> S = unpackFromStateLabel(state.getName()); std::set<std::pair<label::Label, label::Label>> S = unpackFromStateLabel(state.getName());
std::pair<std::set<std::pair<label::Label, label::Label>>, alphabet::Symbol> pdaSymbolUnpack = unpackFromDVPAStackSymbolLabel(static_cast<const alphabet::LabeledSymbol&>(pdaSymbol.getData()).getLabel()); std::pair<std::set<std::pair<label::Label, label::Label>>, alphabet::Symbol> pdaSymbolUnpack = unpackFromDVPAStackSymbol(pdaSymbol);
const std::set<std::pair<label::Label, label::Label>>& S1 = pdaSymbolUnpack.first; const std::set<std::pair<label::Label, label::Label>>& S1 = pdaSymbolUnpack.first;
   
std::set<std::pair<label::Label, label::Label>> update; std::set<std::pair<label::Label, label::Label>> update;
......
...@@ -38,7 +38,8 @@ label::Label packToStackSymbolLabel(std::pair<std::set<std::pair<label::Label, l ...@@ -38,7 +38,8 @@ label::Label packToStackSymbolLabel(std::pair<std::set<std::pair<label::Label, l
return label::Label(label::LabelPairLabel(std::make_pair(std::move(res1), std::move(res2)))); return label::Label(label::LabelPairLabel(std::make_pair(std::move(res1), std::move(res2))));
} }
   
std::pair<std::set<std::pair<label::Label, label::Label>>, alphabet::Symbol> unpackFromDVPAStackSymbolLabel(const label::Label& data) { std::pair<std::set<std::pair<label::Label, label::Label>>, alphabet::Symbol> unpackFromDVPAStackSymbol(const alphabet::Symbol& symbol) {
const label::Label& data = static_cast<const alphabet::LabeledSymbol&>(symbol.getData()).getLabel();
const label::Label& labelPairFirst = static_cast<const label::LabelPairLabel&>(data.getData()).getData().first; const label::Label& labelPairFirst = static_cast<const label::LabelPairLabel&>(data.getData()).getData().first;
std::set<std::pair<label::Label, label::Label>> res = unpackFromStateLabel(labelPairFirst); std::set<std::pair<label::Label, label::Label>> res = unpackFromStateLabel(labelPairFirst);
   
...@@ -58,7 +59,8 @@ label::Label packToStackSymbolLabel(std::pair<std::set<std::pair<label::Label, l ...@@ -58,7 +59,8 @@ label::Label packToStackSymbolLabel(std::pair<std::set<std::pair<label::Label, l
} }
} }
   
std::pair<std::set<std::pair<label::Label, label::Label>>, std::variant<string::Epsilon, alphabet::Symbol>> unpackFromDRHDPDAStackSymbolLabel(const label::Label& data) { std::pair<std::set<std::pair<label::Label, label::Label>>, std::variant<string::Epsilon, alphabet::Symbol>> unpackFromDRHDPDAStackSymbol(const alphabet::Symbol& symbol) {
const label::Label& data = static_cast<const alphabet::LabeledSymbol&>(symbol.getData()).getLabel();
const label::Label& labelPairFirst = static_cast<const label::LabelPairLabel&>(data.getData()).getData().first; const label::Label& labelPairFirst = static_cast<const label::LabelPairLabel&>(data.getData()).getData().first;
std::set<std::pair<label::Label, label::Label>> res = unpackFromStateLabel(labelPairFirst); std::set<std::pair<label::Label, label::Label>> res = unpackFromStateLabel(labelPairFirst);
   
......
...@@ -19,11 +19,11 @@ std::set<std::pair<label::Label, label::Label>> unpackFromStateLabel(const label ...@@ -19,11 +19,11 @@ std::set<std::pair<label::Label, label::Label>> unpackFromStateLabel(const label
   
label::Label packToStackSymbolLabel(std::pair<std::set<std::pair<label::Label, label::Label>>, alphabet::Symbol>&& data); label::Label packToStackSymbolLabel(std::pair<std::set<std::pair<label::Label, label::Label>>, alphabet::Symbol>&& data);
   
std::pair<std::set<std::pair<label::Label, label::Label>>, alphabet::Symbol> unpackFromDVPAStackSymbolLabel(const label::Label& data); std::pair<std::set<std::pair<label::Label, label::Label>>, alphabet::Symbol> unpackFromDVPAStackSymbol(const alphabet::Symbol& symbol);
   
label::Label packToStackSymbolLabel(std::pair<std::set<std::pair<label::Label, label::Label>>, std::variant<string::Epsilon, alphabet::Symbol>>&& data); label::Label packToStackSymbolLabel(std::pair<std::set<std::pair<label::Label, label::Label>>, std::variant<string::Epsilon, alphabet::Symbol>>&& data);
   
std::pair<std::set<std::pair<label::Label, label::Label>>, std::variant<string::Epsilon, alphabet::Symbol>> unpackFromDRHDPDAStackSymbolLabel(const label::Label& data); std::pair<std::set<std::pair<label::Label, label::Label>>, std::variant<string::Epsilon, alphabet::Symbol>> unpackFromDRHDPDAStackSymbol(const alphabet::Symbol& symbol);
   
std::set<label::Label> retrieveDSubSet(const std::set<std::pair<label::Label, label::Label>>& localOperation); std::set<label::Label> retrieveDSubSet(const std::set<std::pair<label::Label, label::Label>>& localOperation);
   
......
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