Skip to content

feat: refute with any input the interpreter replays (stage 11e) - #103

Merged
Sequela02 merged 3 commits into
mainfrom
feat/stage-11-replayed-refutation
Nov 28, 2026
Merged

Sequela02 merged 3 commits into
mainfrom
feat/stage-11-replayed-refutation

Conversation

@Sequela02

Copy link
Copy Markdown
Contributor

A refutation needed both solvers to answer sat, so a fault that one solver couldn't settle stayed undecided, even when the other solver, or a small input, showed it plainly. Two known cases: the planted fault in find's contract through a recursive spec function (11d), where neither solver can build a model of the fuel axioms, and a false all over a List<Text>, which Z3 answers unknown and cvc5 refutes.

Slice 11e of stage 11 (#83) applies decisions 5 and 6 of the 2026-11-13 second set: an input that meets requires and that the interpreter replays breaking a clause refutes it, whichever solver or the enumeration found it. The conformance cases come in their own commit, before the code.

Where to start reading: crates/accord/src/solver/combine.rs (settle, the rule), then crates/accord/src/interpret/enumerate.rs.

What changes

  • A guess counts as an input to replay. When a solver answers unknown but still prints values (cvc5 does), the answer keeps them (Answer::Guess). The solver claims nothing of them; only the interpreter's replay can make them count.
  • One replayed input settles it. With no unsat from either solver, each model in turn is replayed: the first that reproduces as the code runs refutes a universal obligation or proves an existential one. A second solver's sat adds nothing; a second model that doesn't reproduce takes nothing away.
  • Unchanged: two unsat prove (or refute an existential); sat against unsat is a disagreement, undecided, even if the model replays; a counterexample that needs a callee's contract is weak_callee.
  • Enumeration. Where neither solver answered unsat and nothing settled the obligation, the compiler tries small inputs of each parameter's type in one fixed order, up to 20,000: integers 0, ±1, ±2, 3 and the width's ends; eight texts; lists of up to 3 elements over 4 values of their type; records and variants over 3 values of each field. Each is replayed as a model is, indices of quantifiers included. Finding none proves nothing; the undecided reason says how many met requires. Only function obligations enumerate; machines, mutation, open-case search and accord diff don't.

Decisions taken within the slice

  • A guess that doesn't reproduce isn't reported. It claims nothing, so the reason stays the solver's own (a timeout, say); a sat whose model doesn't reproduce still is.
  • A single replayed witness proves an existential obligation, as a single replayed counterexample refutes a universal one: both rest on the interpreter, not on the solvers.
  • The cap is a count, not a time, so the outcome is the same on every machine.

Verification

On Windows with the pinned Z3 5.3.3 and cvc5 1.4.2:

  • cargo fmt --all --check: passed. cargo clippy --workspace --all-targets --locked -- -D warnings: passed.
  • cargo test --workspace --locked: 124 passed, 0 failed, 1 ignored (already ignored on main).
  • score.py --self-test and materials.py target/debug/accord: passed (52 s).
  • Conformance: spec-fn-recursive-fault's ensures goes from undecided to refuted; the new list-text-fault refutes false all, any and count contracts over a List<Text> (all was undecided on main, checked before the code). No other case's outcome changed.
  • Unit tests: settle (disagreement survives a replaying model, a guess against unsat stays undecided, either solver's replayed input settles it, a failed guess keeps its solver's reason, weak callees); reading a guess from cvc5's unknown; enumeration finds [""] against a false all, finds no input against a true contract and counts what met requires, and finds n = -2 reaching a row guarded by n * n == 4 and n < 0.
  • tests/timeout.rs: Fermat's cubes stay undecided with the solver's timeout as the reason, within the time bound.
  • Cost on this machine: the conformance run 80 s → 100 s, the library tests 111 s → 150 s.
  • Linux and macOS: pending (CI, full-ci).

Not established

  • The enumeration's domain is small by design; it misses faults that need larger values, longer lists or texts outside its eight.
  • No measurement of how often the enumeration settles what the solvers left open beyond these cases.

Risk note

Two-way door: a change to how outcomes are settled, behind conformance cases and unit tests; the receipt schema doesn't change. Blast radius: obligations that were undecided can now be refuted, or proved when existential, only by an input the interpreter replays; nothing proved or refuted before changes, as the unchanged suite shows. Every undecided function obligation costs up to 20,000 interpreter replays. Evidence: the checks above.

Refs #83

Atrium: 01a1e493-5c94-7ec3-9866-c6caa515b26e

Atrium-Closes: 01a1f241-1078-705e-a75a-5ac91418c430

Decision 5 of the 2026-11-13 second set (#83): an input that meets
requires and, run by the interpreter, breaks a clause refutes it,
whichever solver or the enumeration found it. The planted fault in find's
contract, undecided since 11d, is now expected refuted, and so is a false
all over a list of texts, which Z3 answers unknown and cvc5 refutes.

Refs #83
Decisions 5 and 6 of the 2026-11-13 second set (#83). A refutation used to
need both solvers' sat, so a fault the fuel axioms hide, or a false all
over a list of texts that Z3 answers unknown, stayed undecided though one
solver, or a small input, showed it. Now an input that the interpreter
replays settles the obligation whichever solver gave it, including the
values cvc5 prints with an unknown answer; a sat against an unsat stays a
disagreement. Where neither solver answered unsat and no model settled it,
the compiler tries small typed inputs in a fixed order, up to 20,000, and
reports how many met requires; finding none proves nothing.

Refs #83
@Sequela02 Sequela02 added the full-ci Run Windows and macOS CI once before merging label Nov 28, 2026
@Sequela02
Sequela02 merged commit 2b0ed7a into main Nov 28, 2026
5 checks passed
@Sequela02
Sequela02 deleted the feat/stage-11-replayed-refutation branch November 28, 2026 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-ci Run Windows and macOS CI once before merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant