You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
False error: an if condition that mentions a variable is dropped when that variable is assigned (if (n <= 10 - t) t = t + n) #538
When an if condition mentions a variable and that variable is then assigned on the guarded path, the condition is dropped from what is known at the assignment. A guard written exactly to keep the variable in range therefore does not prove the assignment.
So it looks as if a path condition that mentions t is discarded when t gets a new version, where it should be kept about the previous version (n <= 10 - t@old).
Why it matters
Bounded accumulation is commonly guarded this way:
@Refinement("_ >= 0 && _ <= 1024") inttotal = 0;
while (total < 1024) {
intn = in.read(buf, total, 1024 - total);
if (n <= 0 || n > 1024 - total)
break;
total = total + n; // rejected; counterexample total == 1025 with n == 2, which the guard excludes
}
Seen in agent-written code: after the verifier rejected a plain read loop (see the issue on loop counters), agents added the annotation and this guard, and were rejected again.
[Claude] Cause: when a variable is assigned, checkAssignment drops every path condition that mentions it. Each path condition is stored twice: on the plain name (n <= 10 - t, which is stale after the assignment) and on the instances at that point (n@1 <= 10 - t@0, which stays true). Fix: keep the instance copy and drop only the plain-name part. This is the prerequisite step of the loop invariant inference plan, #542.
Activity
CatarinaGamboa commentedon Nov 23, 2026
[Claude] Cause: when a variable is assigned,
checkAssignmentdrops every path condition that mentions it. Each path condition is stored twice: on the plain name (n <= 10 - t, which is stale after the assignment) and on the instances at that point (n@1 <= 10 - t@0, which stays true). Fix: keep the instance copy and drop only the plain-name part. This is the prerequisite step of the loop invariant inference plan, #542.Add the candidate invariants of the int locals a loop changes (#550)
Infer loop invariants for the int locals a loop changes (Houdini) (#551)