summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorajreynol <andrew.j.reynolds@gmail.com>2015-06-13 18:36:31 +0200
committerajreynol <andrew.j.reynolds@gmail.com>2015-06-13 18:36:37 +0200
commit7adb6fc6f96a748ce633a8eac460ed75b48f5b0d (patch)
tree9a15c6a9a794d772499c5c4af90edb7986a762c3 /src/util
parentf28e715326669c2524e5dc552ff9eb05e5799f33 (diff)
Fix for sort inference involving mixed Int/Real equalities.
Diffstat (limited to 'src/util')
-rw-r--r--src/util/sort_inference.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/util/sort_inference.cpp b/src/util/sort_inference.cpp
index 14d37e068..76e39c2b3 100644
--- a/src/util/sort_inference.cpp
+++ b/src/util/sort_inference.cpp
@@ -293,9 +293,12 @@ void SortInference::setEqual( int t1, int t2 ){
d_type_union_find.d_eqc[rt1] = rt2;
std::map< int, TypeNode >::iterator it1 = d_type_types.find( rt1 );
if( it1!=d_type_types.end() ){
- Assert( d_type_types.find( rt2 )==d_type_types.end() );
- d_type_types[rt2] = it1->second;
- d_type_types.erase( rt1 );
+ if( d_type_types.find( rt2 )==d_type_types.end() ){
+ d_type_types[rt2] = it1->second;
+ d_type_types.erase( rt1 );
+ }else{
+ //may happen for mixed int/real
+ }
}
}
}
@@ -316,7 +319,6 @@ int SortInference::getIdForType( TypeNode tn ){
}
int SortInference::process( Node n, std::map< Node, Node >& var_bound ){
- Trace("sort-inference-debug") << "...Process " << n << std::endl;
//add to variable bindings
if( n.getKind()==kind::FORALL || n.getKind()==kind::EXISTS ){
if( d_var_types.find( n )!=d_var_types.end() ){
@@ -354,6 +356,7 @@ int SortInference::process( Node n, std::map< Node, Node >& var_bound ){
var_bound.erase( n[0][i] );
}
}
+ Trace("sort-inference-debug") << "...Process " << n << std::endl;
int retType;
if( n.getKind()==kind::EQUAL ){
@@ -559,7 +562,9 @@ Node SortInference::simplify( Node n, std::map< Node, Node >& var_bound ){
}
return NodeManager::currentNM()->mkNode( n.getKind(), children );
}else if( n.getKind()==kind::EQUAL ){
- if( children[0].getType()!=children[1].getType() ){
+ TypeNode tn1 = children[0].getType();
+ TypeNode tn2 = children[1].getType();
+ if( !tn1.isSubtypeOf( tn2 ) && !tn2.isSubtypeOf( tn1 ) ){
if( children[0].isConst() ){
children[0] = getNewSymbol( children[0], children[1].getType() );
}else if( children[1].isConst() ){
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback