Skip to content

Instantly share code, notes, and snippets.

View bubba2k's full-sized avatar

Hans bubba2k

View GitHub Profile
@bubba2k
bubba2k / zebra-puzzle.hs
Last active November 4, 2026 23:27
The Zebra puzzle encoded as a SAT problem with Haskell ersatz library
import Ersatz
import Ersatz.Solver.Kissat (kissat)
import Ersatz.Counting
import Control.Monad
import Prelude hiding ( (||), (&&), xor, not, and, or )
import Control.Monad (replicateM)
import Data.List(transpose, intercalate)
import GHC.Num (naturalIsOne)
import Text.Printf (printf)