3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-03 22:05:45 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-03-23 17:27:10 -07:00
parent 28bdda326b
commit 0cf401c67b
3 changed files with 52 additions and 19 deletions

View file

@ -1775,14 +1775,26 @@ struct contains_underspecified_op_proc {
struct found {};
family_id m_array_fid;
datatype_util m_dt;
arith_util m_arith;
seq_util m_seq;
family_id m_seq_id;
contains_underspecified_op_proc(ast_manager & m):m_array_fid(m.mk_family_id("array")), m_dt(m), m_seq(m), m_seq_id(m_seq.get_family_id()) {}
contains_underspecified_op_proc(ast_manager & m):
m_array_fid(m.mk_family_id("array")),
m_dt(m),
m_arith(m),
m_seq(m),
m_seq_id(m_seq.get_family_id()) {}
void operator()(var * n) {}
void operator()(app * n) {
if (m_dt.is_accessor(n->get_decl()))
throw found();
if (n->get_family_id() == m_seq_id && m_seq.is_re(n))
throw found();
if (m_arith.plugin().is_considered_uninterpreted(n->get_decl()))
throw found();
if (m_arith.is_non_algebraic(n))
throw found();
if (n->get_family_id() == m_array_fid) {
decl_kind k = n->get_decl_kind();
if (k == OP_AS_ARRAY ||
@ -1791,9 +1803,6 @@ struct contains_underspecified_op_proc {
k == OP_CONST_ARRAY)
throw found();
}
if (n->get_family_id() == m_seq_id && m_seq.is_re(n)) {
throw found();
}
}
void operator()(quantifier * n) {}
};
@ -1896,9 +1905,6 @@ void cmd_context::validate_model() {
if (m().is_true(r))
continue;
analyze_failure(evaluator, a, true);
IF_VERBOSE(11, model_smt2_pp(verbose_stream(), *this, *md, 0););
// The evaluator for array expressions is not complete
// If r contains as_array/store/map/const expressions, then we do not generate the error.
// TODO: improve evaluator for model expressions.
@ -1913,6 +1919,9 @@ void cmd_context::validate_model() {
catch (const contains_underspecified_op_proc::found &) {
continue;
}
analyze_failure(evaluator, a, true);
IF_VERBOSE(11, model_smt2_pp(verbose_stream(), *this, *md, 0););
TRACE("model_validate", model_smt2_pp(tout, *this, *md, 0););
invalid_model = true;
}