d_equalityEngine(d_notify, c, "theory::datatypes::TheoryDatatypes"),
d_labels( c ),
d_selector_apps( c ),
- d_consEqc( c ),
+ //d_consEqc( c ),
d_conflict( c, false ),
d_collectTermsCache( c ),
d_consTerms( c ),
}
}
*/
- d_consEqc[t] = true;
+ //d_consEqc[t] = true;
}
}
if( d_conflict ){
return;
}
- d_consEqc[t1] = true;
+ //d_consEqc[t1] = true;
}
- d_consEqc[t2] = false;
+ //d_consEqc[t2] = false;
}
}else{
Debug("datatypes-debug") << "No eqc info for " << t1 << ", must create" << std::endl;
TNode f1 = r==0 ? d_consTerms[i] : d_selTerms[i];
for( unsigned j=i+1; j<functionTerms; j++ ){
TNode f2 = r==0 ? d_consTerms[j] : d_selTerms[j];
+ Trace("dt-cg-debug") << "dt-cg: " << f1 << " and " << f2 << " " << (f1.getOperator()==f2.getOperator()) << " " << areEqual( f1, f2 ) << std::endl;
if( f1.getOperator()==f2.getOperator() && !areEqual( f1, f2 ) ){
Trace("dt-cg") << "Check " << f1 << " and " << f2 << std::endl;
bool somePairIsDisequal = false;
Node c = ei->d_constructor.get();
cons.push_back( c );
eqc_cons[ eqc ] = c;
+ Trace("dt-cmi") << "Datatypes : assert representative " << c << " for " << eqc << std::endl;
m->assertRepresentative( c );
}else{
//if eqc contains a symbol known to datatypes (a selector), then we must assign
Trace("dt-cmi") << "Assign : " << neqc << std::endl;
m->assertEquality( eqc, neqc, true );
eqc_cons[ eqc ] = neqc;
+ Trace("dt-cmi") << "Datatypes : assert representative " << neqc << " for " << eqc << std::endl;
m->assertRepresentative( neqc );
}
//m->assertRepresentative( neqc );
collectTerms( n[i] );
}
if( n.getKind() == APPLY_CONSTRUCTOR ){
+ Debug("datatypes") << " Found constructor " << n << endl;
d_consTerms.push_back( n );
}else if( n.getKind() == APPLY_SELECTOR_TOTAL || n.getKind() == DT_SIZE ){
d_selTerms.push_back( n );
if( n.getKind()==EQUAL || n.getKind()==IFF ){
/*
for( unsigned i=0; i<2; i++ ){
- if( n[i].getKind()!=APPLY_SELECTOR_TOTAL && n[i].getKind()!=APPLY_CONSTRUCTOR ){
+ if( !n[i].isVar() && n[i].getKind()!=APPLY_SELECTOR_TOTAL && n[i].getKind()!=APPLY_CONSTRUCTOR ){
addLemma = true;
}
}
}
if( addLemma ){
//check if we have already added this lemma
- if( std::find( d_inst_lemmas[ n[0] ].begin(), d_inst_lemmas[ n[0] ].end(), n[1] )==d_inst_lemmas[ n[0] ].end() ){
- d_inst_lemmas[ n[0] ].push_back( n[1] );
- Trace("dt-lemma-debug") << "Communicate " << n << std::endl;
- return true;
- }else{
- Trace("dt-lemma-debug") << "Already communicated " << n << std::endl;
- return false;
- }
+ //if( std::find( d_inst_lemmas[ n[0] ].begin(), d_inst_lemmas[ n[0] ].end(), n[1] )==d_inst_lemmas[ n[0] ].end() ){
+ // d_inst_lemmas[ n[0] ].push_back( n[1] );
+ Trace("dt-lemma-debug") << "Communicate " << n << std::endl;
+ return true;
+ //}else{
+ // Trace("dt-lemma-debug") << "Already communicated " << n << std::endl;
+ // return false;
+ //}
}
//else if( exp.getKind()==APPLY_TESTER ){
//if( n.getKind()==EQUAL && !DatatypesRewriter::isTermDatatype( n[0] ) ){
/** map from nodes to their instantiated equivalent for each constructor type */
std::map< Node, std::map< int, Node > > d_inst_map;
/** which instantiation lemmas we have sent */
- std::map< Node, std::vector< Node > > d_inst_lemmas;
+ //std::map< Node, std::vector< Node > > d_inst_lemmas;
/** labels for each equivalence class
* for each eqc n, d_labels[n] is testers that hold for this equivalence class, either:
* a list of equations of the form
/** selector apps for eqch equivalence class */
NodeListMap d_selector_apps;
/** constructor terms */
- BoolMap d_consEqc;
+ //BoolMap d_consEqc;
/** Are we in conflict */
context::CDO<bool> d_conflict;
/** The conflict node */
std::vector< Node > d_pending;
std::map< Node, Node > d_pending_exp;
std::vector< Node > d_pending_merge;
- /** expand definition skolem functions */
- std::map< Node, Node > d_exp_def_skolem;
/** All the constructor terms that the theory has seen */
context::CDList<TNode> d_consTerms;
/** All the selector terms that the theory has seen */
context::CDList<TNode> d_selTerms;
/** counter for forcing assignments (ensures fairness) */
unsigned d_dtfCounter;
+ /** expand definition skolem functions */
+ std::map< Node, Node > d_exp_def_skolem;
private:
/** assert fact */
void assertFact( Node fact, Node exp );
void TheoryModel::assertRepresentative(TNode n )
{
Trace("model-builder-reps") << "Assert rep : " << n << std::endl;
+ Trace("model-builder-reps") << "Rep eqc is : " << getRepresentative( n ) << std::endl;
d_reps[ n ] = n;
}
if(t.isTuple() || t.isRecord()) {
t = NodeManager::currentNM()->getDatatypeForTupleRecord(t);
}
- TypeNode tb = t.getBaseType();
+ TypeNode tb = t.getBaseType();
if (!assignOne) {
set<Node>* repSet = typeRepSet.getSet(tb);
if (repSet != NULL && !repSet->empty()) {