Skip to content

Commit b24c9e5

Browse files
Use Dependency Contract: ignore all term labels
1 parent 9d0379c commit b24c9e5

4 files changed

Lines changed: 6 additions & 5 deletions

File tree

key.core/src/main/java/de/uka/ilkd/key/java/SourceElement.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ public interface SourceElement extends SyntaxElement, EqualsModProperty<SourceEl
9696
* These are not syntactical equal, therefore false is returned.
9797
*/
9898
@Override
99-
default <V> boolean equalsModProperty(Object o, Property<SourceElement> property, V... v) {
99+
default <V> boolean equalsModProperty(Object o, Property<? super SourceElement> property,
100+
V... v) {
100101
if (!(o instanceof SourceElement)) {
101102
return false;
102103
}

key.core/src/main/java/de/uka/ilkd/key/logic/TermImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ protected int computeHashCode() {
349349
}
350350

351351
@Override
352-
public <V> boolean equalsModProperty(Object o, Property<JTerm> property, V... v) {
352+
public <V> boolean equalsModProperty(Object o, Property<? super JTerm> property, V... v) {
353353
if (!(o instanceof JTerm other)) {
354354
return false;
355355
}

key.core/src/main/java/de/uka/ilkd/key/logic/equality/EqualsModProperty.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public interface EqualsModProperty<T> {
4949
* @param <V> the type of the additional parameters needed by {@code property} for the
5050
* comparison
5151
*/
52-
<V> boolean equalsModProperty(Object o, Property<T> property, V... v);
52+
<V> boolean equalsModProperty(Object o, Property<? super T> property, V... v);
5353

5454
/**
5555
* Computes the hash code according to the given ignored {@code property}.

key.core/src/main/java/de/uka/ilkd/key/rule/UseDependencyContractRule.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
import org.jspecify.annotations.NonNull;
4141

42-
import static de.uka.ilkd.key.logic.equality.IrrelevantTermLabelsProperty.IRRELEVANT_TERM_LABELS_PROPERTY;
42+
import static de.uka.ilkd.key.logic.equality.TermLabelsProperty.TERM_LABELS_PROPERTY;
4343

4444

4545
public final class UseDependencyContractRule implements BuiltInRule {
@@ -224,7 +224,7 @@ public static boolean isBaseOcc(JTerm focus, JTerm candidate) {
224224
return false;
225225
}
226226
for (int i = 1, n = candidate.arity(); i < n; i++) {
227-
if (!(candidate.sub(i).equalsModProperty(focus.sub(i), IRRELEVANT_TERM_LABELS_PROPERTY)
227+
if (!(candidate.sub(i).equalsModProperty(focus.sub(i), TERM_LABELS_PROPERTY)
228228
|| candidate.sub(i).op() instanceof LogicVariable)) {
229229
return false;
230230
}

0 commit comments

Comments
 (0)