summaryrefslogtreecommitdiff
path: root/src/theory
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2021-08-17 12:07:00 -0500
committerGitHub <noreply@github.com>2021-08-17 17:07:00 +0000
commitcf5376c18d8e4d6b3ed2d7b341279cf65fc16418 (patch)
treeafbfb5162c6ccc3111827f4080b968108be83152 /src/theory
parentd39e1b906b47ef8e953dac297fa0fb565dd040a4 (diff)
Fix policy for eliminating quantified formulas (#7017)
This also consolidates the option strictTriggers into userPatMode. Fixes #6996.
Diffstat (limited to 'src/theory')
-rw-r--r--src/theory/quantifiers/ematching/inst_strategy_e_matching.cpp5
-rw-r--r--src/theory/quantifiers/ematching/instantiation_engine.cpp10
-rw-r--r--src/theory/quantifiers/quantifiers_attributes.cpp3
-rw-r--r--src/theory/quantifiers/quantifiers_attributes.h3
-rw-r--r--src/theory/quantifiers/quantifiers_rewriter.cpp2
5 files changed, 14 insertions, 9 deletions
diff --git a/src/theory/quantifiers/ematching/inst_strategy_e_matching.cpp b/src/theory/quantifiers/ematching/inst_strategy_e_matching.cpp
index ab237fc6c..8901ec314 100644
--- a/src/theory/quantifiers/ematching/inst_strategy_e_matching.cpp
+++ b/src/theory/quantifiers/ematching/inst_strategy_e_matching.cpp
@@ -111,7 +111,10 @@ InstStrategyStatus InstStrategyAutoGenTriggers::process(Node f,
int e)
{
options::UserPatMode upMode = getInstUserPatMode();
- if (hasUserPatterns(f) && upMode == options::UserPatMode::TRUST)
+ // we don't auto-generate triggers if the mode is trust or strict
+ if (hasUserPatterns(f)
+ && (upMode == options::UserPatMode::TRUST
+ || upMode == options::UserPatMode::STRICT))
{
return InstStrategyStatus::STATUS_UNKNOWN;
}
diff --git a/src/theory/quantifiers/ematching/instantiation_engine.cpp b/src/theory/quantifiers/ematching/instantiation_engine.cpp
index d490dce83..d9bec820c 100644
--- a/src/theory/quantifiers/ematching/instantiation_engine.cpp
+++ b/src/theory/quantifiers/ematching/instantiation_engine.cpp
@@ -200,11 +200,15 @@ bool InstantiationEngine::checkCompleteFor( Node q ) {
void InstantiationEngine::checkOwnership(Node q)
{
- if( options::strictTriggers() && q.getNumChildren()==3 ){
+ if (options::userPatternsQuant() == options::UserPatMode::STRICT
+ && q.getNumChildren() == 3)
+ {
//if strict triggers, take ownership of this quantified formula
bool hasPat = false;
- for( unsigned i=0; i<q[2].getNumChildren(); i++ ){
- if( q[2][i].getKind()==INST_PATTERN || q[2][i].getKind()==INST_NO_PATTERN ){
+ for (const Node& qc : q)
+ {
+ if (qc.getKind() == INST_PATTERN || qc.getKind() == INST_NO_PATTERN)
+ {
hasPat = true;
break;
}
diff --git a/src/theory/quantifiers/quantifiers_attributes.cpp b/src/theory/quantifiers/quantifiers_attributes.cpp
index 1abbd1989..33ed6f536 100644
--- a/src/theory/quantifiers/quantifiers_attributes.cpp
+++ b/src/theory/quantifiers/quantifiers_attributes.cpp
@@ -30,8 +30,7 @@ namespace quantifiers {
bool QAttributes::isStandard() const
{
- return !d_sygus && !d_quant_elim && !isFunDef() && d_name.isNull()
- && !d_isInternal;
+ return !d_sygus && !d_quant_elim && !isFunDef() && !d_isInternal;
}
QuantAttributes::QuantAttributes() {}
diff --git a/src/theory/quantifiers/quantifiers_attributes.h b/src/theory/quantifiers/quantifiers_attributes.h
index b3fdd09da..910dbab5b 100644
--- a/src/theory/quantifiers/quantifiers_attributes.h
+++ b/src/theory/quantifiers/quantifiers_attributes.h
@@ -162,8 +162,7 @@ struct QAttributes
* 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.
+ * we are performing quantifier elimination, or is a function definition.
*/
bool isStandard() const;
};
diff --git a/src/theory/quantifiers/quantifiers_rewriter.cpp b/src/theory/quantifiers/quantifiers_rewriter.cpp
index 48106b858..aba2d79bf 100644
--- a/src/theory/quantifiers/quantifiers_rewriter.cpp
+++ b/src/theory/quantifiers/quantifiers_rewriter.cpp
@@ -1797,7 +1797,7 @@ bool QuantifiersRewriter::doOperation(Node q,
{
bool is_strict_trigger =
qa.d_hasPattern
- && options::userPatternsQuant() == options::UserPatMode::TRUST;
+ && options::userPatternsQuant() == options::UserPatMode::STRICT;
bool is_std = qa.isStandard() && !is_strict_trigger;
if (computeOption == COMPUTE_ELIM_SYMBOLS)
{
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback