Skip to content

Commit

Permalink
(#332) linter fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xendalm committed Apr 16, 2024
1 parent a1ef7c2 commit 0e3302c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ class AutomatonGenerator {

void add_terminality();

bool coloring_MFA_transition(int beg, FAtransition& trans,
int color); // NOLINT(runtime/references)
bool coloring_MFA_transition(int beg, FAtransition& trans, // NOLINT(runtime/references)
int color);

void generate_graph();

Expand Down
12 changes: 6 additions & 6 deletions libs/Objects/src/MemoryFiniteAutomaton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -977,16 +977,16 @@ bool MemoryFiniteAutomaton::check_memory_correctness() {
map<int, set<int>> open_cells;
// Ячейки, переходы из которых надо проверить
set<int> states_to_check;
for (auto state : get_states()) {
for (const auto& state : get_states()) {
states_to_check.insert(state.index);
}

while (!states_to_check.empty()) {
int cur_state = *states_to_check.begin();
states_to_check.erase(cur_state);
auto transitions = get_states()[cur_state].transitions;
for (auto symbol_transitions : transitions) {
for (auto transition : symbol_transitions.second) {
for (const auto& symbol_transitions : transitions) {
for (const auto& transition : symbol_transitions.second) {
for (auto cell : open_cells[cur_state]) {
// Если в текущем состоянии ячейка открыта для записи и переход её не закрывает
bool pass = !transition.memory_actions.count(cell);
Expand All @@ -1011,16 +1011,16 @@ bool MemoryFiniteAutomaton::check_memory_correctness() {
}
}

for (auto state : get_states()) {
for (const auto& state : get_states()) {
auto transitions = get_states()[state.index].transitions;
for (auto symbol_transitions : transitions) {
for (const auto& symbol_transitions : transitions) {
// Ячейка может быть открыта и по ней существует переход
if (symbol_transitions.first.is_ref() &&
open_cells[state.index].count(symbol_transitions.first.get_ref())) {
return false;
// throw runtime_error("MFA ERROR(Reading from the open cell)");
}
for (auto transition : symbol_transitions.second) {
for (const auto& transition : symbol_transitions.second) {
for (auto action : transition.memory_actions) {
if (action.second == MFATransition::open) {
if (symbol_transitions.first.is_ref() &&
Expand Down

0 comments on commit 0e3302c

Please sign in to comment.