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-1768 (#1768) (owner, 2026-11-06). Decided 2026-11-29 as ADR-prover-found-facts-v1 D15; the five prover records it touched (306, 385, 391, 395, 396) were consolidated into prover-checks-v1, prover-walk-v1, prover-found-facts-v1 and prover-refusals-v1 on the way (ADR-decision-records-v2 D4).
A found bound on a field list’s values whose end is a multiple of another list’s length is not found. Probe, target/fast/nikaia check --bounds p.nika:
struct Sat { value: Vec[i64], lits: Vec[i64] }
impl Sat {
fn add(mut self, l: i64) { if l >= 0 && l < 2 * self.value.len() { self.lits.push(l) } }
fn assign(mut self, l: i64) { self.value[l / 2] = 1 }
fn first(mut self) { if self.lits.len() > 0 { self.assign(self.lits[0]) } }
}
fn main() throws { let mut s = Sat { value: [0, 0], lits: [] }; s.add(3); s.first(); println(s.value[1]) }
gives 11 self.value[l / 2] checked: a parameter whose callers do not prove a bound and derived assign: 0 <= l. The same program with l < self.value.len() and self.value[l] gives derived assign: 0 <= l, l <= self.value.len(), l < self.value.len(), all proved. This keeps sv_sat.nika 345-347, 361, 369 checked (#1673). Suspected: the field-invariant finder in crates/nikaia-std/src/compiler/bounds_proven.nika / bounds_derived.nika, cause not traced.
ADR-prover-found-facts-v1 D15: the end of a found bound (D2, a length of another list) may be a linear term of one length and constants, c * xs.len() + d, by D2’s own rule (every write seen and proved within the term, the term’s list does not shrink, or D2’s second widening holds with the term). It follows from D1 (bounds are linear terms), D6 (a.len() == c * b.len() for lengths) and D11’s widening for derived preconditions (#1673). Only found, no written form.
c * xs.len() + d (constants c >= 1, d) where it takes xs.len() today, for the bound’s proposal, its proof at every write, and the check at a shrink of xs (D2’s second widening).x < c * xs.len() + d as a fact, so D11 derives l < 2 * self.value.len() for assign in the probe.tests/compiler/tests/ with the probe: self.value[l / 2] proved; and one where a write is not proved below the term, which stays checked.The probe’s check --bounds shows self.value[l / 2] proved and derived assign: 0 <= l, l < 2 * self.value.len(); the new tests are green; the --bounds figure of sv_sat.nika gains lines 345-347, 361, 369.
Generated by Claude Code