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

Automatically remove dead states from concatenated automata. #14205

Closed
wants to merge 2 commits into from

Conversation

jpountz
Copy link
Contributor

@jpountz jpountz commented Feb 6, 2025

Concatenating automata frequently creates dead states. This PR suggests that Operations#concatenate automatically removes these dead states. This is not unseen: Operations#repeat, Operations#union and other automaton manipulation utilities also automatically remove dead states.

Here is an example of what concatenating automata that accept "f" and "g" returns, without this patch:
automaton

With this patch, state 3 gets removed.

Relates #14193.

Concatenating automata frequently creates dead states. This PR suggests that
`Operations#concatenate` automatically removes these dead states. This is not
unseen: `Operations#repeat`, `Operations#union` and other automaton
manipulation utilities also automatically remove dead states.
@rmuir
Copy link
Member

rmuir commented Feb 6, 2025

It's in my PR over there too. I think we should avoid addEpsilon in the test. We don't even need any transitions.

@jpountz
Copy link
Contributor Author

jpountz commented Feb 6, 2025

Superseded by #14193

@jpountz jpountz closed this Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants