3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-04-03 18:31:08 +00:00

Remove s_other from snode_kind; unify under s_var and is_var() (#9087)

* remove s_other, use s_var and is_var() instead

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/d56594ed-7f7e-436a-a4b2-e6dc986b18a8

* fix build: add reset() override to test dummy solver stubs

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/d437376d-55d8-4087-baf1-e89451d2d597

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
Copilot 2026-03-22 12:05:24 -07:00 committed by GitHub
parent 63830085b6
commit 6b5401ef68
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 16 additions and 12 deletions

View file

@ -46,7 +46,7 @@ namespace euf {
snode_kind sgraph::classify(expr* e) const {
if (!is_app(e))
return snode_kind::s_other;
return snode_kind::s_var;
if (m_seq.str.is_empty(e))
return snode_kind::s_empty;
@ -55,7 +55,7 @@ namespace euf {
zstring s;
if (m_seq.str.is_string(e, s) && s.empty())
return snode_kind::s_empty;
return snode_kind::s_other;
return snode_kind::s_var;
}
if (m_seq.str.is_concat(e) || m_seq.re.is_concat(e))
@ -108,7 +108,7 @@ namespace euf {
if (m_seq.is_seq(e->get_sort()) && (is_uninterp(e) || m_seq.is_skolem(e)))
return snode_kind::s_var;
return snode_kind::s_other;
return snode_kind::s_var;
}
void sgraph::compute_metadata(snode* n) {
@ -376,7 +376,7 @@ namespace euf {
// recursively register children
// for seq/re children, create classified snodes
// for other children (e.g. integer exponents), create s_other snodes
// for other children, e.g. integer exponents, create s_var snodes
snode_vector child_nodes;
for (unsigned i = 0; i < arity; ++i) {
expr* ch = a->get_arg(i);
@ -751,7 +751,6 @@ namespace euf {
case snode_kind::s_range: return "range";
case snode_kind::s_to_re: return "to_re";
case snode_kind::s_in_re: return "in_re";
case snode_kind::s_other: return "other";
}
return "?";
};

View file

@ -53,12 +53,11 @@ namespace euf {
s_range, // character range [lo,hi] (OP_RE_RANGE)
s_to_re, // string to regex (OP_SEQ_TO_RE)
s_in_re, // regex membership (OP_SEQ_IN_RE)
s_other, // other sequence expression not directly classified
};
class snode {
expr* m_expr = nullptr;
snode_kind m_kind = snode_kind::s_other;
snode_kind m_kind = snode_kind::s_var;
unsigned m_id = UINT_MAX;
unsigned m_num_args = 0;
@ -114,7 +113,7 @@ namespace euf {
bool is_empty() const { return m_kind == snode_kind::s_empty; }
bool is_char() const { return m_kind == snode_kind::s_char; }
bool is_var() const { return m_kind == snode_kind::s_var || m_kind == snode_kind::s_other; }
bool is_var() const { return m_kind == snode_kind::s_var; }
bool is_unit() const { return m_kind == snode_kind::s_unit; }
bool is_char_or_unit() const {
return m_kind == snode_kind::s_char || m_kind == snode_kind::s_unit;