mirror of
https://github.com/Z3Prover/z3
synced 2025-08-23 03:27:52 +00:00
fix regex bug in theory_str for empty string match. need to fix indents
This commit is contained in:
parent
9d6be286d0
commit
f4c0e0b28d
1 changed files with 27 additions and 21 deletions
|
@ -6189,6 +6189,11 @@ namespace smt {
|
|||
expr * arg_str = a->get_arg(0);
|
||||
zstring str;
|
||||
if (u.str.is_string(arg_str, str)) {
|
||||
if (str.length() == 0) {
|
||||
// transitioning on the empty string is handled specially
|
||||
TRACE("str", tout << "empty string epsilon-move " << start << " --> " << end << std::endl;);
|
||||
make_epsilon_move(start, end);
|
||||
} else {
|
||||
TRACE("str", tout << "build NFA for '" << str << "'" << "\n";);
|
||||
/*
|
||||
* For an n-character string, we make (n-1) intermediate states,
|
||||
|
@ -6205,7 +6210,8 @@ namespace smt {
|
|||
}
|
||||
make_transition(last, str[(str.length() - 1)], end);
|
||||
TRACE("str", tout << "string transition " << last << "--" << str[(str.length() - 1)] << "--> " << end << "\n";);
|
||||
} else {
|
||||
}
|
||||
} else { // ! u.str.is_string(arg_str, str)
|
||||
TRACE("str", tout << "invalid string constant in Str2Reg" << std::endl;);
|
||||
m_valid = false;
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue