3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-10 19:27:06 +00:00

detect quantifiers in model expressions to quiet down failing model validation

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2016-11-07 06:56:36 -08:00
parent 75cfd14e5a
commit ef9230d8f8
2 changed files with 5 additions and 2 deletions

View file

@ -181,7 +181,7 @@ bool macro_util::is_left_simple_macro(expr * n, unsigned num_decls, app_ref & he
expr * lhs = to_app(n)->get_arg(0);
expr * rhs = to_app(n)->get_arg(1);
if (is_macro_head(lhs, num_decls) && !is_forbidden(to_app(lhs)->get_decl()) &&
!occurs(to_app(lhs)->get_decl(), rhs) && !has_quantifiers(rhs)) {
!occurs(to_app(lhs)->get_decl(), rhs)) {
head = to_app(lhs);
def = rhs;
return true;
@ -213,7 +213,7 @@ bool macro_util::is_right_simple_macro(expr * n, unsigned num_decls, app_ref & h
expr * lhs = to_app(n)->get_arg(0);
expr * rhs = to_app(n)->get_arg(1);
if (is_macro_head(rhs, num_decls) && !is_forbidden(to_app(rhs)->get_decl()) &&
!occurs(to_app(rhs)->get_decl(), lhs) && !has_quantifiers(lhs)) {
!occurs(to_app(rhs)->get_decl(), lhs)) {
head = to_app(rhs);
def = lhs;
return true;

View file

@ -1568,6 +1568,9 @@ void cmd_context::validate_model() {
// If r contains as_array/store/map/const expressions, then we do not generate the error.
// TODO: improve evaluator for model expressions.
// Note that, if "a" evaluates to false, then the error will be generated.
if (has_quantifiers(r)) {
continue;
}
try {
for_each_expr(contains_array, r);
}