Issue #2816: Prover: a dependency type’s rule holds after every change to a pub field, checked at run time under unproved-claims = “warn”

Open and answer this issue on GitHub.

ready, solver · opened 2026-11-23 · updated 2026-11-23 · 0 comments

Filed by the driver from the Found: of the run of issue-2766 (#2766). Decided by the solver supervisor on 2026-11-23 from ADR-369 D2, which already lists the points.

Decision

ADR-369 D2 says a type’s rule is established by every construction (a literal, a with copy, the constructor’s result) and after every write to a field from outside a method of the type. Part I 4.1 now says what a write is (commit 686b36041):

A write to a field is any change to it: x.f = v, x.f op= v, a method that takes mut self called on x.f, and x.f passed as a mut argument, where the rule holds once the call returns.

So all four points the run left open are checked: a mutating method on a pub field, a mut argument, a with copy, and, at every point, the warn mode. Part III, unproved-claims, already decides the warn mode: “at warn the program builds, each such claim a warning and a check where it is reached”. How that check is emitted is not a language question. Under CLAUDE.md it is emitted from Nikaia. The part of type_rules.rs it needs is moved into Nikaia rather than extended.

Found (run of #2766, e98b76b04)

prover_field_write and prover_rule_literal (crates/nikaia-std/src/compiler/prover_walk.nika) check x.f = v, x.f op= v and literals. They do not check these:

Under unproved-claims = "warn" an unproved write is a warning with no run-time check behind it.

The run also found that a mut parameter’s field paths are not prover names. fn g(mut p: P) { if p.n > 0 { assert(p.n > 0) } } gives NK1300 “p is not a whole number the prover reads”, while fn f(p: P) proves. The cause is not marked (docs/issues.md I7).

To build

Done when

Each listed point is refused when shown false, passes when proved, and is checked at run time under warn, each with a green test. The mut p probe proves, and #2766 item 3 is built.

Back to Open Issues