https://github.com/msakai/toysolver
My sandbox for experimenting with solver algorithms.
https://github.com/msakai/toysolver
algorithms mathematical-programming sat-solver smt-solver theorem-prover
Last synced: about 1 year ago
JSON representation
My sandbox for experimenting with solver algorithms.
- Host: GitHub
- URL: https://github.com/msakai/toysolver
- Owner: msakai
- License: other
- Created: 2011-06-12T02:38:42.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2025-05-08T10:56:14.000Z (about 1 year ago)
- Last Synced: 2025-05-08T11:33:47.083Z (about 1 year ago)
- Topics: algorithms, mathematical-programming, sat-solver, smt-solver, theorem-prover
- Language: Haskell
- Homepage:
- Size: 7.6 MB
- Stars: 156
- Watchers: 10
- Forks: 11
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.markdown
- License: COPYING
Awesome Lists containing this project
README
toysolver
=========
[](https://opensource.org/licenses/BSD-3-Clause)
[](https://gitter.im/msakai/toysolver)
Hackage:
[](https://hackage.haskell.org/package/toysolver)
Dev:
[](https://github.com/msakai/toysolver/actions)
[](https://coveralls.io/r/msakai/toysolver)
It provides solver implementations of various problems including SAT, SMT, Max-SAT, PBS (Pseudo Boolean Satisfaction), PBO (Pseudo Boolean Optimization), MILP (Mixed Integer Linear Programming) and non-linear real arithmetic.
In particular, it contains moderately-fast pure-Haskell SAT solver 'toysat'.
Installation
------------
See [INSTALL.md](INSTALL.md).
Usage
-----
This package includes several commands.
### toysolver
Arithmetic solver for the following problems:
* Mixed Integer Linear Programming (MILP or MIP)
* Boolean SATisfiability problem (SAT)
* PB
* Pseudo Boolean Satisfaction (PBS)
* Pseudo Boolean Optimization (PBO)
* Weighted Boolean Optimization (WBO)
* Max-SAT families
* Max-SAT
* Partial Max-SAT
* Weighted Max-SAT
* Weighted Partial Max-SAT
* Real Closed Field
Usage:
toysolver [OPTION...] [file.lp|file.mps]
toysolver --lp [OPTION...] [file.lp|file.mps]
toysolver --sat [OPTION...] [file.cnf]
toysolver --pb [OPTION...] [file.opb]
toysolver --wbo [OPTION...] [file.wbo]
toysolver --maxsat [OPTION...] [file.cnf|file.wcnf]
-h --help show help
-v --version show version number
--solver=SOLVER mip (default), omega-test, cooper, cad, old-mip, ct
### toysat
SAT-based solver for the following problems:
* SAT
* Boolean SATisfiability problem (SAT)
* Minimally Unsatisfiable Subset (MUS)
* Group-Oriented MUS (GMUS)
* PB
* Pseudo Boolean Satisfaction (PBS)
* Pseudo Boolean Optimization (PBO)
* Weighted Boolean Optimization (WBO)
* Max-SAT families
* Max-SAT
* Partial Max-SAT
* Weighted Max-SAT
* Weighted Partial Max-SAT
* Integer Programming (all variables must be bounded)
Usage:
toysat [file.cnf|-]
toysat --sat [file.cnf|-]
toysat --mus [file.gcnf|file.cnf|-]
toysat --pb [file.opb|-]
toysat --wbo [file.wbo|-]
toysat --maxsat [file.cnf|file.wcnf|-]
toysat --lp [file.lp|file.mps|-]
PB'12 competition result:
* toysat placed 2nd in PARTIAL-BIGINT-LIN and SOFT-BIGINT-LIN categories
* toysat placed 4th in PARTIAL-SMALLINT-LIN and SOFT-SMALLINT-LIN categories
* toysat placed 8th in OPT-BIGINT-LIN category
### toysmt
SMT solver based on toysat.
Usage:
toysmt [file.smt2]
Currently only QF_UF, QF_RDL, QF_LRA, QF_UFRDL and QF_UFLRA logic are supported.
### toyfmf
SAT-based finite model finder for first order logic (FOL).
Usage:
toyfmf [file.tptp] [size]
### toyconvert
Converter between various problem files.
Usage:
toyconvert -o [outputfile] [inputfile]
Supported formats:
* Input formats: .cnf .wcnf .opb .wbo .gcnf .lp .mps
* Output formats: .cnf .wcnf .opb .wbo .lsp .lp .mps .smp .smt2 .ys
Bindings
--------
* [ersatz-toysat](http://hackage.haskell.org/package/ersatz-toysat) - toysat backend driver for [ersatz](http://hackage.haskell.org/package/ersatz)
* [satchmo-toysat](http://hackage.haskell.org/package/satchmo-toysat) - toysat backend driver for [satchmo](http://hackage.haskell.org/package/satchmo)
Spin-off projects and packages
------------------------------
* [bytestring-encoding](https://github.com/msakai/bytestring-encoding)
* [data-interval](https://github.com/msakai/data-interval)
* [extended-reals](https://github.com/msakai/extended-reals)
* [finite-field](https://github.com/msakai/finite-field)
* [MIP](https://github.com/msakai/haskell-MIP)
* [OptDir](https://github.com/msakai/haskell-optdir)
* [pseudo-boolean](https://github.com/msakai/pseudo-boolean)
* [sign](https://github.com/msakai/sign)