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

Implement noodlification #41

Merged
merged 6 commits into from
Aug 15, 2022
Merged

Implement noodlification #41

merged 6 commits into from
Aug 15, 2022

Conversation

Adda0
Copy link
Collaborator

@Adda0 Adda0 commented Aug 11, 2022

This PR implements function noodlify for noodlification of NFA.

As agreed upon, we implement a naive noodlification method creating all noodles: all permutations of epsilon transitions, one from each depth. In the following PR, we will improve the current implementation with a new algorithm, creating only actually possible noodles which have a path in the original automaton.

The code has been tested with some tests.

As of now, a size of transition relation of the Nfa denotes the
number of states and its call has constant complexity. Therefore,
we no longer need a specific member variable for the number of
Nfa states.
@Adda0 Adda0 marked this pull request as ready for review August 12, 2022 14:53
@Adda0 Adda0 requested review from martinhruska and tfiedor and removed request for martinhruska August 12, 2022 14:53
@Adda0 Adda0 mentioned this pull request Aug 15, 2022
27 tasks
@martinhruska
Copy link
Member

Why is noodlify.h needed? Could not be the function declared in nfa.hh?

@Adda0
Copy link
Collaborator Author

Adda0 commented Aug 15, 2022

It could be, of course. However, when discussing this with @vhavlena, we decided that it would be better for noodlify to have its own header and source files for the following reasons:

  • The function stands somewhat aside from the normal operations on NFA. We think it would make sense to include a separate header file if the user wants to work with these operations concerning noodlification.
  • We expect to have multiple new functions working with noodlification and its variations implementation in the future. For that reason, we think it is better to have a separate header file to explicitly distinguish between normal NFA operations and the operation for noodlification and related functions.
  • Furthemore, we have plans for a more efficient representation of noodles which will require some new structures implemented. noodlify.hh is a better place for these structures than the general nfa.hh

Copy link
Member

@tfiedor tfiedor left a comment

Choose a reason for hiding this comment

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

I'm OK with the PR except for two minor things:

  1. Add to comments what the noodlification and noodle is.
  2. Fix the possible accidental quadratic complexity.

src/nfa/noodlify.cc Outdated Show resolved Hide resolved
src/nfa/noodlify.cc Outdated Show resolved Hide resolved
@Adda0
Copy link
Collaborator Author

Adda0 commented Aug 15, 2022

I have addressed the mentioned issues. Furthemore, I have split the noodlify() into smaller functions in hopes of reusing the smaller functions in the future for aforementioned additional operations for noodlification.

@tfiedor tfiedor merged commit 4daa933 into VeriFIT:devel Aug 15, 2022
@Adda0 Adda0 deleted the noodlify branch August 15, 2022 12:28
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