Our policy is now accurate to the help message on prenexUserQuant: we only prenex quantified formulas if they do not have user-provided patterns. Previously we also did not prenex any quantified formulas with any annotations.
This should avoid some more "unknown" responses on facebook benchmarks.
Also fixes a minor issue with when we print warnings about quantified formulas with no triggers.
FYI @barrettcw .
{
generateTriggers(f);
if (d_counter[f] == 0 && d_auto_gen_trigger[0][f].empty()
- && d_auto_gen_trigger[1][f].empty() && f.getNumChildren() == 2)
+ && d_auto_gen_trigger[1][f].empty() && !QuantAttributes::hasPattern(f))
{
Trace("trigger-warn") << "Could not find trigger for " << f << std::endl;
Output(options::OutputTag::TRIGGER)
&& q.getNumChildren() == 3)
{
//if strict triggers, take ownership of this quantified formula
- bool hasPat = false;
- for (const Node& qc : q[2])
+ if (QuantAttributes::hasPattern(q))
{
- if (qc.getKind() == INST_PATTERN || qc.getKind() == INST_NO_PATTERN)
- {
- hasPat = true;
- break;
- }
- }
- if( hasPat ){
d_qreg.setOwner(q, this, 1);
}
}
return false;
}
+bool QuantAttributes::hasPattern(Node q)
+{
+ Assert(q.getKind() == FORALL);
+ if (q.getNumChildren() != 3)
+ {
+ return false;
+ }
+ for (const Node& qc : q[2])
+ {
+ if (qc.getKind() == INST_PATTERN || qc.getKind() == INST_NO_PATTERN)
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
void QuantAttributes::computeAttributes( Node q ) {
computeQuantAttributes( q, d_qattr[q] );
QAttributes& qa = d_qattr[q];
static Node getFunDefBody( Node q );
/** is quant elim annotation */
static bool checkQuantElimAnnotation( Node ipl );
+ /** does q have a user-provided pattern? */
+ static bool hasPattern(Node q);
/** is function definition */
bool isFunDef( Node q );
Kind k = body.getKind();
if (k == FORALL)
{
- if( ( pol || prenexAgg ) && ( options::prenexQuantUser() || body.getNumChildren()==2 ) ){
+ if ((pol || prenexAgg)
+ && (options::prenexQuantUser() || !QuantAttributes::hasPattern(body)))
+ {
std::vector< Node > terms;
std::vector< Node > subs;
BoundVarManager* bvm = nm->getBoundVarManager();
regress1/quantifiers/cdt-0208-to.smt2
regress1/quantifiers/const.cvc
regress1/quantifiers/constfunc.cvc
+ regress1/quantifiers/ddatv-delta2.smt2
regress1/quantifiers/dt-tc-opt-small.smt2
regress1/quantifiers/dump-inst-i.smt2
regress1/quantifiers/dump-inst-proof.smt2
--- /dev/null
+(set-logic ALL)
+(set-info :status unsat)
+(declare-sort U 0)
+(declare-datatypes ((T 0) (D 0)) (((E) (o (b Bool)) (I (t Int)) (i (v D)) (R (l T) (u T))) ((i (v U)))))
+(declare-datatypes ((H 0)) (((M (h T)))))
+(declare-fun S (U Int) T)
+(declare-fun n () H)
+(assert (and
+(not (b (o (or (b (o (or (b (o (or (b (o (= (t (S (v (v (S (v (v E)) 0))) (t E))) (t (S (v (v (S (v (v (h n))) 0))) (t E))))))))))))))))
+(b (o (forall ((i Int)) (or (< i (t (u (R E E)))) (b (o (forall ((z Int)) (! (or (b (o (or (b (o (< (t (S (v (v (S (v (v (h n))) z))) (t E))) (t (S (v (v (S (v (v (h n))) 0))) (t (I i))))))))))) :qid id))))))))))
+(check-sat)