Shared: Bugfix for unique value implication.

This commit is contained in:
Anders Schack-Mulligen
2025-06-16 13:05:04 +02:00
parent 378209a6ad
commit 22d5dc999a
3 changed files with 21 additions and 0 deletions

View File

@@ -127,4 +127,20 @@ public class Guards {
chk(); // $ guarded='o != null:false' guarded=g(1):false
}
}
void t7(int[] a) {
boolean found = false;
for (int i = 0; i < a.length; i++) {
boolean answer = a[i] == 42;
if (answer) {
found = true;
}
if (found) {
chk(); // $ guarded=found:true guarded='i < a.length:true'
}
}
if (found) {
chk(); // $ guarded=found:true guarded='i < a.length:false'
}
}
}

View File

@@ -54,3 +54,7 @@
| Guards.java:125:7:125:11 | chk(...) | 'o != null:true' |
| Guards.java:127:7:127:11 | chk(...) | 'o != null:false' |
| Guards.java:127:7:127:11 | chk(...) | g(1):false |
| Guards.java:139:9:139:13 | chk(...) | 'i < a.length:true' |
| Guards.java:139:9:139:13 | chk(...) | found:true |
| Guards.java:143:7:143:11 | chk(...) | 'i < a.length:false' |
| Guards.java:143:7:143:11 | chk(...) | found:true |