Open videlec opened 7 years ago
Description changed:
---
+++
@@ -7,5 +7,6 @@
sage: x = solver.new_variable()
sage: solver.add_clause([x['hello'], -x[(1,2)], x[3]])
x
just provides an automatic translation from Python objects to integer.
solver.solve()
instead of solver()
(the result being either True
or False
)solver.get_values(x)
to get the values of the variables when the problem is SAT
Someooooone suggested to support the pythonic syntax !x[(1,2)]
for the negation of a variable ;)
We could have a much more friendly user interface to SAT solvers by following what has been done for MixedIntegerLinearProgram. We propose that for a given SAT solver created via
solver = SAT()
weFor compatibility with standard solvers, nonzero integers are also allowed, the variable
x
just provides an automatic translation from Python objects to integer.solver.solve()
instead ofsolver()
(the result being eitherTrue
orFalse
)solver.get_values(x)
to get the values of the variables when the problem is SATCC: @sagetrac-tmonteil @mkoeppe
Component: combinatorics
Issue created by migration from https://trac.sagemath.org/ticket/24172