mirror of
https://github.com/Z3Prover/z3
synced 2025-07-20 11:22:04 +00:00
Regex range bug fix (#5601)
* added a missing derivative case for nonground range * further missing cases and a bug fix in re.to_str
This commit is contained in:
parent
6302b864c8
commit
cb120c93f4
2 changed files with 50 additions and 22 deletions
|
@ -1233,11 +1233,11 @@ std::ostream& seq_util::rex::pp::print_unit(std::ostream& out, expr* s) const {
|
|||
print(out, e);
|
||||
out << "[" << mk_pp(i, re.m) << "]";
|
||||
}
|
||||
else if (re.m.is_value(e))
|
||||
out << mk_pp(e, re.m);
|
||||
else if (is_app(e)) {
|
||||
out << "(" << to_app(e)->get_decl()->get_name().str();
|
||||
for (expr * arg : *to_app(e))
|
||||
else if (re.m.is_value(s))
|
||||
out << mk_pp(s, re.m);
|
||||
else if (is_app(s)) {
|
||||
out << "(" << to_app(s)->get_decl()->get_name().str();
|
||||
for (expr * arg : *to_app(s))
|
||||
print(out << " ", arg);
|
||||
out << ")";
|
||||
}
|
||||
|
@ -1266,11 +1266,11 @@ std::ostream& seq_util::rex::pp::print(std::ostream& out, expr* e) const {
|
|||
else if (re.is_range(e, s, s2))
|
||||
print_range(out, s, s2);
|
||||
else if (re.is_epsilon(e))
|
||||
// ε = epsilon
|
||||
out << (html_encode ? "ε" : "()");
|
||||
// ε = epsilon
|
||||
out << (html_encode ? "ε" : "()");
|
||||
else if (re.is_empty(e))
|
||||
// ∅ = emptyset
|
||||
out << (html_encode ? "∅" : "[]");
|
||||
// ∅ = emptyset
|
||||
out << (html_encode ? "∅" : "[]");
|
||||
else if (re.is_concat(e, r1, r2)) {
|
||||
print(out, r1);
|
||||
print(out, r2);
|
||||
|
@ -1278,7 +1278,7 @@ std::ostream& seq_util::rex::pp::print(std::ostream& out, expr* e) const {
|
|||
else if (re.is_antimorov_union(e, r1, r2) || re.is_union(e, r1, r2)) {
|
||||
out << "(";
|
||||
print(out, r1);
|
||||
out << (html_encode ? "⋃" : "|");
|
||||
out << (html_encode ? "⋃" : "|");
|
||||
print(out, r2);
|
||||
out << ")";
|
||||
}
|
||||
|
@ -1286,7 +1286,7 @@ std::ostream& seq_util::rex::pp::print(std::ostream& out, expr* e) const {
|
|||
{
|
||||
out << "(";
|
||||
print(out, r1);
|
||||
out << (html_encode ? "⋂" : "&");
|
||||
out << (html_encode ? "⋂" : "&");
|
||||
print(out, r2);
|
||||
out << ")";
|
||||
}
|
||||
|
@ -1359,11 +1359,11 @@ std::ostream& seq_util::rex::pp::print(std::ostream& out, expr* e) const {
|
|||
out << ")";
|
||||
}
|
||||
else if (re.m.is_ite(e, s, r1, r2)) {
|
||||
out << (html_encode ? "(𝐢𝐟 " : "(if ");
|
||||
out << (html_encode ? "(𝐢𝐟 " : "(if ");
|
||||
print(out, s);
|
||||
out << (html_encode ? " 𝐭𝗵𝐞𝐧 " : " then ");
|
||||
out << (html_encode ? " 𝐭𝗵𝐞𝐧 " : " then ");
|
||||
print(out, r1);
|
||||
out << (html_encode ? " 𝐞𝐥𝘀𝐞 " : " else ");
|
||||
out << (html_encode ? " 𝐞𝐥𝘀𝐞 " : " else ");
|
||||
print(out, r2);
|
||||
out << ")";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue