Adding logicOps and Compop in python API
authorHamed Gorjiara <hgorjiar@uci.edu>
Thu, 12 Apr 2018 18:50:54 +0000 (11:50 -0700)
committerHamed Gorjiara <hgorjiar@uci.edu>
Thu, 12 Apr 2018 18:50:54 +0000 (11:50 -0700)
src/Test/pycsolvertest.py
src/pycsolver.py

index ca269ed..8895e89 100644 (file)
@@ -1,7 +1,6 @@
 import pycsolver as ps
 from ctypes import *
 
-SATC_EQUALS = 0
 
 def main():
        csolverlb = ps.loadCSolver()
@@ -16,7 +15,7 @@ def main():
         e2 = csolverlb.getElementVar(solver,s2)
         d = [s1, s2]
        domain = (c_void_p*len(d))(*d)
-        equals = csolverlb.createPredicateOperator(solver,c_uint(SATC_EQUALS), domain, c_uint(2));
+        equals = csolverlb.createPredicateOperator(solver,c_uint(ps.CompOp.SATC_EQUALS), domain, c_uint(2));
         inp = [e1, e2];
        inputs = (c_void_p*len(inp))(*inp)
         b = csolverlb.applyPredicate(solver,equals, inputs, c_uint(2));
index e79905d..32a8415 100644 (file)
@@ -1,5 +1,20 @@
 from ctypes import *
 
+class LogicOps:
+       SATC_AND=0
+       SATC_OR=1
+       SATC_NOT=2
+       SATC_XOR=3
+       SATC_IFF=4
+       SATC_IMPLIES=5
+
+class CompOp:
+       SATC_EQUALS = 0
+       SATC_LT=1
+       SATC_GT=2
+       SATC_LTE=3
+       SATC_GTE=4
+
 def loadCSolver():
         csolverlb = cdll.LoadLibrary("lib_cons_comp.so")
         csolverlb.createCCSolver.restype = c_void_p