summaryrefslogtreecommitdiff
path: root/src/theory/quantifiers
diff options
context:
space:
mode:
authorHaniel Barbosa <hanielbbarbosa@gmail.com>2018-05-29 17:25:44 -0500
committerHaniel Barbosa <hanielbbarbosa@gmail.com>2018-05-29 17:25:44 -0500
commit76324eb6333acae29df370d877ce43ef706464d6 (patch)
tree44efa4c317659f0740eea7d033b12f9b8ac67b04 /src/theory/quantifiers
parentb2d98b5a15ce47e996ff022ffa3790fca8f930ed (diff)
parent58001f4e0740796d773388f63d77a6a3fbc7878c (diff)
Merge branch 'sygusComp2018-2' into sym-break-anyconst
Diffstat (limited to 'src/theory/quantifiers')
-rw-r--r--src/theory/quantifiers/sygus/ce_guided_conjecture.cpp53
-rw-r--r--src/theory/quantifiers/sygus/ce_guided_conjecture.h1
2 files changed, 45 insertions, 9 deletions
diff --git a/src/theory/quantifiers/sygus/ce_guided_conjecture.cpp b/src/theory/quantifiers/sygus/ce_guided_conjecture.cpp
index 0f3dd74ae..cf3359707 100644
--- a/src/theory/quantifiers/sygus/ce_guided_conjecture.cpp
+++ b/src/theory/quantifiers/sygus/ce_guided_conjecture.cpp
@@ -20,6 +20,9 @@
#include "options/quantifiers_options.h"
#include "printer/printer.h"
#include "prop/prop_engine.h"
+#include "smt/smt_engine.h"
+#include "smt/smt_engine_scope.h"
+#include "smt/smt_statistics_registry.h"
#include "theory/quantifiers/first_order_model.h"
#include "theory/quantifiers/instantiate.h"
#include "theory/quantifiers/quantifiers_attributes.h"
@@ -391,12 +394,33 @@ void CegConjecture::doCheck(std::vector<Node>& lems)
}
else
{
- // This is the "verification lemma", which states
- // either this conjecture does not have a solution, or candidate_values
- // is a solution for this conjecture.
- lem = nm->mkNode(OR, d_quant.negate(), lem);
- lem = getStreamGuardedLemma(lem);
- lems.push_back(lem);
+ Trace("cegqi-engine") << " *** Direct verify..." << std::endl;
+ SmtEngine verifySmt(nm->toExprManager());
+ verifySmt.setLogic(smt::currentSmtEngine()->getLogicInfo());
+ verifySmt.assertFormula(lem.toExpr());
+ Result r = verifySmt.checkSat();
+ Trace("cegqi-engine") << " ...got " << r << std::endl;
+ if (r.asSatisfiabilityResult().isSat() == Result::SAT)
+ {
+ Trace("cegqi-engine") << " verification lemma failed for:\n";
+ // do not send out
+ for (const Node& v : d_ce_sk_vars)
+ {
+ Node mv = Node::fromExpr(verifySmt.getValue(v.toExpr()));
+ Trace("cegqi-engine") << " " << v << " -> " << mv << "\n";
+ d_ce_sk_var_mvs.push_back(mv);
+ }
+ }
+ else
+ {
+ // This is the "verification lemma", which states
+ // either this conjecture does not have a solution, or candidate_values
+ // is a solution for this conjecture.
+ // lem = nm->mkNode(OR, d_quant.negate(), lem);
+ lem = d_quant.negate();
+ lem = getStreamGuardedLemma(lem);
+ lems.push_back(lem);
+ }
}
}
}
@@ -414,10 +438,19 @@ void CegConjecture::doRefine( std::vector< Node >& lems ){
{
Trace("cegqi-refine") << "Get model values for skolems..." << std::endl;
Assert(d_inner_vars.size() == d_ce_sk_vars.size());
- std::vector<Node> model_values;
- getModelValues(d_ce_sk_vars, model_values);
+ if (d_ce_sk_var_mvs.empty())
+ {
+ std::vector<Node> model_values;
+ getModelValues(d_ce_sk_vars, model_values);
+ sk_subs.insert(sk_subs.end(), model_values.begin(), model_values.end());
+ }
+ else
+ {
+ Assert(d_ce_sk_var_mvs.size() == d_ce_sk_vars.size());
+ sk_subs.insert(
+ sk_subs.end(), d_ce_sk_var_mvs.begin(), d_ce_sk_var_mvs.end());
+ }
sk_vars.insert(sk_vars.end(), d_inner_vars.begin(), d_inner_vars.end());
- sk_subs.insert(sk_subs.end(), model_values.begin(), model_values.end());
}
else
{
@@ -450,6 +483,7 @@ void CegConjecture::doRefine( std::vector< Node >& lems ){
Trace("cegqi-refine") << "doRefine : finished" << std::endl;
d_set_ce_sk_vars = false;
d_ce_sk_vars.clear();
+ d_ce_sk_var_mvs.clear();
}
void CegConjecture::preregisterConjecture( Node q ) {
@@ -602,6 +636,7 @@ void CegConjecture::printAndContinueStream()
// thus, we clear information regarding the current refinement
d_set_ce_sk_vars = false;
d_ce_sk_vars.clear();
+ d_ce_sk_var_mvs.clear();
// However, we need to exclude the current solution using an explicit
// blocking clause, so that we proceed to the next solution.
std::vector<Node> terms;
diff --git a/src/theory/quantifiers/sygus/ce_guided_conjecture.h b/src/theory/quantifiers/sygus/ce_guided_conjecture.h
index bf0ca4b16..b3fc1c13b 100644
--- a/src/theory/quantifiers/sygus/ce_guided_conjecture.h
+++ b/src/theory/quantifiers/sygus/ce_guided_conjecture.h
@@ -178,6 +178,7 @@ private:
* skolems are analyzed during doRefine().
*/
std::vector<Node> d_ce_sk_vars;
+ std::vector<Node> d_ce_sk_var_mvs;
/**
* Whether the above vector has been set. We have this flag since the above
* vector may be set to empty (e.g. for ground synthesis conjectures).
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback