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

Reimplementation of NFA to DFA, and Thompson NFA to Glushkov NFA conversions #193

Merged
merged 14 commits into from
Dec 27, 2019

Conversation

katef
Copy link
Owner

@katef katef commented Dec 26, 2019

Here I've rewritten these FSM conversions mostly for sake of performance, but also for simplicity. The approach here is focused on trying to do operations in bulk, rather than by doing a sequence of things for each item in turn. This itself gives about a 3x increase over the previous code, but more importantly it sets the scene for future optimisations, in particular for operating on sets of items in parallel.

The Glushkov construction in particular now operates in-situ, rather than by constructing a new FSM.

The diff here is super confusing; github shows this as a modification to the existing determinise.c. Of course that's nonsense, this is a rewrite from scratch (and in fact I did it in separate files before removing the previous implementations). If you're reading this, I suggest looking at determinise.c and glushkov.c just in isolation.

This builds on a lot of previous work; in particular for introducing numeric state indicies (so we can make assumptions about states created in one FSM being equivalent to states in another), and by undertaking epsilon closures in advance.

@katef katef merged commit 9c3321f into master Dec 27, 2019
@katef katef deleted the kate/more-determination branch December 27, 2019 01:02
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.

None yet

1 participant