Ejemplo n.º 1
0
 def satisfy_all(self, **params):
     """Iterate through all satisfying input points."""
     verbosity = params.get('verbosity', 0)
     default_phase = params.get('default_phase', 2)
     propagation_limit = params.get('propagation_limit', -1)
     decision_limit = params.get('decision_limit', -1)
     seed = params.get('seed', 1)
     yield from picosat.satisfy_all(self.nvars, self.clauses, verbosity,
                                    default_phase, propagation_limit,
                                    decision_limit, seed)
Ejemplo n.º 2
0
 def satisfy_all(self, **params):
     """Iterate through all satisfying input points."""
     verbosity = params.get('verbosity', 0)
     default_phase = params.get('default_phase', 2)
     propagation_limit = params.get('propagation_limit', -1)
     decision_limit = params.get('decision_limit', -1)
     seed = params.get('seed', 1)
     yield from picosat.satisfy_all(self.nvars, self.clauses, verbosity,
                                    default_phase, propagation_limit,
                                    decision_limit, seed)
Ejemplo n.º 3
0
def test_satisfy_one():
    a, b, c = map(expr, 'abc')
    _, cnf = expr2dimacscnf(a & b & c)
    assert picosat.satisfy_one(cnf.nvars, cnf.clauses) == (1, 1, 1)
    assert list(picosat.satisfy_all(cnf.nvars, cnf.clauses)) == [(1, 1, 1)]
Ejemplo n.º 4
0
def test_satisfy_one():
    _, cnf = expr2dimacscnf(expr("And(a, b, c)"))
    assert picosat.satisfy_one(cnf.nvars, cnf.clauses) == (1, 1, 1)
    assert list(picosat.satisfy_all(cnf.nvars, cnf.clauses)) == [(1, 1, 1)]
Ejemplo n.º 5
0
Archivo: expr.py Proyecto: ioram7/cfas
 def satisfy_all(self):
     """Iterate through all satisfying input points."""
     yield from picosat.satisfy_all(self.nvars, self.clauses)
Ejemplo n.º 6
0
def test_satisfy_one():
    a, b, c = map(expr, 'abc')
    _, cnf = expr2dimacscnf(a & b & c)
    assert picosat.satisfy_one(cnf.nvars, cnf.clauses) == (1, 1, 1)
    assert list(picosat.satisfy_all(cnf.nvars, cnf.clauses)) == [(1, 1, 1)]
Ejemplo n.º 7
0
 def satisfy_all(self):
     """Iterate through all satisfying input points."""
     yield from picosat.satisfy_all(self.nvars, self.clauses)
Ejemplo n.º 8
0
def test_satisfy_one():
    _, cnf = expr2dimacscnf(expr("And(a, b, c)"))
    assert picosat.satisfy_one(cnf.nvars, cnf.clauses) == (1, 1, 1)
    assert list(picosat.satisfy_all(cnf.nvars, cnf.clauses)) == [(1, 1, 1)]