3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-29 20:05:51 +00:00

arith_solver (#4733)

* porting arithmetic solver

* integrating arithmetic

* lp

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* na

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* na

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* na

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-10-16 10:49:46 -07:00 committed by GitHub
parent 2841796a92
commit 44679d8f5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 3172 additions and 403 deletions

View file

@ -22,8 +22,10 @@ namespace array {
sat::literal solver::internalize(expr* e, bool sign, bool root, bool redundant) {
SASSERT(m.is_bool(e));
if (!visit_rec(m, e, sign, root, redundant))
if (!visit_rec(m, e, sign, root, redundant)) {
TRACE("array", tout << mk_pp(e, m) << "\n";);
return sat::null_literal;
}
return expr2literal(e);
}
@ -81,7 +83,7 @@ namespace array {
}
void solver::internalize_ext(euf::enode* n) {
push_axiom(extensionality_axiom(n));
push_axiom(extensionality_axiom(n->get_arg(0), n->get_arg(1)));
}
void solver::internalize_default(euf::enode* n) {
@ -95,6 +97,8 @@ namespace array {
}
bool solver::visit(expr* e) {
if (visited(e))
return true;
if (!is_app(e) || to_app(e)->get_family_id() != get_id()) {
ctx.internalize(e, m_is_redundant);
euf::enode* n = expr2enode(e);
@ -192,5 +196,20 @@ namespace array {
return false;
}
func_decl_ref_vector const& solver::sort2diff(sort* s) {
func_decl_ref_vector* result = nullptr;
if (m_sort2diff.find(s, result))
return *result;
unsigned dimension = get_array_arity(s);
result = alloc(func_decl_ref_vector, m);
for (unsigned i = 0; i < dimension; ++i)
result->push_back(a.mk_array_ext(s, i));
m_sort2diff.insert(s, result);
ctx.push(insert_map<euf::solver, obj_map<sort, func_decl_ref_vector*>, sort*>(m_sort2diff, s));
ctx.push(new_obj_trail<euf::solver,func_decl_ref_vector>(result));
return *result;
}
}