passagemath-kissat
raw JSON → 10.8.4 verified Sat May 09 auth: no python
Interface to the SAT solver Kissat, part of the passagemath ecosystem. Provides a Python wrapper for the Kissat SAT solver, which is a compact, clean, and efficient SAT solver. Current version 10.8.4, compatible with Python 3.11–3.14. Release cadence is irregular, following upstream Kissat releases.
pip install passagemath-kissat Common errors
error ModuleNotFoundError: No module named 'passagemath' ↓
cause The passagemath package is not installed. passagemath-kissat is a namespace package; you need to install the base passagemath package or at least ensure the namespace is available.
fix
pip install passagemath-kissat (will also install passagemath-base if not present).
error ImportError: cannot import name 'KissatSolver' from 'passagemath.kissat' ↓
cause The module path might be incorrect or the package version is too old (before 10.8.0).
fix
Ensure you have passagemath-kissat >= 10.8.0 installed. Use 'from passagemath.kissat import KissatSolver' exactly.
error TypeError: add_clause() takes 2 positional arguments but 3 were given ↓
cause The function expects a single list/tuple of literals, not separate arguments.
fix
Pass a single list: solver.add_clause([1, 2]) instead of solver.add_clause(1, 2).
Warnings
gotcha Variable indices must be positive integers. Zero and negative non-zero values are not allowed for variable numbers in add_clause(). Only negative literals (e.g., -1) are used to denote negation. ↓
fix Use positive integers for variables, and negate by prefixing with '-' (e.g., -1).
breaking The API changed significantly from the standalone 'kissat' package. The standalone version used 'kissat.solve()' with different return types. In passagemath-kissat, the solver is a class with a different interface. ↓
fix Use the new import: 'from passagemath.kissat import KissatSolver' and instantiate before solving.
deprecated The function 'solve_sat' that returns a dictionary is deprecated in favor of the KissatSolver class which returns an object with attributes. ↓
fix Switch to KissatSolver.solve() which returns a result object with .satisfiable and .model.
Imports
- KissatSolver wrong
import kissatcorrectfrom passagemath.kissat import KissatSolver - solve_sat wrong
from kissat import solve_satcorrectfrom passagemath.kissat import solve_sat
Quickstart
from passagemath.kissat import KissatSolver
solver = KissatSolver()
# Example: solve a simple SAT problem (a ∨ b) ∧ (¬a ∨ c)
solver.add_clause([1, 2]) # a (var 1) or b (var 2)
solver.add_clause([-1, 3]) # not a or c (var 3)
result = solver.solve()
print('SAT' if result.satisfiable else 'UNSAT')
if result.satisfiable:
print('Model:', result.model)
# Model is a list of variable assignments (e.g., [-2, 1, 3] meaning b=False, a=True, c=True)