Do not expand APPLY_SELECTOR (#8174)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Tue, 8 Mar 2022 22:38:20 +0000 (16:38 -0600)
committerGitHub <noreply@github.com>
Tue, 8 Mar 2022 22:38:20 +0000 (22:38 +0000)
commit4da209c2260060501104568bde0d7539d80e9027
tree9a7d1583a61aba4ea97ec4aa792e4966216efc3a
parent72e997f13bc2e89d1c9b1c6b59d4e57a0cfcc0d1
Do not expand APPLY_SELECTOR (#8174)

Currently we expand (sel_C_n x) to (ite (is-C x) (sel_C_n_total x) (uf x)) during ppRewrite. This introduces ITEs very eagerly and moreover is not necessary since we do congruence over selectors.

This makes it so that we don't do this expansion. The code changes to use APPLY_SELECTOR everywhere instead of APPLY_SELECTOR_TOTAL, which can be deleted in a followup PR. It makes some of the datatype utilities more robust and independent of options.

This required changing one detail of the sygus solver to not do evaluation unfolding in cases where a selector chain was wrongly applied, as this now will not rewrite to a constant.
38 files changed:
src/expr/dtype_cons.cpp
src/theory/datatypes/datatypes_rewriter.cpp
src/theory/datatypes/datatypes_rewriter.h
src/theory/datatypes/infer_proof_cons.cpp
src/theory/datatypes/proof_checker.cpp
src/theory/datatypes/sygus_extension.cpp
src/theory/datatypes/theory_datatypes.cpp
src/theory/datatypes/theory_datatypes_utils.cpp
src/theory/datatypes/tuple_utils.cpp
src/theory/quantifiers/cegqi/ceg_dt_instantiator.cpp
src/theory/quantifiers/cegqi/ceg_instantiator.cpp
src/theory/quantifiers/conjecture_generator.cpp
src/theory/quantifiers/ematching/candidate_generator.cpp
src/theory/quantifiers/ematching/inst_match_generator.cpp
src/theory/quantifiers/ematching/trigger_term_info.cpp
src/theory/quantifiers/fmf/bounded_integers.cpp
src/theory/quantifiers/quant_conflict_find.cpp
src/theory/quantifiers/skolemize.cpp
src/theory/quantifiers/sygus/sygus_eval_unfold.cpp
src/theory/quantifiers/sygus/sygus_explain.cpp
src/theory/quantifiers/sygus/term_database_sygus.cpp
src/theory/quantifiers/term_database.cpp
src/theory/theory_model.cpp
src/theory/theory_model_builder.cpp
test/regress/CMakeLists.txt
test/regress/regress0/datatypes/data-nested-codata.smt2
test/regress/regress0/datatypes/parametric-alt-list.cvc.smt2
test/regress/regress0/quantifiers/pure_dt_cbqi.smt2
test/regress/regress1/cee-bug0909-dd-scope.smt2
test/regress/regress1/datatypes/non-simple-rec-param.smt2
test/regress/regress1/fmf/cons-sets-bounds.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/nun-0208-to.smt2
test/regress/regress1/strings/issue1105.smt2
test/regress/regress2/quantifiers/net-policy-no-time.smt2
test/unit/api/cpp/solver_black.cpp