Open and answer this issue on GitHub.
ready, bugs, queued · opened 2026-11-16 · updated 2026-11-29 · 0 comments
Filed by the driver from the Found: of the run of issue-1757 (#1757) (owner, 2026-11-06). Decided 2026-11-29 (supervisor): ADR-prover-found-facts-v1 D16 (00ccf2cc).
sv_simplex.nika 883/884 (self.var_col[v], self.values[v] after let v = self.fractional(); if v < 0 { return }) stay checked. The cause is self.cut_check(...), a ref mut self call that only grows var_col (through new_var’s push), which drops the fact v < self.var_col.len().
Probe on develop d8fc849d, nikaia check --bounds m.nika:
struct Table {
cells: Vec[i64],
}
impl Table {
fn first_odd(ref self) -> i64 {
let mut i = 0
while i < self.cells.len() {
if self.cells[i] % 2 != 0 {
return i
}
i += 1
}
return -1
}
fn grow(ref mut self) {
self.cells.push(1)
}
fn c(ref mut self) -> i64 {
let r = self.first_odd()
if r < 0 {
return 0
}
self.grow()
return self.cells[r]
}
}
fn first_odd_of(xs: Vec[i64]) -> i64 {
let mut i = 0
while i < xs.len() {
if xs[i] % 2 != 0 {
return i
}
i += 1
}
return -1
}
fn grow(mut xs: Vec[i64]) {
xs.push(1)
}
fn main() throws {
let mut t = Table { cells: [2, 3] }
println(t.c())
let mut xs: Vec[i64] = [2, 3]
let r = first_odd_of(xs)
if r >= 0 {
grow(xs)
println(xs[r])
}
}
The program prints 3 twice. The relevant lines of check --bounds:
27 self.cells[r] checked: no fact bounds what it reads - a counter, a loop, a length, or one list as long as another (#432, #383, #388)
53 xs[r] checked: no fact bounds what it reads - a counter, a loop, a length, or one list as long as another (#432, #383, #388)
Both should be proved, since the length only grows. Without the grow call both are proved.
Cause: the walk takes a call’s frame (ADR-prover-found-facts-v1 D12) and forgets every fact about a path in it, self.cells.len() included. No found postcondition says the length is at least what it was.
ADR-prover-found-facts-v1 D16: D8’s derivation, with a length the callee changes in the place of its result, finds a relation of that length after the call to the same length before it (len >= old, len == old + 1), proved at every return. After the call the walk takes the relation with the length it knew before, so r < old gives r < self.cells.len(). A recursive callee takes it as D4 does. A body that may shrink the list proves nothing, and the fact stays forgotten. Only found, never published (D14).
bounds_walk.nika), assumed and proved for a cycle as D4.old the length the walk held before the call, for mut self and for mut parameters.tests/compiler/tests/ from the probe above: check --bounds shows lines 27 and 53 proved. Add a second callee that may pop, whose index stays checked.sv_simplex.nika 883/884 with check --bounds and name the result in the report.lower-std and build once.The probe’s lines 27 and 53 are proved under check --bounds, the pop variant stays checked, and the test is green.
Generated by Claude Code