std::vector< Node > rew;
if( checkClash(in[0], in[1], rew) ){
Trace("datatypes-rewrite") << "Rewrite clashing equality " << in << " to false" << std::endl;
- return RewriteResponse(REWRITE_DONE,
- NodeManager::currentNM()->mkConst(false));
- }else if( rew.size()!=1 || rew[0]!=in ){
- Node nn = rew.size()==0 ? NodeManager::currentNM()->mkConst( true ) :
- ( rew.size()==1 ? rew[0] : NodeManager::currentNM()->mkNode( kind::AND, rew ) );
- Trace("datatypes-rewrite") << "Rewrite equality to " << nn << std::endl;
- return RewriteResponse(REWRITE_AGAIN_FULL, nn );
+ return RewriteResponse(REWRITE_DONE, NodeManager::currentNM()->mkConst(false));
+ }else if( rew.size()==1 && rew[0]!=in ){
+ Trace("datatypes-rewrite") << "Rewrite equality " << in << " to " << rew[0] << std::endl;
+ return RewriteResponse(REWRITE_AGAIN_FULL, rew[0] );
}
}
}
}
}
- }else{
+ }else if( n1!=n2 ){
Node eq = NodeManager::currentNM()->mkNode( n1.getType().isBoolean() ? kind::IFF : kind::EQUAL, n1, n2 );
rew.push_back( eq );
}
d_equalityEngine.addFunctionKind(kind::APPLY_CONSTRUCTOR);
d_equalityEngine.addFunctionKind(kind::APPLY_SELECTOR_TOTAL);
d_equalityEngine.addFunctionKind(kind::APPLY_TESTER);
+ d_equalityEngine.addFunctionKind(kind::APPLY_UF);
}
TheoryDatatypes::~TheoryDatatypes() {
NodeManager::currentNM()->getDatatypeForTupleRecord(t).setAttribute(expr::DatatypeRecordAttr(), NodeManager::currentNM()->getDatatypeForTupleRecord(in.getAttribute(smt::BooleanTermAttr()).getType()).getAttribute(expr::DatatypeRecordAttr()));
}
}
+
+ if( in.getKind()==EQUAL ){
+ Node nn;
+ std::vector< Node > rew;
+ if( DatatypesRewriter::checkClash(in[0], in[1], rew) ){
+ nn = NodeManager::currentNM()->mkConst(false);
+ }else{
+ nn = rew.size()==0 ? NodeManager::currentNM()->mkConst( true ) :
+ ( rew.size()==1 ? rew[0] : NodeManager::currentNM()->mkNode( kind::AND, rew ) );
+ }
+ return nn;
+ }
+
// nothing to do
return in;
}
Assert(!n.isNull());
+
Debug("tuprec") << "REWROTE " << in << " to " << n << std::endl;
return n;