summaryrefslogtreecommitdiff
path: root/src/theory/quantifiers/ce_guided_instantiation.cpp
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2018-02-02 21:04:49 -0600
committerGitHub <noreply@github.com>2018-02-02 21:04:49 -0600
commitb72de87fb2804325137352ce79a6044d1b805576 (patch)
tree5b08037711382c26e52de705038a9756c2160b46 /src/theory/quantifiers/ce_guided_instantiation.cpp
parent1b24f3f0fd5fdd4163a46689949fa8a5c60f3322 (diff)
Option to use sampling for CEGIS (#1555)
Diffstat (limited to 'src/theory/quantifiers/ce_guided_instantiation.cpp')
-rw-r--r--src/theory/quantifiers/ce_guided_instantiation.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/theory/quantifiers/ce_guided_instantiation.cpp b/src/theory/quantifiers/ce_guided_instantiation.cpp
index dc359d252..38cfb9ba7 100644
--- a/src/theory/quantifiers/ce_guided_instantiation.cpp
+++ b/src/theory/quantifiers/ce_guided_instantiation.cpp
@@ -238,17 +238,33 @@ void CegInstantiation::checkCegConjecture( CegConjecture * conj ) {
void CegInstantiation::getCRefEvaluationLemmas( CegConjecture * conj, std::vector< Node >& vs, std::vector< Node >& ms, std::vector< Node >& lems ) {
Trace("sygus-cref-eval") << "Cref eval : conjecture has " << conj->getNumRefinementLemmas() << " refinement lemmas." << std::endl;
- if( conj->getNumRefinementLemmas()>0 ){
+ unsigned nlemmas = conj->getNumRefinementLemmas();
+ if (nlemmas > 0 || options::cegisSample() != CEGIS_SAMPLE_NONE)
+ {
Assert( vs.size()==ms.size() );
TermDbSygus* tds = d_quantEngine->getTermDatabaseSygus();
Node nfalse = d_quantEngine->getTermUtil()->d_false;
Node neg_guard = conj->getGuard().negate();
- for( unsigned i=0; i<conj->getNumRefinementLemmas(); i++ ){
+ for (unsigned i = 0; i <= nlemmas; i++)
+ {
+ if (i == nlemmas)
+ {
+ bool addedSample = false;
+ // find a new one by sampling, if applicable
+ if (options::cegisSample() != CEGIS_SAMPLE_NONE)
+ {
+ addedSample = conj->sampleAddRefinementLemma(ms, lems);
+ }
+ if (!addedSample)
+ {
+ return;
+ }
+ }
Node lem;
std::map< Node, Node > visited;
std::map< Node, std::vector< Node > > exp;
- lem = conj->getRefinementBaseLemma( i );
+ lem = conj->getRefinementLemma(i);
if( !lem.isNull() ){
std::vector< Node > lem_conj;
//break into conjunctions
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback