Skip to content

Commit

Permalink
Fixed bug in Kleene Star + Concat TRE
Browse files Browse the repository at this point in the history
  • Loading branch information
MasWag committed Mar 9, 2019
1 parent c0ca5a0 commit 9e20fdd
Show file tree
Hide file tree
Showing 4 changed files with 474 additions and 319 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -DDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-flto -O3 -DRELEASE")
set(VERSION_MAJOR 0)
set(VERSION_MINOR 4)
set(VERSION_PATCH 0)
set(VERSION_PATCH 1)

find_package(BISON REQUIRED)
find_package(FLEX REQUIRED)
Expand Down
8 changes: 4 additions & 4 deletions libmonaa/monaa.hh
Original file line number Diff line number Diff line change
Expand Up @@ -629,9 +629,9 @@ void monaaDollar(WordContainer<InputContainer> word,
std::unordered_map<const TAState*, std::shared_ptr<TAState>> ptrConv;
for (std::shared_ptr<TAState> s: A.states) {
ptrConv[s.get()] = std::make_shared<TAState>(*s);
Ap.states.push_back(ptrConv[s.get()]);
Ap.states.push_back(ptrConv.at(s.get()));
if (std::binary_search(A.initialStates.begin(), A.initialStates.end(), s)) {
Ap.initialStates.push_back(ptrConv[s.get()]);
Ap.initialStates.push_back(ptrConv.at(s.get()));
}
}

Expand All @@ -643,7 +643,7 @@ void monaaDollar(WordContainer<InputContainer> word,
}
for(auto &transitionsPair: s->next) {
for(auto &transition: transitionsPair.second) {
transition.target = ptrConv[transition.target].get();
transition.target = ptrConv.at(transition.target).get();
}
}
}
Expand Down Expand Up @@ -1009,7 +1009,7 @@ void monaaDollar(WordContainer<InputContainer> word,
// KMP like skip value
int greatestN = 1;
for (const IntervalInternalState& istate: LastStates) {
greatestN = std::max(beta[ptrConv[istate.s].get()], greatestN);
greatestN = std::max(beta[ptrConv.at(istate.s).get()], greatestN);
}
// increment i
i += greatestN;
Expand Down

0 comments on commit 9e20fdd

Please sign in to comment.