def count_solutions(self, lits=[]):
     if lits:
         T = And(self.constraints + lits)
     else:
         T = And(self.constraints)
     return dsharp.compile(T.to_CNF(),
                           executable='bin/dsharp').model_count()
Beispiel #2
0
    def count_solutions(self, lits=[]):
        if lits:
            T = And(self.constraints + lits)
        else:
            T = And(self.constraints)
        if not T.satisfiable():
            return 0

        return dsharp.compile(T.to_CNF(), executable='bin/dsharp', smooth=True).model_count()