Do not expand definitions of extended arithmetic operators (#5433)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Wed, 18 Nov 2020 15:07:08 +0000 (09:07 -0600)
committerGitHub <noreply@github.com>
Wed, 18 Nov 2020 15:07:08 +0000 (09:07 -0600)
commit639540664a763a2a552d659eb594b04fb2656f5b
treefbdc4d89f8624630142bbc7fabd317c0b7cf6658
parent3c246952ce90ae7c27b4c0646fce05bc69037f46
Do not expand definitions of extended arithmetic operators (#5433)

This PR makes it so that extended arithmetic operators are not expanded during expand definitions. Instead they are eliminated at theory preprocessing, which occurs as the last step of preprocessing.

The motivation for this is three fold:
(1) Some quantified LIA benchmarks lead to CVC4 failing to eliminate div functions from quantifier instantiation, this leads to spurious logic failures. A regression is included, which now is correctly solved.
(2) We should allow better rewriting and preprocessing for extended arithmetic functions, especially for div/mod which is important for many users of QF_NIA.
(3) More generally,Theory::expandDefinitions will be deleted. All functionalities in expandDefinitions should move to Theory::ppRewrite.

This changes impacts many benchmarks that involve non-linear and quantifiers:

Many benchmarks (as expected) give a warning during check-models since (/ n 0) cannot be evaluated. I've added -q to disable these warnings. Fully addressing this is part of an agenda to improve our support for --check-models.
Several fuzzing benchmarks involving NL+quantifiers now time out. However, several can be solved by --sygus-inst, which is now the preferred instantiation strategy for NL+quantifiers.
2 other non-linear regressions time out, which are disabled in this PR.
one sygus-inference benchmark (regress1/sygus/issue3498.smt2), now correctly times out (previously it did not timeout since the preprocessor was unable to apply sygus-inference and resorted to normal methods, now sygus-inference can apply but as expected times out).
Fixes #5237.
17 files changed:
src/smt/process_assertions.cpp
src/theory/arith/theory_arith.cpp
src/theory/arith/theory_arith.h
src/theory/arith/theory_arith_private.cpp
test/regress/CMakeLists.txt
test/regress/regress0/arith/div.02.smt2
test/regress/regress0/nl/issue3475.smt2
test/regress/regress0/quantifiers/issue4476-ext-rew.smt2
test/regress/regress1/arith/div.06.smt2
test/regress/regress1/arith/mod.03.smt2
test/regress/regress1/nl/div-mod-partial.smt2
test/regress/regress1/quantifiers/issue3664.smt2
test/regress/regress1/quantifiers/issue4062-cegqi-aux.smt2
test/regress/regress1/quantifiers/issue4685-wrewrite.smt2
test/regress/regress1/quantifiers/lia-witness-div-pp.smt2 [new file with mode: 0644]
test/regress/regress1/sets/issue4391-card-lasso.smt2
test/regress/regress1/sygus/issue3634.smt2