npycomp.solvers.DPLL.

model_to_string#

DPLL.model_to_string(model) str#

Convert a model to a human-readible string.

Parameters:
modellist

A list of variable assignments.

Returns:
str

A human-readible string representation of the model.

Examples

Recover a set of variable assignments from a given model.

>>> from npycomp.solvers import DPLL
>>> clauses = [("x1", "x2"), ("~x1", "~x2")]
>>> solver = DPLL(clauses)
>>> model = solver.solve()
>>> model
[1, 0]
>>> solver.model_to_string(model)
x1 = 1, x2 = 1