}
}else{
if( d_congruent.find( n )==d_congruent.end() ){
- if( var.isNull() ){
+ // We mark all but the oldest variable in the equivalence class as
+ // congruent.
+ if (var.isNull())
+ {
var = n;
- }else{
- Trace("strings-process-debug") << " congruent variable : " << n << std::endl;
- d_congruent.insert( n );
+ }
+ else if (var > n)
+ {
+ Trace("strings-process-debug")
+ << " congruent variable : " << var << std::endl;
+ d_congruent.insert(var);
+ var = n;
+ }
+ else
+ {
+ Trace("strings-process-debug")
+ << " congruent variable : " << n << std::endl;
+ d_congruent.insert(n);
}
}
}