carlok — zsh — 88×30

cat _posts/2026-10-24-dratify-0-1-9-and-0-1-10-a-repeated-literal-is-the-same-clause-and-a-proof-is-a-stream-of-clauses-cdclkit-0-1-7-carries-the-first-fix-into-the-native-half.md

dratify 0.1.9 and 0.1.10: a repeated literal is the same clause, and a proof is a stream of clauses; cdclkit 0.1.7 carries the first fix into the native half

dratify 0.1.9 fixes a false rejection in both checkers: they counted literal occurrences, so 1 1 0 — the clause (1) — never became unit at the root and a later step that needed it was refused, while 1 0 / 0 verified and 1 1 0 / 0 did not; d 1 1 0 also got past the ignore-unit-deletions rule and deleted the unit. Repeats are now removed at the top of check_step keeping first occurrences so the RAT pivot is unchanged, false rejections only and nothing invalid accepted (8a06896). tests/naive.py counted the same way, so the reference could not see the bug; it now treats clauses as sets, and its property test and the agreement fuzz generate repeated literals, with new end-to-end tests on both engines.

0.1.10 is about what a text proof is. parse_proof read a line at a time, stopped at the line’s first 0 and ignored the rest, so in 1 2 0 3 0 the invalid clause 3 was never checked and a proof containing it could be reported as “every step verified” — the verdict was right, since the steps that were read refute the formula on their own, but a forward checker promises to check every step, and 1 0 0 lost its empty clause the same way (2ab5226). A proof is now read the way drat-trim reads it, fscanf(" %i "): line breaks are whitespace, clauses may share or span lines, d starts a deletion only at the start of a clause, and anything that is not part of a clause raises naming its line. tests/test_proof_stream.py covers both engines and a fifth fuzz property asserts that re-flowing whitespace cannot change the parse.

Two more parse_dimacs holes came back from a Provex run on branches, unreviewed by a person so far: a literal in a clause body could name any variable — 1 3000000 0, twelve characters, gave nvars == 3000000 and sized the checker’s arrays, while the header form p cnf 3000000 0 was refused — so the body now gets the header’s bound and a ValueError naming the line and the literal (3e7ecd7), and the header check now counts the tautologies CNF.add drops, since p cnf 2 2 with 1 -1 0 and 1 2 0 raised under strict=True with header_mismatch (2, 1) (5153ac0). cdclkit 0.1.7 then requires dratify 0.1.9 in both halves: cdclkit-native embeds the Rust checker and registers it with dratify, so Python users get that side of the repeated-literal fix only from this release — cdclkit’s own solvers never write repeated literals, so its self-checks were unaffected (60d4872).