Fix term registration and non-theory-preprocessed terms in substitutions (#6080)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Wed, 10 Mar 2021 16:06:27 +0000 (10:06 -0600)
committerGitHub <noreply@github.com>
Wed, 10 Mar 2021 16:06:27 +0000 (16:06 +0000)
commitcdcdd49a79ba03966cbb29c4f380f426c95a7d3a
treede8cf667daead76fa107e8513c2a7915435d2473
parent2ff196ccba2ce611fe7320ef775955c291d34dab
Fix term registration and non-theory-preprocessed terms in substitutions (#6080)

This fixes two issues for preprocessing:
(1) The term preregistration visitor was calling preRegister on terms multiple times in a SAT context, which the linear arithmetic solver is sensitive to.
(2) It was possible for non-preprocessed terms to appear in assertions if they were on the RHS of substitutions learned by non-clausal simplification, and substituted into assertions post-theory-preprocessing.

To fix (1), the SharedTermsVisitor is update to track which theories has preregistered each term, as is done in the PreRegisterVisitor. To fix (2), we no longer apply-subst after theory preprocessing.

These two fixes are required to fix #6071.

Note: we should performance test this on SMT-LIB.
src/smt/process_assertions.cpp
src/theory/arith/theory_arith_private.cpp
src/theory/shared_solver.cpp
src/theory/term_registration_visitor.cpp
src/theory/term_registration_visitor.h
test/regress/regress1/strings/issue6071-arith-prereg-i.smt2 [new file with mode: 0644]