-
Notifications
You must be signed in to change notification settings - Fork 19
Adding simulation reduction rules #487
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
base: devel
Are you sure you want to change the base?
Conversation
e94a0da to
b4c7441
Compare
Adda0
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR. Looks good to me overall.
| nfa/delta.cc | ||
| nfa/operations.cc | ||
| nfa/builder.cc | ||
| nfa/reductionSimulation.cc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| nfa/reductionSimulation.cc | |
| nfa/reduction-simulation.cc |
| /** | ||
| * @brief TODO | ||
| */ | ||
| Nfa reduce_size_by_simulation(const Nfa& aut, StateRenaming &state_renaming, const std::string& simulation_direction); | ||
|
|
||
| /** | ||
| * @brief TODO | ||
| */ | ||
| Simlib::Util::BinaryRelation compute_direct_simulation(const Nfa& aut); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add documentation. If necessary, ask @ondrik.
| using namespace mata::nfa; | ||
|
|
||
| namespace { | ||
| // Merging based on the first and second rule (From the paper 'On NFA Reduction') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add link to the paper.
|
|
||
| namespace { | ||
| // Merging based on the first and second rule (From the paper 'On NFA Reduction') | ||
| Nfa merge_in_one_direction(const Nfa& aut, StateRenaming& state_renaming, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function should be better documented. Especially, the little_brother parameter should be explained.
| // Build the resulting automaton based on the simulated_states and state_renaming | ||
| for (State p = 0; p < num_of_states; ++p) { | ||
| // If the state is simulated, its not added to the resulting automaton | ||
| if (std::find(simulated_states.begin(), simulated_states.end(), p) != simulated_states.end()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a method simulated_states.find() to use instead of the general std::find()?
| nfa/delta.cc | ||
| nfa/operations.cc | ||
| nfa/builder.cc | ||
| nfa/reductionSimulation.cc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation seems wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you used algorithms from some papers, could you add links to those? Or if there is any write-up about the approach chosen here, it would be also beneficial. If there is not, maybe just a general description in the function definition explaining what the algorithm does would go a long way to improving the readability of the introduced changes.
|
@jurajsic Could you also have a look before July 14? We want to merge the PR this month, ideally. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you rename this file to reduce.cc and move here all reduction algorithms? It might nicely clean up the main catch-all files.
|
Are there any benchmarks comparing the currently implemented reduction in |
Project practice 2 simulation enhancement