summaryrefslogtreecommitdiff
path: root/Source/Core/AbsyQuant.cs
diff options
context:
space:
mode:
authorGravatar Dan Liew <daniel.liew@imperial.ac.uk>2014-07-28 17:59:36 +0100
committerGravatar Dan Liew <daniel.liew@imperial.ac.uk>2014-07-28 17:59:36 +0100
commit0a050dea52296ba1bdd5be25d1528ecf29fbc7ed (patch)
treedec1ac3701916bc7346122cd337035bad8f8212d /Source/Core/AbsyQuant.cs
parentef4313604b4cfd16c0f38c51a8d9f6fe0a13b44a (diff)
Fix bug in BinderExpr where Equals() was not corrected implemented.
BinderExpr was doing: object.Equals(this.TypeParameters, other.TypeParameters) && object.Equals(this.Dummies, other.Dummies) Both of these are wrong because these are of type List<> and so - object.Equals(this.TypeParamters, other.TypeParameters) will call this.TypeParameters.Equals(other.TypeParamters) (assuming they aren't references to the same list) - object.Equals(this.Dummies, other.TypeParameters) will call this.TypeParameters.Equals(other.Dummies) (assuming they aren't references to the same list) so this is becomes a reference comparision on Lists<>. This is wrong because Equals() has been overloaded to implement structural equality. This affects the classes ForallExpr, LambdaExpr and ExistsExpr.
Diffstat (limited to 'Source/Core/AbsyQuant.cs')
-rw-r--r--Source/Core/AbsyQuant.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Core/AbsyQuant.cs b/Source/Core/AbsyQuant.cs
index c9e8f210..ce591cee 100644
--- a/Source/Core/AbsyQuant.cs
+++ b/Source/Core/AbsyQuant.cs
@@ -88,8 +88,8 @@ namespace Microsoft.Boogie {
BinderExpr other = (BinderExpr)obj;
// Note, we consider quantifiers equal modulo the Triggers.
- return object.Equals(this.TypeParameters, other.TypeParameters)
- && object.Equals(this.Dummies, other.Dummies)
+ return this.TypeParameters.SequenceEqual(other.TypeParameters)
+ && this.Dummies.SequenceEqual(other.Dummies)
&& object.Equals(this.Body, other.Body);
}