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

Minimization #476

Open
wants to merge 7 commits into
base: devel
Choose a base branch
from
Open

Minimization #476

wants to merge 7 commits into from

Conversation

koniksedy
Copy link
Collaborator

This PR:

  • introduces a dispatch function for automata minimization,
  • makes Brzozowski's algorithm the default algorithm for NFAs
  • makes Hopcroft's algorithm the default algorithm for DFAs.

@koniksedy koniksedy requested review from jurajsic and Adda0 December 2, 2024 14:36
src/nfa/operations.cc Show resolved Hide resolved
include/mata/nfa/types.hh Outdated Show resolved Hide resolved
include/mata/nfa/nfa.hh Outdated Show resolved Hide resolved
src/nfa/operations.cc Outdated Show resolved Hide resolved
Copy link
Collaborator

@Adda0 Adda0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall according to what we have agreed on as of now. We can change something again later.

src/nfa/operations.cc Outdated Show resolved Hide resolved
if (str_algo == "hopcroft") {
/* default */;
} else if (str_algo == "brzozowski") {
algo = algorithms::minimize_brzozowski;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should be named make_minimal_dfa_brzozowski()? To show it can be used for NFAs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this will break the naming convention for minimizazion algorithms.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, but Brzozowski does not perform minimization as per the definition given by Lukáš. But this is debatable. What does @jurajsic think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not know, but I realized that this change, that minimize now HAVE to take DFA, might break noodler (and anyone using mata, if such people exists), because before it was assumed it takes nfa and calls brzozowski.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants