HomeAI & Machine LearningCEGIS 2D: Counterexample-Guided Program Synthesis

CEGIS 2D: Counterexample-Guided Program Synthesis

Watch counterexample-guided inductive synthesis (CEGIS) narrow a 2D lattice of candidate linear programs down to the one hidden program consistent with every input, alongside a live function-graph panel.

AI & Machine Learning2DAdvanced60 FPS📱 Mobile-adapted⇄ 3D version
2d-ai-topic-21 ↗ Open standalone

Program synthesis turns a specification into working code by searching a space of candidate programs and checking each one against the spec — the loop at the heart of modern AI-assisted, correctness-first code generation. This 2D companion makes the loop concrete and finite across two linked panels: a candidate lattice on the left, showing every integer (a, b) program as a dot, and a function graph on the right, showing the currently proposed line f(x) = a·x + b against the domain the verifier probes. The hidden spec is one linear program the synthesizer cannot see directly; each round it proposes the first candidate consistent with every counterexample seen so far, the verifier scans the integer domain for a disagreement, and every counterexample found prunes the candidate lattice live — exactly like SMT-backed CEGIS tools (Sketch, Rosette) do over far richer program grammars — until the surviving candidate is provably equal to the hidden program.

⚙ Under the hood

Watch counterexample-guided inductive synthesis (CEGIS) narrow a 2D lattice of candidate linear programs down to the one hidden program consistent with every input, alongside a linked function-graph panel — the same synthesize-verify loop behind AI-assisted, correctness-first code generation.

program synthesisCEGISformal verificationSMTcounterexamplesalgorithms

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)