Adding SMT Interpreters
[satune.git] / src / pycsolver.py
index e79905d550038e88857aa1fc221ce12ab32115e3..000ff18f63663264b44bf508637cc241cd83ac03 100644 (file)
@@ -1,5 +1,33 @@
 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
+
+class ArithOp:
+    SATC_ADD=0
+    SATC_SUB=1
+
+class OverFlowBehavior:
+    SATC_IGNORE=0
+    SATC_WRAPAROUND=1
+    SATC_FLAGFORCESOVERFLOW=2
+    SATC_OVERFLOWSETSFLAG=3
+    SATC_FLAGIFFOVERFLOW=4
+    SATC_NOOVERFLOW=5
+
+
 def loadCSolver():
         csolverlb = cdll.LoadLibrary("lib_cons_comp.so")
         csolverlb.createCCSolver.restype = c_void_p
@@ -7,7 +35,7 @@ def loadCSolver():
         csolverlb.createSet.restype = c_void_p
         csolverlb.getElementVar.argtypes = [c_void_p, c_void_p]
         csolverlb.getElementVar.restype = c_void_p
-        csolverlb.createPredicateOperator.argtypes = [c_void_p, c_uint, POINTER(c_void_p), c_uint]
+        csolverlb.createPredicateOperator.argtypes = [c_void_p, c_uint]
         csolverlb.createPredicateOperator.restype = c_void_p
         csolverlb.applyPredicate.argtypes = [c_void_p, c_void_p, POINTER(c_void_p), c_uint]
         csolverlb.applyPredicate.restype = c_void_p
@@ -37,15 +65,15 @@ def loadCSolver():
        csolverlb.getElementRange.restype = c_void_p
        csolverlb.getBooleanVar.argtypes = [c_void_p, c_uint]
        csolverlb.getBooleanVar.restype = c_void_p
-       csolverlb.createFunctionOperator.argtypes = [c_void_p, c_uint, POINTER(c_void_p), c_uint, c_void_p, c_uint]
+       csolverlb.createFunctionOperator.argtypes = [c_void_p, c_uint, c_void_p, c_uint]
        csolverlb.createFunctionOperator.restype = c_void_p
-       csolverlb.createPredicateOperator.argtypes = [c_void_p, c_uint, POINTER(c_void_p), c_uint]
+       csolverlb.createPredicateOperator.argtypes = [c_void_p, c_uint]
        csolverlb.createPredicateOperator.restype = c_void_p
        csolverlb.createPredicateTable.argtypes = [c_void_p, c_void_p, c_uint]
        csolverlb.createPredicateTable.restype = c_void_p
-       csolverlb.createTable.argtypes = [c_void_p, POINTER(c_void_p), c_uint, c_void_p]
+       csolverlb.createTable.argtypes = [c_void_p, c_void_p]
        csolverlb.createTable.restype = c_void_p
-       csolverlb.createTableForPredicate.argtypes = [c_void_p, POINTER(c_void_p), c_uint]
+       csolverlb.createTableForPredicate.argtypes = [c_void_p]
        csolverlb.createTableForPredicate.restype = c_void_p
        csolverlb.addTableEntry.argtypes = [c_void_p, c_void_p, c_void_p, c_uint, c_long]
        csolverlb.addTableEntry.restype = None
@@ -71,6 +99,8 @@ def loadCSolver():
        csolverlb.orderConstraint.restype = c_void_p
        csolverlb.solve.argtypes = [c_void_p]
        csolverlb.solve.restype = c_int
+        csolverlb.mustHaveValue.argtypes = [c_void_p, c_void_p]
+       csolverlb.mustHaveValue.restype = c_void_p
        csolverlb.getElementValue.argtypes = [c_void_p, c_void_p]
        csolverlb.getElementValue.restype = c_long
        csolverlb.getBooleanValue.argtypes = [c_void_p, c_void_p]
@@ -79,5 +109,11 @@ def loadCSolver():
        csolverlb.getOrderConstraintValue.restype = c_int
        csolverlb.printConstraints.argtypes = [c_void_p]
        csolverlb.printConstraints.restype = None
+        csolverlb.clone.argtypes = [c_void_p]
+       csolverlb.clone.restype = c_void_p
+       csolverlb.serialize.argtypes = [c_void_p]
+       csolverlb.serialize.restype = None
+        csolverlb.setInterpreter.argtypes = [c_void_p, c_uint]
+       csolverlb.setInterpreter.restype = None
        return csolverlb