Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow moving Delta #402

Merged
merged 2 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading