Do not expand theory definitions at the beginning of preprocessing (#5544)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Mon, 7 Dec 2020 15:51:32 +0000 (09:51 -0600)
committerGitHub <noreply@github.com>
Mon, 7 Dec 2020 15:51:32 +0000 (09:51 -0600)
commita062043b187afe410f0de3568f57594e74eb8d25
tree378fb9b51d7df2aabb17991317eeed4c2a31e941
parent85f14a1ba37949afbd33f38c8565dc5d45a300fe
Do not expand theory definitions at the beginning of preprocessing (#5544)

This updates the preprocessor so that expand definitions does not expand theory symbols at the beginning of preprocessing.

This also restores the previous expandDefinitions method in arithmetic, which is required for correctly interpreting division by zero in models, but should not be applied at the beginning of preprocessing. Moreover it ensures that only partial operators are eliminated in arithmetic expandDefinitions, which required an additional argument partialOnly to arith::OperatorElim.

This adds -q to suppress warnings for many quantified regressions which now emit warnings with --check-model. This will be addressed later as part of CVC4/cvc4-wishues#43.

The purpose of this PR is two-fold:
(1) Currently our responses to get-value are incorrect for partial operators like div, mod, seq.nth since partial operators can be left unevaluated.
(2) The preprocessor should have the opportunity to rewrite and eliminate extended operators before they are expanded. This is required for addressing performance issues for non-linear arithmetic. It is also required for ensuring that trigger selection can be done properly for datatype selectors (to be addressed on a later PR).
49 files changed:
src/smt/process_assertions.cpp
src/theory/arith/arith_preprocess.cpp
src/theory/arith/arith_preprocess.h
src/theory/arith/operator_elim.cpp
src/theory/arith/operator_elim.h
src/theory/arith/theory_arith.cpp
src/theory/arith/theory_arith.h
src/theory/arrays/theory_arrays.cpp
src/theory/bv/theory_bv.cpp
src/theory/datatypes/theory_datatypes.cpp
src/theory/fp/theory_fp.cpp
src/theory/quantifiers/cegqi/ceg_instantiator.cpp
src/theory/quantifiers/quant_split.cpp
src/theory/sets/theory_sets.cpp
src/theory/sets/theory_sets.h
src/theory/strings/theory_strings.cpp
src/theory/theory_engine.cpp
test/regress/CMakeLists.txt
test/regress/regress0/arith/div-chainable.smt2
test/regress/regress0/arith/issue3413.smt2
test/regress/regress0/bug484.smt2
test/regress/regress0/datatypes/issue2838.cvc
test/regress/regress0/fmf/fmc_unsound_model.smt2
test/regress/regress0/fmf/sc_bad_model_1221.smt2
test/regress/regress1/arith/issue4985-model-success.smt2
test/regress/regress1/arith/issue4985b-model-success.smt2
test/regress/regress1/fmf/LeftistHeap.scala-8-ncm.smt2
test/regress/regress1/fmf/german169.smt2
test/regress/regress1/fmf/issue3626.smt2
test/regress/regress1/fmf/jasmin-cdt-crash.smt2
test/regress/regress1/fmf/loopy_coda.smt2
test/regress/regress1/fmf/lst-no-self-rev-exp.smt2
test/regress/regress1/fmf/memory_model-R_cpp-dd.cvc
test/regress/regress1/fmf/nun-0208-to.smt2
test/regress/regress1/ho/issue4065-no-rep.smt2
test/regress/regress1/quantifiers/issue5470-aext.smt2
test/regress/regress1/quantifiers/qbv-test-invert-bvudiv-0.smt2
test/regress/regress1/quantifiers/qbv-test-invert-bvudiv-1.smt2
test/regress/regress1/quantifiers/qbv-test-invert-bvurem-1-neq.smt2
test/regress/regress1/quantifiers/qbv-test-invert-bvurem-1.smt2
test/regress/regress1/quantifiers/qbv-test-urem-rewrite.smt2
test/regress/regress1/sets/is_singleton1.smt2
test/regress/regress1/sets/issue5271.smt2
test/regress/regress1/sets/sets-tuple-poly.cvc
test/regress/regress1/sets/univ-set-uf-elim.smt2
test/regress/regress1/sygus/issue3944-div-rewrite.smt2
test/regress/regress1/trim.cvc
test/regress/regress2/bv_to_int_5095_2.smt2
test/regress/regress2/quantifiers/net-policy-no-time.smt2