3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-06-19 23:26:30 +00:00

re.plus is a regex as well

This commit is contained in:
CEisenhofer 2026-05-22 14:03:22 +02:00
parent 2ea1c74071
commit 7ede1b9c3d
3 changed files with 34 additions and 24 deletions

View file

@ -73,6 +73,9 @@ namespace euf {
if (m_seq.re.is_star(e))
return snode_kind::s_star;
if (m_seq.re.is_plus(e))
return snode_kind::s_plus;
if (m_seq.re.is_loop(e))
return snode_kind::s_loop;
@ -172,6 +175,7 @@ namespace euf {
}
case snode_kind::s_star:
case snode_kind::s_plus:
SASSERT(n->num_args() == 1);
n->m_ground = n->arg(0)->is_ground();
n->m_regex_free = false;
@ -759,6 +763,7 @@ namespace euf {
case snode_kind::s_concat: return "concat";
case snode_kind::s_power: return "power";
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_union: return "union";
case snode_kind::s_intersect: return "intersect";

View file

@ -45,6 +45,7 @@ namespace euf {
s_concat, // concatenation of two snodes (OP_SEQ_CONCAT)
s_power, // string exponentiation s^n (OP_SEQ_POWER)
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_union, // union r1|r2 (OP_RE_UNION)
s_intersect, // intersection r1&r2 (OP_RE_INTERSECT)
@ -165,6 +166,9 @@ namespace euf {
bool is_star() const {
return m_kind == snode_kind::s_star;
}
bool is_plus() const {
return m_kind == snode_kind::s_plus;
}
bool is_loop() const {
return m_kind == snode_kind::s_loop;
}