Solving Picross with Prolog

By Gus Polly at English Wikipedia - Own work, CC0, Link

Nonolog is a solver for nonogram (better known in English as picross) puzzles, and was an excuse for me to learn the logic programming language Prolog. The implementation may be of interest to those with a background in or curiosity for logic programming, but isn't particulary worth report for itself (and is likely somewhat naively written.)

Nonogram puzzles present an empty grid with constraints per row and column, revealing the length and number of contained cells. A solution satisfying all constraints reveals a picture. This calls for a computerized solution: the fabric of the puzzles themselves is binary.

Prolog was a natural language for expressing puzzle constraints. Compared to the additive thinking I'm comfortable with from most programming languages, where small pieces build up to a larger idea, writing Prolog felt to me distinctly subtractive, more like chiseling away all possibilities to define a boundary around an idea.

These puzzles have haunted my boredom, and in total have demanded many hours of my idle attention. Instead of continuing to solve individual puzzles, I wondered if by solving all puzzles I would be satisfied: this has so far been true.