diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2021-01-20 12:59:13 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-20 12:59:13 -0600 |
commit | 273219488df1068a1abd444fc677bee57748bc32 (patch) | |
tree | fe7b94eaf011f5a26302a499e840ab9f77c3db19 /src/theory/quantifiers | |
parent | 6235612ddfdd59432eedf771a65c248d5b3d0469 (diff) |
Fix corner case of wrongly applied selector as trigger (#5786)
Fixes #5766.
Diffstat (limited to 'src/theory/quantifiers')
-rw-r--r-- | src/theory/quantifiers/ematching/candidate_generator.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/theory/quantifiers/ematching/candidate_generator.cpp b/src/theory/quantifiers/ematching/candidate_generator.cpp index 728ba61e8..0fd5249e8 100644 --- a/src/theory/quantifiers/ematching/candidate_generator.cpp +++ b/src/theory/quantifiers/ematching/candidate_generator.cpp @@ -279,20 +279,25 @@ CandidateGeneratorSelector::CandidateGeneratorSelector(QuantifiersEngine* qe, d_selOp = qe->getTermDatabase()->getMatchOperator(mpatExp[1]); d_ufOp = qe->getTermDatabase()->getMatchOperator(mpatExp[2]); } - else + else if (mpatExp.getKind() == APPLY_SELECTOR_TOTAL) { // corner case of datatype with one constructor - Assert(mpatExp.getKind() == APPLY_SELECTOR_TOTAL); d_selOp = qe->getTermDatabase()->getMatchOperator(mpatExp); } + else + { + // corner case of a wrongly applied selector as a trigger + Assert(mpatExp.getKind() == APPLY_UF); + d_ufOp = qe->getTermDatabase()->getMatchOperator(mpatExp); + } Assert(d_selOp != d_ufOp); } void CandidateGeneratorSelector::reset(Node eqc) { Trace("sel-trigger-debug") << "Reset in eqc=" << eqc << std::endl; - // start with d_selOp - resetForOperator(eqc, d_selOp); + // start with d_selOp, if it exists + resetForOperator(eqc, !d_selOp.isNull()? d_selOp : d_ufOp); } Node CandidateGeneratorSelector::getNextCandidate() |