mirror of
https://github.com/Z3Prover/z3
synced 2026-02-20 07:24:40 +00:00
add interpretations when there are ranges
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
65f38eac16
commit
2e4402c8f3
8 changed files with 427 additions and 158 deletions
|
|
@ -233,14 +233,25 @@ bool finite_set_decl_plugin::is_value(app * e) const {
|
|||
continue;
|
||||
}
|
||||
|
||||
bool is_setop =
|
||||
is_app_of(a, m_family_id, OP_FINITE_SET_UNION)
|
||||
|| is_app_of(a, m_family_id, OP_FINITE_SET_INTERSECT)
|
||||
|| is_app_of(a, m_family_id, OP_FINITE_SET_DIFFERENCE);
|
||||
// Check if it's a union
|
||||
if (is_app_of(a, m_family_id, OP_FINITE_SET_UNION)) {
|
||||
if (is_setop) {
|
||||
// Add arguments to todo list
|
||||
for (auto arg : *a)
|
||||
todo.push_back(arg);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_app_of(a, m_family_id, OP_FINITE_SET_RANGE)) {
|
||||
for (auto arg : *a)
|
||||
if (!m_manager->is_value(arg))
|
||||
return false;
|
||||
continue;
|
||||
}
|
||||
|
||||
// can add also ranges where lo and hi are values.
|
||||
|
||||
// If it's none of the above, it's not a value
|
||||
|
|
@ -271,3 +282,10 @@ bool finite_set_decl_plugin::are_distinct(app* e1, app* e2) const {
|
|||
// that the other doesn't contain. Such as (union (singleton a) (singleton b)) and (singleton c) where c is different from a, b.
|
||||
return false;
|
||||
}
|
||||
|
||||
func_decl *finite_set_util::mk_range_decl() {
|
||||
arith_util a(m_manager);
|
||||
sort *i = a.mk_int();
|
||||
sort *domain[2] = {i, i};
|
||||
return m_manager.mk_func_decl(m_fid, OP_FINITE_SET_RANGE, 0, nullptr, 2, domain, nullptr);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue