3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 01:25:31 +00:00

add definitions for under-specified cases of arithmetic operators #2663 #2676 #2679

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2019-11-06 18:24:22 +01:00
parent 6cf7d8e523
commit 1e0c1cefd6
13 changed files with 59 additions and 20 deletions

View file

@ -37,4 +37,4 @@ void theory_array_params::display(std::ostream & out) const {
DISPLAY_PARAM(m_array_always_prop_upward);
DISPLAY_PARAM(m_array_lazy_ieq);
DISPLAY_PARAM(m_array_lazy_ieq_delay);
}
}

View file

@ -3318,6 +3318,7 @@ namespace smt {
\brief Execute some finalization code after performing the search.
*/
lbool context::check_finalize(lbool r) {
if (r == l_undef) std::cout << m_unknown << "\n";
TRACE("after_search", display(tout << "result: " << r << "\n"););
display_profile(verbose_stream());
if (r == l_true && get_cancel_flag()) {

View file

@ -74,7 +74,7 @@ namespace smt {
std::ostream& display_last_failure(std::ostream& out) const;
std::string last_failure_as_string() const;
void set_reason_unknown(char const* msg) { m_unknown = msg; }
void set_reason_unknown(char const* msg) { m_unknown = msg; std::cout << m_unknown << "\n"; }
void set_progress_callback(progress_callback *callback);
@ -1009,6 +1009,8 @@ namespace smt {
}
#endif
void add_eq(enode * n1, enode * n2, eq_justification js);
protected:
void push_new_th_eq(theory_id th, theory_var lhs, theory_var rhs);
@ -1016,7 +1018,6 @@ namespace smt {
friend class add_eq_trail;
void add_eq(enode * n1, enode * n2, eq_justification js);
void remove_parents_from_cg_table(enode * r1);

View file

@ -201,6 +201,10 @@ namespace smt {
return m_root;
}
void set_root(enode* r) {
m_root = r;
}
enode * get_next() const {
return m_next;
}

View file

@ -19,12 +19,12 @@ Revision History:
#ifndef THEORY_ARITH_CORE_H_
#define THEORY_ARITH_CORE_H_
#include "smt/smt_context.h"
#include "smt/theory_arith.h"
#include "ast/ast_pp.h"
#include "ast/ast_ll_pp.h"
#include "smt/smt_model_generator.h"
#include "ast/ast_smt2_pp.h"
#include "smt/smt_context.h"
#include "smt/theory_arith.h"
#include "smt/smt_model_generator.h"
namespace smt {
@ -3266,6 +3266,7 @@ namespace smt {
template<typename Ext>
void theory_arith<Ext>::init_model(model_generator & m) {
TRACE("theory_arith", tout << "init model invoked...\n";);
context& ctx = get_context();
m_factory = alloc(arith_factory, get_manager());
m.register_factory(m_factory);
compute_epsilon();
@ -3273,20 +3274,25 @@ namespace smt {
refine_epsilon();
}
for (app* n : m_underspecified_ops) {
enode* e = nullptr;
if (m_util.is_div(n)) {
mk_enode(m_util.mk_div0(n->get_arg(0), n->get_arg(1)));
e = mk_enode(m_util.mk_div0(n->get_arg(0), n->get_arg(1)));
}
else if (m_util.is_idiv(n)) {
mk_enode(m_util.mk_idiv0(n->get_arg(0), n->get_arg(1)));
e = mk_enode(m_util.mk_idiv0(n->get_arg(0), n->get_arg(1)));
}
else if (m_util.is_rem(n)) {
mk_enode(m_util.mk_rem0(n->get_arg(0), n->get_arg(1)));
e = mk_enode(m_util.mk_rem0(n->get_arg(0), n->get_arg(1)));
}
else if (m_util.is_mod(n)) {
mk_enode(m_util.mk_mod0(n->get_arg(0), n->get_arg(1)));
e = mk_enode(m_util.mk_mod0(n->get_arg(0), n->get_arg(1)));
}
else if (m_util.is_power(n)) {
mk_enode(m_util.mk_power0(n->get_arg(0), n->get_arg(1)));
e = mk_enode(m_util.mk_power0(n->get_arg(0), n->get_arg(1)));
}
if (e) {
ctx.mark_as_relevant(e);
ctx.add_eq(e, ctx.get_enode(n), eq_justification());
}
}
}