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

Fix counterexamples for inclusion #442

Merged
merged 8 commits into from
Oct 25, 2024
Merged

Fix counterexamples for inclusion #442

merged 8 commits into from
Oct 25, 2024

Conversation

jurajsic
Copy link
Member

@jurajsic jurajsic commented Oct 17, 2024

This PR fixes counterexamples for antichain inclusion algorithm (both the word and path were incorrect) and for naive algorithm it fixes the path in the counterexamples.

@jurajsic jurajsic linked an issue Oct 17, 2024 that may be closed by this pull request
@jurajsic jurajsic changed the title Fix counterexample for is_included_antichains Fix counterexamples for inclusion Oct 18, 2024
@jurajsic jurajsic marked this pull request as ready for review October 18, 2024 13:31
@jurajsic jurajsic requested review from Adda0 and kilohsakul October 18, 2024 13:31
@jurajsic
Copy link
Member Author

It seems that there is significant slowdown while generating counterexamples, see VeriFIT/z3-noodler#183

Copy link
Collaborator

@vhavlena vhavlena left a comment

Choose a reason for hiding this comment

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

Nice!

@@ -206,8 +206,25 @@ public:
*/
Nfa& trim(StateRenaming* state_renaming = nullptr);

/**
* @brief Returns vector ret where ret[q] is the length of the shortest path from any initial state to q
*/
std::vector<State> distances_from_initial() const;
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be nice if we have some general BFS/DFS method parameterized by callbacks (in a similar fashion as for Tarjan). All these functions such as distances_from_initial or distances_to_final could be easily expressible by this and you wouldn't need to write BFS/DFS all over again.

Copy link
Collaborator

@Adda0 Adda0 Oct 25, 2024

Choose a reason for hiding this comment

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

Created an issue from this: #446.

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.

Seems to be working as expected.

include/mata/nfa/nfa.hh Outdated Show resolved Hide resolved
src/nfa/inclusion.cc Outdated Show resolved Hide resolved
@jurajsic jurajsic merged commit 56780ef into devel Oct 25, 2024
18 checks passed
@jurajsic jurajsic deleted the fix_cex branch October 25, 2024 12:57
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.

Incorrect counterexample in is_included_antichains
3 participants