summaryrefslogtreecommitdiff
path: root/src/theory/quantifiers/candidate_generator.cpp
diff options
context:
space:
mode:
authorajreynol <andrew.j.reynolds@gmail.com>2014-11-18 17:39:05 +0100
committerajreynol <andrew.j.reynolds@gmail.com>2014-11-18 17:39:14 +0100
commit3a2aed30267a33ff78006aec6a5b36aad96feb09 (patch)
treefa5a61a9c0e071c0d9d438de9150e3a90b4ff583 /src/theory/quantifiers/candidate_generator.cpp
parentd9923e1928a158c915a71ce0addb766a1e9986ca (diff)
Add local theory extensions instantiation strategy (incomplete). Refactor how default options are set for quantifiers. Minor improvement to datatypes. Add unsat co-datatype regression. Clean up instantiation engine. Set inst level 0 on introduced constants for types with no ground terms. Return introduced constant for variable trigger when no ground terms exist.
Diffstat (limited to 'src/theory/quantifiers/candidate_generator.cpp')
-rw-r--r--src/theory/quantifiers/candidate_generator.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/theory/quantifiers/candidate_generator.cpp b/src/theory/quantifiers/candidate_generator.cpp
index a10181c51..cfaa6d1ad 100644
--- a/src/theory/quantifiers/candidate_generator.cpp
+++ b/src/theory/quantifiers/candidate_generator.cpp
@@ -192,19 +192,29 @@ void CandidateGeneratorQEAll::resetInstantiationRound() {
void CandidateGeneratorQEAll::reset( Node eqc ) {
d_eq = eq::EqClassesIterator( d_qe->getEqualityQuery()->getEngine() );
+ d_firstTime = true;
}
Node CandidateGeneratorQEAll::getNextCandidate() {
while( !d_eq.isFinished() ){
Node n = (*d_eq);
- if( options::instMaxLevel()!=-1 ){
- n = d_qe->getEqualityQuery()->getInternalRepresentative( n, d_f, d_index );
- }
++d_eq;
- if( n.getType().isSubtypeOf( d_match_pattern.getType() ) ){
- //an equivalence class with the same type as the pattern, return it
- return n;
+ if( n.getType().isSubtypeOf( d_match_pattern_type ) ){
+ if( d_qe->getTermDatabase()->hasTermCurrent( n ) ){
+ if( options::instMaxLevel()!=-1 ){
+ n = d_qe->getEqualityQuery()->getInternalRepresentative( n, d_f, d_index );
+ }
+ d_firstTime = false;
+ //an equivalence class with the same type as the pattern, return it
+ return n;
+ }
}
}
+ if( d_firstTime ){
+ Assert( d_qe->getTermDatabase()->d_type_map[d_match_pattern_type].empty() );
+ //must return something
+ d_firstTime = false;
+ return d_qe->getTermDatabase()->getFreeVariableForType( d_match_pattern_type );
+ }
return Node::null();
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback