Beispiel #1
0
    def _get_var_id(self, symbol):
        if not symbol.is_symbol(types.BOOL):
            raise NotImplementedError("No theory terms are supported in PicoSAT")

        if symbol in self._var_ids:
            return self._var_ids[symbol]
        else:
            vid = picosat.picosat_inc_max_var(self.pico)
            self._var_ids[symbol] = vid
            return vid
Beispiel #2
0
    def _get_var_id(self, symbol):
        if not symbol.is_symbol(types.BOOL):
            raise ConvertExpressionError("No theory terms are supported in PicoSAT")

        if symbol in self._var_ids:
            return self._var_ids[symbol]
        else:
            vid = picosat.picosat_inc_max_var(self.pico)
            self._var_ids[symbol] = vid
            return vid
 def newVar(self):
     "Return a new variable."
     return picosat.picosat_inc_max_var(self.p)
Beispiel #4
0
import picosat

with open("/tmp/log", "w") as fout:
    p = picosat.picosat_init()
    picosat.picosat_set_verbosity(p, 100)
    f = picosat.picosat_set_output(p, fout)
    picosat.picosat_measure_all_calls(p)
    picosat.picosat_inc_max_var(p)
    picosat.picosat_add(p, 1)
    picosat.picosat_add(p, -1)
    picosat.picosat_add(p, 0)
    assert picosat.picosat_sat(p, -1) == picosat.PICOSAT_SATISFIABLE
    picosat.picosat_message(p, 0, "End")
    picosat.picosat_flushout(f)
    picosat.picosat_reset(p)
print("Done.")