Do not combine theories if theory engine needs check (#5861)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Sat, 6 Feb 2021 01:14:01 +0000 (19:14 -0600)
committerGitHub <noreply@github.com>
Sat, 6 Feb 2021 01:14:01 +0000 (19:14 -0600)
commit9e6ca7166cc2c3444429ee691f7b0c32281eddf1
tree8b2ff25866cc1c73b10f1872b55af91445398b03
parent7c86d698dad7180096ec2c81012a3ee18d2b94f9
Do not combine theories if theory engine needs check (#5861)

In rare cases, theory combination would be run when theory engine still needs check. This was limited to cases where the output channel is used but no lemmas were sent (TheoryEngine::needCheck() vs. d_lemmasAdded).

This led to problems in the theory of sets, which does not run a full effort check if theory engine needs check (since it knows it will be called to check again). However, running theory combination in these cases is not safe since theory of sets computes information pertaining to the care graph during its full effort check. Running theory combination otherwise would lead to theory of sets using stale data, leading to crashes due to terms not appearing in the equality engine.

This fixes #4124 (which appears not to trigger on master anyways currently).

This bug has also appeared on my sat relevancy development branch, hence fixing on master.
src/theory/sets/theory_sets_private.cpp
src/theory/theory_engine.cpp
test/regress/CMakeLists.txt
test/regress/regress1/sets/issue4124-need-check.smt2 [new file with mode: 0644]