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

Inclusion test with shortest words #201

Draft
wants to merge 1 commit into
base: devel
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions src/smt/theory_str_noodler/decision_procedure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,11 +363,22 @@ namespace smt::noodler {
assert(right_side_automata.size() == 1); // there should be exactly one element in right_side_automata as we do not have length variables
// TODO probably we should try shortest words, it might work correctly
if (is_inclusion_to_process_on_cycle // we do not test inclusion if we have node that is not on cycle, because we will not go back to it (TODO: should we really not test it?)
&& mata::nfa::is_included(element_to_process.aut_ass.get_automaton_concat(left_side_vars), *right_side_automata[0])) {
// TODO can I push to front? I think I can, and I probably want to, so I can immediately test if it is not sat (if element_to_process.inclusions_to_process is empty), or just to get to sat faster
worklist.push_front(element_to_process);
// we continue as there is no need for noodlification, inclusion already holds
continue;
// && mata::nfa::is_included(element_to_process.aut_ass.get_automaton_concat(left_side_vars), *right_side_automata[0])) {
) {
std::shared_ptr<mata::nfa::Nfa> right_side_aut = right_side_automata[0];
bool is_min_included = true;
for (const mata::Word& shortest_word : mata::strings::get_shortest_words(element_to_process.aut_ass.get_automaton_concat(left_side_vars))) {
if (!right_side_aut->is_in_lang(shortest_word)) {
is_min_included = false;
break;
}
}
if (is_min_included) {
// TODO can I push to front? I think I can, and I probably want to, so I can immediately test if it is not sat (if element_to_process.inclusions_to_process is empty), or just to get to sat faster
worklist.push_front(element_to_process);
// we continue as there is no need for noodlification, inclusion already holds
continue;
}
}
}
/********************************************************************************************************/
Expand Down