Do not eliminate variables that are equal to unevaluatable terms (#4267)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Wed, 20 May 2020 02:48:01 +0000 (21:48 -0500)
committerGitHub <noreply@github.com>
Wed, 20 May 2020 02:48:01 +0000 (21:48 -0500)
commitaf874a5c7a2ff134da0d4c20d06a0626d3e36d9b
tree16ad9de2b0c5753d2cd4cd3fcdd43bf8fbd55a71
parent9712a20e6585728c7d0453e64e1e3b06a7d37b7f
Do not eliminate variables that are equal to unevaluatable terms (#4267)

When we eliminate a variable x -> v during simplification, it may be the case that v contains "unevaluated" operators like forall, choice, etc. Thus, we do not produce correct models for such inputs unless simplification is disabled.

This PR ensures we only eliminate variables when v contains only evaluated operators.

Additionally, the kinds registered as unevaluated were slightly modified so that when we are in a logic like QF_LIA, there are no registered unevaluated operators, hence the check above is unnecessary. This is to minimize the performance impact of this change.

Fixes #4500.
24 files changed:
src/expr/node_algorithm.cpp
src/expr/node_algorithm.h
src/theory/arith/theory_arith.cpp
src/theory/arith/theory_arith.h
src/theory/arith/theory_arith_private.cpp
src/theory/arrays/theory_arrays.cpp
src/theory/builtin/theory_builtin.cpp
src/theory/bv/theory_bv.cpp
src/theory/quantifiers/theory_quantifiers.cpp
src/theory/sets/theory_sets.cpp
src/theory/sets/theory_sets_private.cpp
src/theory/sets/theory_sets_private.h
src/theory/strings/theory_strings.cpp
src/theory/strings/theory_strings.h
src/theory/theory.cpp
src/theory/theory.h
src/theory/theory_model.cpp
src/theory/theory_model.h
test/regress/CMakeLists.txt
test/regress/regress0/quantifiers/quant-model-simplification.smt2 [new file with mode: 0644]
test/regress/regress1/ho/nested_lambdas-AGT034^2.smt2
test/regress/regress1/ho/nested_lambdas-sat-SYO056^1-delta.smt2
test/regress/regress1/sets/choose1.smt2
test/regress/regress1/sets/choose4.smt2