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()
regress1/quantifiers/issue5484b-qe.smt2
regress1/quantifiers/issue5506-qe.smt2
regress1/quantifiers/issue5507-qe.smt2
+ regress1/quantifiers/issue5766-wrong-sel-trigger.smt2
regress1/quantifiers/issue993.smt2
regress1/quantifiers/javafe.ast.StmtVec.009.smt2
regress1/quantifiers/lia-witness-div-pp.smt2
--- /dev/null
+; COMMAND-LINE: --sygus-inst --no-check-models
+; EXPECT: sat
+(set-logic ALL)
+(set-info :status sat)
+(declare-datatypes ((a 0))
+ (((b (c a) (d a)) (n (o a)) (e (f a) (g a)) (h (i (_ BitVec 1))))))
+(declare-fun j (a) Bool)
+(declare-fun k (a) a)
+(declare-fun l () a)
+(assert (forall ((m a)) (=> ((_ is h) m) (j (ite ((_ is b) m) (b m m)
+ (ite ((_ is e) m) (e m m) (ite ((_ is b) m) (e m m) (ite (xor ((_
+ is n) m) ((_ is e) m)) (b m m) (ite (xor ((_ is n) m) ((_ is n) (o
+ m))) (k (o m)) (ite ((_ is n) m) m (ite ((_ is h) m) m
+ l)))))))))))
+(check-sat)