{"id":28032,"library":"passagemath-kissat","title":"passagemath-kissat","description":"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.","status":"active","version":"10.8.4","language":"python","source_language":"en","source_url":"https://github.com/passagemath/passagemath-kissat","tags":["sat-solver","kissat","passagemath","constraint-solving"],"install":[{"cmd":"pip install passagemath-kissat","lang":"bash","label":"Standard install"}],"dependencies":[{"reason":"Required for interrupt handling and signal support in SAT solving.","package":"cysignals","optional":false}],"imports":[{"note":"Direct import of 'kissat' is incorrect; the module is nested under passagemath.","wrong":"import kissat","symbol":"KissatSolver","correct":"from passagemath.kissat import KissatSolver"},{"note":"Import path must include passagemath.","wrong":"from kissat import solve_sat","symbol":"solve_sat","correct":"from passagemath.kissat import solve_sat"}],"quickstart":{"code":"from passagemath.kissat import KissatSolver\n\nsolver = KissatSolver()\n# Example: solve a simple SAT problem (a ∨ b) ∧ (¬a ∨ c)\nsolver.add_clause([1, 2])   # a (var 1) or b (var 2)\nsolver.add_clause([-1, 3])  # not a or c (var 3)\nresult = solver.solve()\nprint('SAT' if result.satisfiable else 'UNSAT')\nif result.satisfiable:\n    print('Model:', result.model)\n    # Model is a list of variable assignments (e.g., [-2, 1, 3] meaning b=False, a=True, c=True)","lang":"python","description":"Basic usage: create a KissatSolver instance, add clauses (variables as positive integers), call solve(), and access satisfiability and model."},"warnings":[{"fix":"Use positive integers for variables, and negate by prefixing with '-' (e.g., -1).","message":"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.","severity":"gotcha","affected_versions":"all"},{"fix":"Use the new import: 'from passagemath.kissat import KissatSolver' and instantiate before solving.","message":"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.","severity":"breaking","affected_versions":">=10.0 (standalone) vs passagemath-kissat 10.8.x"},{"fix":"Switch to KissatSolver.solve() which returns a result object with .satisfiable and .model.","message":"The function 'solve_sat' that returns a dictionary is deprecated in favor of the KissatSolver class which returns an object with attributes.","severity":"deprecated","affected_versions":"10.8.0+"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"pip install passagemath-kissat (will also install passagemath-base if not present).","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.","error":"ModuleNotFoundError: No module named 'passagemath'"},{"fix":"Ensure you have passagemath-kissat >= 10.8.0 installed. Use 'from passagemath.kissat import KissatSolver' exactly.","cause":"The module path might be incorrect or the package version is too old (before 10.8.0).","error":"ImportError: cannot import name 'KissatSolver' from 'passagemath.kissat'"},{"fix":"Pass a single list: solver.add_clause([1, 2]) instead of solver.add_clause(1, 2).","cause":"The function expects a single list/tuple of literals, not separate arguments.","error":"TypeError: add_clause() takes 2 positional arguments but 3 were given"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}