Source:
<code>public boolean isSubtypeOf(DeclType dt, TypeContext ctx, FailureReason reason) { if (!(dt instanceof DefDeclType)) { reason.setReason("declaration type of " + getName() + " didn't match"); return false; } DefDeclType ddt = (DefDeclType) dt; if (args.size() != ddt.args.size() || !ddt.getName().equals(getName())) { reason.setReason("number of arguments of " + getName() + " didn't match"); return false; } View adaptationView = null; for (int i = 0; i < args.size(); ++i) { FormalArg myArg = args.get(i); FormalArg theirArg = ddt.args.get(i); ValueType theirType = theirArg.getType(); if (adaptationView == null) { adaptationView = new ReceiverView(new Variable(theirArg.getName()), new Variable(myArg.getName())); } else { theirType = theirType.adapt(adaptationView); adaptationView = new ViewExtension(new Variable(theirArg.getName()), new Variable(myArg.getName()), adaptationView); } if (!theirType.isSubtypeOf(myArg.getType(), ctx, reason)) { return false; } ctx = ctx.extend(myArg.getSite(), myArg.getType()); } EffectSet rawEffectSet = getEffectSet(); EffectSet otherEffectSet = ddt.getEffectSet(); if (rawEffectSet != null && otherEffectSet == null) { return false; } ValueType rawResultType = getRawResultType(); ValueType otherRawResultType = ddt.getRawResultType(); if (adaptationView != null) { otherRawResultType = otherRawResultType.adapt(adaptationView); } if (rawEffectSet != null && otherEffectSet != null) { <START> return rawEffectSet.equalsByName(otherEffectSet) && rawResultType.isSubtypeOf(otherRawResultType, ctx, reason); <END> } return rawResultType.isSubtypeOf(otherRawResultType, ctx, reason); }</code><technical_language>equalsByName? want a more semantic notion of equality? equals? subset right test for subtyping</technical_language>

Target:
public boolean isSubtypeOf(DeclType dt, TypeContext ctx, FailureReason reason) { if (!(dt instanceof DefDeclType)) { reason.setReason("declaration type of " + getName() + " didn't match"); return false; } DefDeclType ddt = (DefDeclType) dt; if (args.size() != ddt.args.size() || !ddt.getName().equals(getName())) { reason.setReason("number of arguments of " + getName() + " didn't match"); return false; } View adaptationView = null; for (int i = 0; i < args.size(); ++i) { FormalArg myArg = args.get(i); FormalArg theirArg = ddt.args.get(i); ValueType theirType = theirArg.getType(); if (adaptationView == null) { adaptationView = new ReceiverView(new Variable(theirArg.getName()), new Variable(myArg.getName())); } else { theirType = theirType.adapt(adaptationView); adaptationView = new ViewExtension(new Variable(theirArg.getName()), new Variable(myArg.getName()), adaptationView); } if (!theirType.isSubtypeOf(myArg.getType(), ctx, reason)) { return false; } ctx = ctx.extend(myArg.getSite(), myArg.getType()); } EffectSet rawEffectSet = getEffectSet(); EffectSet otherEffectSet = ddt.getEffectSet(); if (rawEffectSet != null && otherEffectSet == null) { return false; } ValueType rawResultType = getRawResultType(); ValueType otherRawResultType = ddt.getRawResultType(); if (adaptationView != null) { otherRawResultType = otherRawResultType.adapt(adaptationView); } return rawResultType.isSubtypeOf(otherRawResultType, ctx, reason); }