if (done() && e<EFFORT_FULL) {
return;
}
- Assert(d_pending.empty() && d_pending_merge.empty());
+ Assert(d_pending.empty());
d_addedLemma = false;
if( e == EFFORT_LAST_CALL ){
if( e == EFFORT_FULL && !d_conflict && !d_addedLemma && !d_valuation.needCheck() ) {
//check for cycles
- Assert(d_pending.empty() && d_pending_merge.empty());
+ Assert(d_pending.empty());
do {
d_addedFact = false;
Trace("datatypes-proc") << "Check cycles..." << std::endl;
Trace("datatypes-debug") << "Flush pending facts..." << std::endl;
flushPendingFacts();
}
- /*
- if( !d_conflict ){
- if( options::dtRewriteErrorSel() ){
- bool innerAddedFact = false;
- do {
- collapseSelectors();
- innerAddedFact = !d_pending.empty() || !d_pending_merge.empty();
- flushPendingFacts();
- }while( !d_conflict && innerAddedFact );
- }
- }
- */
}while( !d_conflict && !d_addedLemma && d_addedFact );
Trace("datatypes-debug") << "Finished, conflict=" << d_conflict << ", lemmas=" << d_addedLemma << std::endl;
if( !d_conflict ){
}
void TheoryDatatypes::flushPendingFacts(){
- doPendingMerges();
//pending lemmas: used infrequently, only for definitional lemmas
if( !d_pending_lem.empty() ){
int i = 0;
i++;
}
d_pending_lem.clear();
- doPendingMerges();
}
int i = 0;
while( !d_conflict && i<(int)d_pending.size() ){
d_pending_exp.clear();
}
-void TheoryDatatypes::doPendingMerges(){
- if( !d_conflict ){
- //do all pending merges
- int i=0;
- while( i<(int)d_pending_merge.size() ){
- Assert(d_pending_merge[i].getKind() == EQUAL);
- merge( d_pending_merge[i][0], d_pending_merge[i][1] );
- i++;
- }
- }
- d_pending_merge.clear();
-}
-
bool TheoryDatatypes::doSendLemma( Node lem ) {
if( d_lemmas_produced_c.find( lem )==d_lemmas_produced_c.end() ){
Trace("dt-lemma-send") << "TheoryDatatypes::doSendLemma : " << lem << std::endl;
return ret;
}
-void TheoryDatatypes::assertFact( Node fact, Node exp ){
- Assert(d_pending_merge.empty());
+void TheoryDatatypes::assertFact( Node fact, Node exp)
+{
Trace("datatypes-debug") << "TheoryDatatypes::assertFact : " << fact << std::endl;
bool polarity = fact.getKind() != kind::NOT;
TNode atom = polarity ? fact : fact[0];
}else{
d_equalityEngine->assertPredicate(atom, polarity, exp);
}
- doPendingMerges();
// could be sygus-specific
if (d_sygusExtension)
{
EqcInfo* eqc = getOrMakeEqcInfo( rep, true );
addTester( tindex, fact, eqc, rep, t_arg );
Trace("dt-tester") << "Done assert tester." << std::endl;
- //do pending merges
- doPendingMerges();
Trace("dt-tester") << "Done pending merges." << std::endl;
if( !d_conflict && polarity ){
if (d_sygusExtension)
if( t1.getType().isDatatype() ){
Trace("datatypes-debug")
<< "NotifyMerge : " << t1 << " " << t2 << std::endl;
- d_pending_merge.push_back( t1.eqNode( t2 ) );
+ merge(t1,t2);
}
}
std::vector< Node > d_pending_lem;
std::vector< Node > d_pending;
std::map< Node, Node > d_pending_exp;
- std::vector< Node > d_pending_merge;
/** All the function terms that the theory has seen */
context::CDList<TNode> d_functionTerms;
/** counter for forcing assignments (ensures fairness) */
/** flush pending facts */
void flushPendingFacts();
- /** do pending merged */
- void doPendingMerges();
/** do send lemma */
bool doSendLemma( Node lem );
bool doSendLemmas( std::vector< Node >& lem );