go-ctl-model-checker-eg-au-fixpoint
Solution complete and verified. Summary:
~/SOLUTION.md (1073 lines) — the requested markdown with title, root-cause analysis, exact fix (full code + commands), and verification section.~/ctl-checker/ — working Go module (go.mod, ctl.go, ctl_test.go) that the document embeds verbatim (byte-identical — confirmed by diff).EG(p) is a greatest fixpoint. On a lasso 0→1→2⇄3 with p={0,1}, a single elimination pass keeps {0} (stale superset) while the true answer is {}; deletion must propagate. Fixed with counter/queue iterative refinement: delete-until-stable, each state removed once and each edge charged once → O(|S|+|R|) (not O(|R|·|S|)).E[q U r] is a least fixpoint; one backward BFS from r-states through q-predecessors finds witnesses of every length. Fixture has state 2 with only an even-parity witness and states 3,5 with only odd-parity ones; exact answer {0..6} requires both.A[f U g] = ¬(E[¬g U (¬f∧¬g)] ∨ EG ¬g); dropping the EG ¬g disjunct returns TRUE at states whose p-loop never reaches q. Fixture: A[p U q] = {2,3} exactly.go test -race){0} superset to prove the fixture is adversarial).naiveSat computes AU directly via μX. g∪(f∧AX X), so agreement also validates the AU identity).EG over 200k states / ~400k edges in ~78 ms (linear-time confirmation).gofmt -l clean, go vet clean.# Evidence - Problem class: go-ctl-model-checker-eg-au-fixpoint - Model: openrouter/deepseek/deepseek-v4-flash-0731 - Solved: 2026-09-05T22:10:04.569Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "Write a CTL model checker in Go that decides EG and EU (and via them EF, AG, AF, AU) over a Kripke structure given as labeled adjacency. EU(q,r) is a least fixpoint computable exactly by backward BFS from states satisfying r through q-states, but EG(p) is a greatest fixpoint that demands iterative refinement: start from all p-states and repeatedly delete any state with no successor still in the set, looping until the set stabilizes -- a naive single elimination pass returns a superset of the true answer on lasso-shaped graphs. Model-check adversarial fixtures including a lasso where a single-pass EG elimination is wrong, an EU whose witnesses depend on path-length parity, and formulas over structures with p-holding self-loops that flip AU results; return the exact set of initial states satisfying each formula and keep the whole checker O(|S|+|R|) per formula.", "environment": "go1.26", "language": "go", "model": "openrouter/deepseek/deepseek-v4-flash-0731", "problem_class": "go-ctl-model-checker-eg-au-fixpoint", "provider": "openrouter", "solved_at": "2026-09-05T22:10:04.570Z", "version": "1.26"}Solution complete and verified. Summary:
~/SOLUTION.md (1073 lines) — the requested markdown with title, root-cause analysis, exact fix (full code + commands), and verification section.~/ctl-checker/ — working Go module (go.mod, ctl.go, ctl_test.go) that the document embeds verbatim (byte-identical — confirmed by diff).EG(p) is a greatest fixpoint. On a lasso 0→1→2⇄3 with p={0,1}, a single elimination pass keeps {0} (stale superset) while the true answer is {}; deletion must propagate. Fixed with counter/queue iterative refinement: delete-until-stable, each state removed once and each edge charged once → O(|S|+|R|) (not O(|R|·|S|)).E[q U r] is a least fixpoint; one backward BFS from r-states through q-predecessors finds witnesses of every length. Fixture has state 2 with only an even-parity witness and states 3,5 with only odd-parity ones; exact answer {0..6} requires both.A[f U g] = ¬(E[¬g U (¬f∧¬g)] ∨ EG ¬g); dropping the EG ¬g disjunct returns TRUE at states whose p-loop never reaches q. Fixture: A[p U q] = {2,3} exactly.go test -race){0} superset to prove the fixture is adversarial).naiveSat computes AU directly via μX. g∪(f∧AX X), so agreement also validates the AU identity).EG over 200k states / ~400k edges in ~78 ms (linear-time confirmation).gofmt -l clean, go vet clean.# Evidence - Problem class: go-ctl-model-checker-eg-au-fixpoint - Model: openrouter/deepseek/deepseek-v4-flash-0731 - Solved: 2026-09-05T22:10:04.569Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "Write a CTL model checker in Go that decides EG and EU (and via them EF, AG, AF, AU) over a Kripke structure given as labeled adjacency. EU(q,r) is a least fixpoint computable exactly by backward BFS from states satisfying r through q-states, but EG(p) is a greatest fixpoint that demands iterative refinement: start from all p-states and repeatedly delete any state with no successor still in the set, looping until the set stabilizes -- a naive single elimination pass returns a superset of the true answer on lasso-shaped graphs. Model-check adversarial fixtures including a lasso where a single-pass EG elimination is wrong, an EU whose witnesses depend on path-length parity, and formulas over structures with p-holding self-loops that flip AU results; return the exact set of initial states satisfying each formula and keep the whole checker O(|S|+|R|) per formula.", "environment": "go1.26", "language": "go", "model": "openrouter/deepseek/deepseek-v4-flash-0731", "problem_class": "go-ctl-model-checker-eg-au-fixpoint", "provider": "openrouter", "solved_at": "2026-09-05T22:10:04.570Z", "version": "1.26"}