Simplify and fix check models (#5685)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Thu, 17 Dec 2020 09:10:39 +0000 (03:10 -0600)
committerGitHub <noreply@github.com>
Thu, 17 Dec 2020 09:10:39 +0000 (10:10 +0100)
commit94334c412be47c1555e52d9e20a6ff5e18817249
tree7975cb61152ce3536f20777c77020b09d1f2ccd7
parent80e02468be0b5821e74a097179299c9afa23d10a
Simplify and fix check models (#5685)

Currently --check-models is implemented by replaying several preprocessing steps, including theory-specific expand definitions, and then checking whether the result evaluates to true.

However, by having --check-models rely on complex preprocessing machinery defeats its purpose, as these steps are part of its trusted base.

Moreover, issue #5645 demonstrates that this may lead to spurious errors where we incorrectly conclude that an input assertion is false, when it is not.

This PR significantly simplifies --check-models so that it only relies on define-fun expansion + rewriting + evaluation. This ensures that --check-models is "sound" i.e. it does not falsely report a formula as evaluating to false. As a consequence, this makes check-models give warnings more often, i.e. when partial operators are involved, thus -q is added to silence warnings on some regressions.

A followup PR will use a satisfiability check on the input formula post-expand-definitions to properly implement a trustworthy version of check-models that is robust for partial operators.

Fixes #5645.
18 files changed:
src/smt/check_models.cpp
test/regress/CMakeLists.txt
test/regress/regress0/datatypes/issue1433.smt2
test/regress/regress0/decision/quant-ex1.smt2
test/regress/regress0/fmf/QEpres-uf.855035.smtv1.smt2
test/regress/regress0/fp/issue3536.smt2
test/regress/regress0/fp/issue3619.smt2
test/regress/regress0/parser/to_fp.smt2
test/regress/regress0/quantifiers/issue5645-dt-cm-spurious.smt2 [new file with mode: 0644]
test/regress/regress1/arith/arith-brab-test.smt2
test/regress/regress1/bug507.smt2
test/regress/regress1/fmf/Hoare-z3.931718.smtv1.smt2
test/regress/regress1/fmf/am-bad-model.cvc
test/regress/regress1/fmf/refcount24.cvc.smt2
test/regress/regress1/quantifiers/intersection-example-onelane.proof-node22337.smt2
test/regress/regress1/sets/choose3.smt2
test/regress/regress1/wrong-qfabvfp-smtcomp2018.smt2
test/regress/regress2/issue3687-check-models.smt2