Skip to content

Commit 7aaf2ce

Browse files
authored
Dependency Contract: Ignore all term labels when searching for base term (#3776)
2 parents b173c75 + 7d01c6c commit 7aaf2ce

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
@@ -41,7 +41,7 @@
4141
import org.jspecify.annotations.NonNull;
4242
import org.jspecify.annotations.Nullable;
4343

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

4646

4747
public final class UseDependencyContractRule implements BuiltInRule, ComplexJustificationable {
@@ -226,7 +226,7 @@ public static boolean isBaseOcc(JTerm focus, JTerm candidate) {
226226
return false;
227227
}
228228
for (int i = 1, n = candidate.arity(); i < n; i++) {
229-
if (!(candidate.sub(i).equalsModProperty(focus.sub(i), IRRELEVANT_TERM_LABELS_PROPERTY)
229+
if (!(candidate.sub(i).equalsModProperty(focus.sub(i), TERM_LABELS_PROPERTY)
230230
|| candidate.sub(i).op() instanceof LogicVariable)) {
231231
return false;
232232
}

0 commit comments

Comments
 (0)