mirror of
https://github.com/Z3Prover/z3
synced 2025-08-09 12:50:32 +00:00
fix unsoundness in explanation handling for nested datatypes and sequences
This commit is contained in:
parent
e6e0c74324
commit
1e8f9078e3
4 changed files with 54 additions and 30 deletions
|
@ -971,6 +971,22 @@ bool seq_util::str::is_len_sub(expr const* s, expr*& l, expr*& u, rational& k) c
|
|||
return false;
|
||||
}
|
||||
|
||||
bool seq_util::str::is_concat_of_units(expr* s) const {
|
||||
ptr_vector<expr> todo;
|
||||
todo.push_back(s);
|
||||
while (!todo.empty()) {
|
||||
expr* e = todo.back();
|
||||
todo.pop_back();
|
||||
if (is_empty(e) || is_unit(e))
|
||||
continue;
|
||||
if (is_concat(e))
|
||||
todo.append(to_app(e)->get_num_args(), to_app(e)->get_args());
|
||||
else
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool seq_util::str::is_unit_string(expr const* s, expr_ref& c) const {
|
||||
zstring z;
|
||||
expr* ch = nullptr;
|
||||
|
|
|
@ -375,6 +375,7 @@ public:
|
|||
bool is_to_code(expr const* n) const { return is_app_of(n, m_fid, OP_STRING_TO_CODE); }
|
||||
|
||||
bool is_len_sub(expr const* n, expr*& l, expr*& u, rational& k) const;
|
||||
bool is_concat_of_units(expr* n) const;
|
||||
|
||||
/*
|
||||
tests if s is a single character string(c) or a unit (c)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue