namespace theory {
namespace quantifiers {
+bool QAttributes::isStandard() const
+{
+ return !d_sygus && !d_quant_elim && !isFunDef() && d_name.isNull();
+}
+
QuantAttributes::QuantAttributes( QuantifiersEngine * qe ) :
d_quantEngine(qe) {
Trace("quant-attr-debug") << "Set sygus " << n << std::endl;
SygusAttribute ca;
n.setAttribute( ca, true );
+ }
+ else if (attr == "quant-name")
+ {
+ Trace("quant-attr-debug") << "Set quant-name " << n << std::endl;
+ QuantNameAttribute qna;
+ n.setAttribute(qna, true);
} else if (attr == "sygus-synth-grammar") {
Assert( node_values.size()==1 );
Trace("quant-attr-debug") << "Set sygus synth grammar " << n << " to "
Trace("quant-attr") << "Attribute : sygus : " << q << std::endl;
qa.d_sygus = true;
}
+ if (avar.getAttribute(QuantNameAttribute()))
+ {
+ Trace("quant-attr") << "Attribute : quantifier name : " << avar
+ << " for " << q << std::endl;
+ qa.d_name = avar;
+ }
if( avar.getAttribute(SynthesisAttribute()) ){
Trace("quant-attr") << "Attribute : synthesis : " << q << std::endl;
qa.d_synthesis = true;
struct SygusAttributeId {};
typedef expr::Attribute< SygusAttributeId, bool > SygusAttribute;
+/**Attribute to give names to quantified formulas */
+struct QuantNameAttributeId
+{
+};
+typedef expr::Attribute<QuantNameAttributeId, bool> QuantNameAttribute;
+
/** Attribute true for quantifiers that are synthesis conjectures */
struct SynthesisAttributeId {};
typedef expr::Attribute< SynthesisAttributeId, bool > SynthesisAttribute;
/** the instantiation pattern list for this quantified formula (its 3rd child)
*/
Node d_ipl;
+ /** the name of this quantified formula */
+ Node d_name;
/** the quantifier id associated with this formula */
Node d_qid_num;
/** is this quantified formula a rewrite rule? */
- bool isRewriteRule() { return !d_rr.isNull(); }
+ bool isRewriteRule() const { return !d_rr.isNull(); }
/** is this quantified formula a function definition? */
- bool isFunDef() { return !d_fundef_f.isNull(); }
+ bool isFunDef() const { return !d_fundef_f.isNull(); }
+ /**
+ * Is this a standard quantifier? A standard quantifier is one that we can
+ * perform destructive updates (variable elimination, miniscoping, etc).
+ *
+ * A quantified formula is not standard if it is sygus, one for which
+ * we are performing quantifier elimination, is a function definition, or
+ * has a name.
+ */
+ bool isStandard() const;
};
/** This class caches information about attributes of quantified formulas
bool QuantifiersRewriter::doOperation( Node q, int computeOption, QAttributes& qa ){
bool is_strict_trigger = qa.d_hasPattern && options::userPatternsQuant()==USER_PAT_MODE_TRUST;
- bool is_std = !qa.d_sygus && !qa.d_quant_elim && !qa.isFunDef() && !is_strict_trigger;
+ bool is_std = qa.isStandard() && !is_strict_trigger;
if (computeOption == COMPUTE_ELIM_SYMBOLS)
{
return true;
out.handleUserAttribute( "conjecture", this );
out.handleUserAttribute( "fun-def", this );
out.handleUserAttribute( "sygus", this );
+ out.handleUserAttribute("quant-name", this);
out.handleUserAttribute("sygus-synth-grammar", this);
out.handleUserAttribute( "sygus-synth-fun-var-list", this );
out.handleUserAttribute( "synthesis", this );