[Gecode] Problem with operator== for views, equality vs. aliasing.

Mikael 'Zayenz' Lagerkvist d00-mla at nada.kth.se
Thu May 26 11:29:16 CEST 2005


Hi,

I recently found that there is a problem with the equality-operators
for views in Gecode. The operators are defined to handle aliasing,
that is, the operation checks for usage of the same base variable.

However, the usage is (at least in some places), based on operator==
testing semantic equality.  As an example, take
Int::Rel::Le<View>::post(...) from int/rel/lq-le.icc, lines 95-103:

	template <class View>
	ExecStatus
	Le<View>::post(Space* home, View x0, View x1) {
	  if (x0 != x1) {
	    (void) new (home) Le<View>(home,x0,x1);
	    return ES_OK;
	  }
	  return ES_FAILED;
	}

Consider this when invoked using two scale-views representing 3*x and
5*x. Then the invocation will erroneously fail.


So, what should the equality-operator mean, and what do we call the
other operation?


Regards,
Mikael

--
Mikael 'Zayenz' Lagerkvist, http://www.imit.kth.se/~zayenz/



More information about the gecode-users mailing list