summaryrefslogtreecommitdiff
path: root/src/theory/quantifiers
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2020-02-17 13:29:09 -0600
committerGitHub <noreply@github.com>2020-02-17 13:29:09 -0600
commit6a761852b93510bf707e7002ad663ca0f36ad720 (patch)
treea91cbd198e21e78b40ce7d6a943db962ee0c30c1 /src/theory/quantifiers
parentb19c08997e15d2e42f61f1936fd60c5e34081d68 (diff)
Option to limit the number of rounds of enumerative instantiation (#3760)
Diffstat (limited to 'src/theory/quantifiers')
-rw-r--r--src/theory/quantifiers/inst_strategy_enumerative.cpp34
-rw-r--r--src/theory/quantifiers/inst_strategy_enumerative.h8
2 files changed, 32 insertions, 10 deletions
diff --git a/src/theory/quantifiers/inst_strategy_enumerative.cpp b/src/theory/quantifiers/inst_strategy_enumerative.cpp
index 83856dfc4..1e2e34aa2 100644
--- a/src/theory/quantifiers/inst_strategy_enumerative.cpp
+++ b/src/theory/quantifiers/inst_strategy_enumerative.cpp
@@ -33,12 +33,19 @@ using namespace inst;
namespace quantifiers {
InstStrategyEnum::InstStrategyEnum(QuantifiersEngine* qe, RelevantDomain* rd)
- : QuantifiersModule(qe), d_rd(rd)
+ : QuantifiersModule(qe), d_rd(rd), d_fullSaturateLimit(-1)
{
}
-
+void InstStrategyEnum::presolve()
+{
+ d_fullSaturateLimit = options::fullSaturateLimit();
+}
bool InstStrategyEnum::needsCheck(Theory::Effort e)
{
+ if (d_fullSaturateLimit == 0)
+ {
+ return false;
+ }
if (options::fullSaturateInterleave())
{
if (d_quantEngine->getInstWhenNeedsCheck(e))
@@ -61,15 +68,18 @@ void InstStrategyEnum::check(Theory::Effort e, QEffort quant_e)
{
bool doCheck = false;
bool fullEffort = false;
- if (options::fullSaturateInterleave())
+ if (d_fullSaturateLimit != 0)
{
- // we only add when interleaved with other strategies
- doCheck = quant_e == QEFFORT_STANDARD && d_quantEngine->hasAddedLemma();
- }
- if (options::fullSaturateQuant() && !doCheck)
- {
- doCheck = quant_e == QEFFORT_LAST_CALL;
- fullEffort = !d_quantEngine->hasAddedLemma();
+ if (options::fullSaturateInterleave())
+ {
+ // we only add when interleaved with other strategies
+ doCheck = quant_e == QEFFORT_STANDARD && d_quantEngine->hasAddedLemma();
+ }
+ if (options::fullSaturateQuant() && !doCheck)
+ {
+ doCheck = quant_e == QEFFORT_LAST_CALL;
+ fullEffort = !d_quantEngine->hasAddedLemma();
+ }
}
if (!doCheck)
{
@@ -150,6 +160,10 @@ void InstStrategyEnum::check(Theory::Effort e, QEffort quant_e)
Trace("fs-engine") << "Finished full saturation engine, time = "
<< (clSet2 - clSet) << std::endl;
}
+ if (d_fullSaturateLimit > 0)
+ {
+ d_fullSaturateLimit--;
+ }
}
bool InstStrategyEnum::process(Node f, bool fullEffort, bool isRd)
diff --git a/src/theory/quantifiers/inst_strategy_enumerative.h b/src/theory/quantifiers/inst_strategy_enumerative.h
index 48285c877..4d98f00ef 100644
--- a/src/theory/quantifiers/inst_strategy_enumerative.h
+++ b/src/theory/quantifiers/inst_strategy_enumerative.h
@@ -64,6 +64,8 @@ class InstStrategyEnum : public QuantifiersModule
public:
InstStrategyEnum(QuantifiersEngine* qe, RelevantDomain* rd);
~InstStrategyEnum() {}
+ /** Presolve */
+ void presolve() override;
/** Needs check. */
bool needsCheck(Theory::Effort e) override;
/** Reset round. */
@@ -101,6 +103,12 @@ class InstStrategyEnum : public QuantifiersModule
* term instantiations.
*/
bool process(Node q, bool fullEffort, bool isRd);
+ /**
+ * A limit on the number of rounds to apply this strategy, where a value < 0
+ * means no limit. This value is set to the value of fullSaturateLimit()
+ * during presolve.
+ */
+ int32_t d_fullSaturateLimit;
}; /* class InstStrategyEnum */
} /* CVC4::theory::quantifiers namespace */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback