Skip to content

Commit

Permalink
Merge pull request #402 from VeriFIT/move_delta
Browse files Browse the repository at this point in the history
Allow moving Delta #patch
  • Loading branch information
Adda0 authored Mar 28, 2024
2 parents a96e3f5 + 01b560e commit d95fe13
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions include/mata/nfa/delta.hh
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,11 @@ public:

Delta(): state_posts_{} {}
Delta(const Delta& other) = default;
Delta(Delta&& other) = default;
explicit Delta(size_t n): state_posts_{ n } {}

Delta& operator=(const Delta& other) = default;
Delta& operator=(Delta&& other) = default;

bool operator==(const Delta& other) const;

Expand Down
8 changes: 4 additions & 4 deletions include/mata/nfa/nfa.hh
Original file line number Diff line number Diff line change
Expand Up @@ -313,11 +313,11 @@ public:
bool is_acyclic() const;

/**
* Fill @p alphabet with symbols from @p nfa.
* @param[in] nfa NFA with symbols to fill @p alphabet with.
* @param[out] alphabet Alphabet to be filled with symbols from @p nfa.
* Fill @p alphabet_to_fill with symbols from @p nfa.
* @param[in] nfa NFA with symbols to fill @p alphabet_to_fill with.
* @param[out] alphabet_to_fill Alphabet to be filled with symbols from @p nfa.
*/
void fill_alphabet(mata::OnTheFlyAlphabet& alphabet) const;
void fill_alphabet(mata::OnTheFlyAlphabet& alphabet_to_fill) const;

/// Is the language of the automaton universal?
bool is_universal(const Alphabet& alphabet, Run* cex = nullptr,
Expand Down
6 changes: 3 additions & 3 deletions src/nfa/operations.cc
Original file line number Diff line number Diff line change
Expand Up @@ -743,11 +743,11 @@ std::ostream& std::operator<<(std::ostream& os, const Nfa& nfa) {
return os;
}

void mata::nfa::Nfa::fill_alphabet(OnTheFlyAlphabet& alphabet) const {
void mata::nfa::Nfa::fill_alphabet(OnTheFlyAlphabet& alphabet_to_fill) const {
for (const StatePost& state_post: this->delta) {
for (const SymbolPost& symbol_post: state_post) {
alphabet.update_next_symbol_value(symbol_post.symbol);
alphabet.try_add_new_symbol(std::to_string(symbol_post.symbol), symbol_post.symbol);
alphabet_to_fill.update_next_symbol_value(symbol_post.symbol);
alphabet_to_fill.try_add_new_symbol(std::to_string(symbol_post.symbol), symbol_post.symbol);
}
}
}
Expand Down

0 comments on commit d95fe13

Please sign in to comment.