An open API service indexing awesome lists of open source software.

https://github.com/andreasabel/sbv-quarter-circle-puzzle

Solve a grid-based partitioning puzzle with SMT using Haskell's sbv library
https://github.com/andreasabel/sbv-quarter-circle-puzzle

Last synced: 9 months ago
JSON representation

Solve a grid-based partitioning puzzle with SMT using Haskell's sbv library

Awesome Lists containing this project

README

          

Using Haskell library `sbv` to solve the second puzzle given here:

https://www.cse.chalmers.se/~sattler/retreat-puzzle-2024.pdf

`sbv` is a front-end to SMT provers like `z3`.

Files:

- [Puzzle definition](src/Val.hs)
- [Board](src/Board.hs) and constraints concerning correct division and coloring of the board.
- [Correct sums](src/Valuation.hs)
- [Entry point](main/Main.hs)

See comments for the representation of the board and the constraints that classify valid solutions.

`stack run` solves the puzzle via a `z3` call.
Warning! On my machine (2016 Intel macBook) it took almost one hour.