Copyright Jolyon Bloomfield 2025
aspuzzle is a modular framework for solving logic puzzles with Answer Set Programming. Puzzle rules are expressed as composable Python modules (grids, regions, symbol sets), translated to clingo programs via the aspalchemy library, and solved by clingo.
Puzzle instances live as JSON configs in puzzles/. Solve one from the command line:
python solveit.py sudoku # solve puzzles/sudoku.json
python solveit.py minesweeper --stats
python solveit.py fillomino --render-only # just emit the ASP programGenerated ASP programs are written to solver_scripts/, and human-readable puzzle rules live in rules/.
uv sync
uv run pytest tests/ # solves the whole puzzle corpus end to end