All Projects → liffiton → PyMiniSolvers

liffiton / PyMiniSolvers

Licence: other
A Python API for the MiniSat and MiniCard constraint solvers.

Programming Languages

C++
36643 projects - #6 most used programming language
python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to PyMiniSolvers

GHOST
General meta-Heuristic Optimization Solving Toolkit
Stars: ✭ 28 (+55.56%)
Mutual labels:  solver, constraints
Pulp
A python Linear Programming API
Stars: ✭ 1,080 (+5900%)
Mutual labels:  solver, constraints
csb
A cloth and soft body simulation library, using position based dynamics.
Stars: ✭ 29 (+61.11%)
Mutual labels:  solver, constraints
Logician
Logic programming in Swift
Stars: ✭ 182 (+911.11%)
Mutual labels:  solver, constraints
Choco Solver
An open-source Java library for Constraint Programming
Stars: ✭ 518 (+2777.78%)
Mutual labels:  solver, constraints
Optaplanner
AI constraint solver in Java to optimize the vehicle routing problem, employee rostering, task assignment, maintenance scheduling, conference scheduling and other planning problems.
Stars: ✭ 2,454 (+13533.33%)
Mutual labels:  solver, constraints
phonolammps
LAMMPS interface for phonon calculations using phonopy
Stars: ✭ 53 (+194.44%)
Mutual labels:  python-api
batsat
A (parametrized) Rust SAT solver originally based on MiniSat
Stars: ✭ 26 (+44.44%)
Mutual labels:  minisat
SiEPIC Photonics Package
A Python (v3.6.5) package that provides a set of basic functions commonly used in integrated photonics.
Stars: ✭ 22 (+22.22%)
Mutual labels:  solver
Sundials
SUNDIALS is a SUite of Nonlinear and DIfferential/ALgebraic equation Solvers. This is a mirror of current releases, and development will move here eventually. Pull requests are welcome for bug fixes and minor changes.
Stars: ✭ 194 (+977.78%)
Mutual labels:  solver
ciao
Ciao is a modern Prolog implementation that builds up from a logic-based simple kernel designed to be portable, extensible, and modular.
Stars: ✭ 190 (+955.56%)
Mutual labels:  constraints
cuba-weather-python
Application programming interface of the Cuba Weather project implemented in Python
Stars: ✭ 17 (-5.56%)
Mutual labels:  python-api
pymycobot
This is a python API for mycobot serial communication.
Stars: ✭ 55 (+205.56%)
Mutual labels:  python-api
pycsp3
A Python Library for modeling combinatorial constrained problems
Stars: ✭ 39 (+116.67%)
Mutual labels:  constraints
StoryboardConstraint
A simple way to use programmatically Autolayout Constraint created in Storyboard.
Stars: ✭ 25 (+38.89%)
Mutual labels:  constraints
kyros
Python wrapper for WhatsApp Web API websocket communication (based on https://github.com/sigalor/whatsapp-web-reveng)
Stars: ✭ 94 (+422.22%)
Mutual labels:  python-api
glpk.js
GLPK for browser & node
Stars: ✭ 72 (+300%)
Mutual labels:  solver
Cubejs
cube.js -- JavaScript library for modeling and solving the 3x3x3 Rubik's Cube
Stars: ✭ 215 (+1094.44%)
Mutual labels:  solver
libdnf
Package management library.
Stars: ✭ 157 (+772.22%)
Mutual labels:  solver
conjure
Conjure: The Automated Constraint Modelling Tool
Stars: ✭ 84 (+366.67%)
Mutual labels:  constraints

PyMiniSolvers

PyMiniSolvers is a Python API for the MiniSat and MiniCard constraint solvers. It accesses the solvers via shared libraries, reducing overhead and allowing for efficient incremental solving. Its interfaces closely match the interfaces of each tool's Solver class, providing flexible and powerful access to most of the solvers' standard capabilities. Additionally, an extended "SubsetSolver" interface is provided for each tool, simplifying reasoning about subsets of a constraint set (e.g., solving arbitrary subsets of the added constraints, extracting UNSAT cores, etc.).

Basic usage:

>>> import minisolvers
>>> S = minisolvers.MinisatSolver()
>>> for i in range(4):
...     S.new_var()  
>>> for clause in [1], [-2], [-1, 2, -3], [3, 4]:
...     S.add_clause(clause)  

>>> S.solve()
True

>>> list(S.get_model())
[1, 0, 0, 1]

>>> S.add_clause([-1, 2, 3, -4])

>>> S.solve()
False

For further examples, see the documentation.

API Documentation

https://pyminisolvers.readthedocs.io/

Setup

Requirements:

  • Python 2.7 or 3.x
  • A standard build environment (make, gcc, etc.)
  • zlib development libraries (e.g., zlib1g-dev or zlib-devel packages)

Tested Platforms:

  • Linux
  • Cygwin
  • OS X

To build the shared libraries:

$ make

To test the API (automatically tests w/ Python 2 and/or 3 as available):

$ make test

Or manually run the tests:

$ python -m doctest -v minisolvers.py
$ python test_minisolvers.py

and/or

$ python3 -m doctest -v minisolvers.py
$ python3 test_minisolvers.py

License

This code is licensed under the MIT license. See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].