mirror of
https://github.com/Z3Prover/z3
synced 2026-06-01 06:37:49 +00:00
re.plus is a regex as well
This commit is contained in:
parent
2ea1c74071
commit
7ede1b9c3d
3 changed files with 34 additions and 24 deletions
|
|
@ -73,6 +73,9 @@ namespace euf {
|
||||||
if (m_seq.re.is_star(e))
|
if (m_seq.re.is_star(e))
|
||||||
return snode_kind::s_star;
|
return snode_kind::s_star;
|
||||||
|
|
||||||
|
if (m_seq.re.is_plus(e))
|
||||||
|
return snode_kind::s_plus;
|
||||||
|
|
||||||
if (m_seq.re.is_loop(e))
|
if (m_seq.re.is_loop(e))
|
||||||
return snode_kind::s_loop;
|
return snode_kind::s_loop;
|
||||||
|
|
||||||
|
|
@ -172,6 +175,7 @@ namespace euf {
|
||||||
}
|
}
|
||||||
|
|
||||||
case snode_kind::s_star:
|
case snode_kind::s_star:
|
||||||
|
case snode_kind::s_plus:
|
||||||
SASSERT(n->num_args() == 1);
|
SASSERT(n->num_args() == 1);
|
||||||
n->m_ground = n->arg(0)->is_ground();
|
n->m_ground = n->arg(0)->is_ground();
|
||||||
n->m_regex_free = false;
|
n->m_regex_free = false;
|
||||||
|
|
@ -759,6 +763,7 @@ namespace euf {
|
||||||
case snode_kind::s_concat: return "concat";
|
case snode_kind::s_concat: return "concat";
|
||||||
case snode_kind::s_power: return "power";
|
case snode_kind::s_power: return "power";
|
||||||
case snode_kind::s_star: return "star";
|
case snode_kind::s_star: return "star";
|
||||||
|
case snode_kind::s_plus: return "plus";
|
||||||
case snode_kind::s_loop: return "loop";
|
case snode_kind::s_loop: return "loop";
|
||||||
case snode_kind::s_union: return "union";
|
case snode_kind::s_union: return "union";
|
||||||
case snode_kind::s_intersect: return "intersect";
|
case snode_kind::s_intersect: return "intersect";
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ namespace euf {
|
||||||
s_concat, // concatenation of two snodes (OP_SEQ_CONCAT)
|
s_concat, // concatenation of two snodes (OP_SEQ_CONCAT)
|
||||||
s_power, // string exponentiation s^n (OP_SEQ_POWER)
|
s_power, // string exponentiation s^n (OP_SEQ_POWER)
|
||||||
s_star, // Kleene star r* (OP_RE_STAR)
|
s_star, // Kleene star r* (OP_RE_STAR)
|
||||||
|
s_plus, // Kleene plus r+ (OP_RE_PLUS)
|
||||||
s_loop, // bounded loop r{lo,hi} (OP_RE_LOOP)
|
s_loop, // bounded loop r{lo,hi} (OP_RE_LOOP)
|
||||||
s_union, // union r1|r2 (OP_RE_UNION)
|
s_union, // union r1|r2 (OP_RE_UNION)
|
||||||
s_intersect, // intersection r1&r2 (OP_RE_INTERSECT)
|
s_intersect, // intersection r1&r2 (OP_RE_INTERSECT)
|
||||||
|
|
@ -165,6 +166,9 @@ namespace euf {
|
||||||
bool is_star() const {
|
bool is_star() const {
|
||||||
return m_kind == snode_kind::s_star;
|
return m_kind == snode_kind::s_star;
|
||||||
}
|
}
|
||||||
|
bool is_plus() const {
|
||||||
|
return m_kind == snode_kind::s_plus;
|
||||||
|
}
|
||||||
bool is_loop() const {
|
bool is_loop() const {
|
||||||
return m_kind == snode_kind::s_loop;
|
return m_kind == snode_kind::s_loop;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -613,8 +613,8 @@ namespace smt {
|
||||||
++num_mems;
|
++num_mems;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/*if (m_ignored_mem.contains(mem.lit))
|
if (m_ignored_mem.contains(mem.lit))
|
||||||
continue; // already handled via Boolean closure, skip*/
|
continue; // already handled via Boolean closure, skip
|
||||||
// pre-process: consume ground prefix characters
|
// pre-process: consume ground prefix characters
|
||||||
vector<seq::str_mem> processed;
|
vector<seq::str_mem> processed;
|
||||||
if (!m_regex.process_str_mem(mem, processed)) {
|
if (!m_regex.process_str_mem(mem, processed)) {
|
||||||
|
|
@ -753,6 +753,7 @@ namespace smt {
|
||||||
m_nielsen.set_parikh_enabled(get_fparams().m_nseq_parikh);
|
m_nielsen.set_parikh_enabled(get_fparams().m_nseq_parikh);
|
||||||
m_nielsen.set_signature_split(get_fparams().m_nseq_signature);
|
m_nielsen.set_signature_split(get_fparams().m_nseq_signature);
|
||||||
m_nielsen.set_regex_factorization_threshold(get_fparams().m_nseq_regex_factorization_threshold);
|
m_nielsen.set_regex_factorization_threshold(get_fparams().m_nseq_regex_factorization_threshold);
|
||||||
|
}
|
||||||
|
|
||||||
SASSERT(!m_nielsen.root()->is_currently_conflict());
|
SASSERT(!m_nielsen.root()->is_currently_conflict());
|
||||||
|
|
||||||
|
|
@ -779,7 +780,6 @@ namespace smt {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// std::cout << "[" << m_num_final_checks << "]" << std::endl;
|
// std::cout << "[" << m_num_final_checks << "]" << std::endl;
|
||||||
IF_VERBOSE(1, verbose_stream() << "nseq final_check: calling solve()\n";);
|
IF_VERBOSE(1, verbose_stream() << "nseq final_check: calling solve()\n";);
|
||||||
|
|
@ -1659,6 +1659,7 @@ namespace smt {
|
||||||
|
|
||||||
bool theory_nseq::check_length_coherence() {
|
bool theory_nseq::check_length_coherence() {
|
||||||
if (m_relevant_lengths.empty())
|
if (m_relevant_lengths.empty())
|
||||||
|
// TODO: Make use of this; so far we always introduce lengths always
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
SASSERT(m_nielsen.sat_node());
|
SASSERT(m_nielsen.sat_node());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue