protected static ValueRelationalState convertToSimpleValueRelationalStateIfPossible(ValueRelationalState state) {
// TODO: should a single-valued tuple always be converted???
if ( !TupleRelationalState.class.isInstance( state ) ) {
return state;
}
TupleRelationalState tupleRelationalState = TupleRelationalState.class.cast( state );
return tupleRelationalState.getRelationalStates().size() == 1 ?
tupleRelationalState.getRelationalStates().get( 0 ) :
state;
}