X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=src%2Fpycsolver.py;h=f08d164e5d5edbbf094793c20270ea4b2fb77c06;hb=3c33c8ed7c4600da543b2a82bcffd5aca86f0eb9;hp=32a8415b9da431b24a941c4c48b0154d6a527d4e;hpb=2c10a426feff18b5983fd42f4d98c82a7e913a5c;p=satune.git diff --git a/src/pycsolver.py b/src/pycsolver.py index 32a8415..f08d164 100644 --- a/src/pycsolver.py +++ b/src/pycsolver.py @@ -15,6 +15,19 @@ class CompOp: 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 @@ -22,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 @@ -52,15 +65,19 @@ 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.getBooleanTrue.argtypes = [c_void_p] + csolverlb.getBooleanTrue.restype = c_void_p + csolverlb.getBooleanFalse.argtypes = [c_void_p] + csolverlb.getBooleanFalse.restype = c_void_p + 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 @@ -74,6 +91,10 @@ def loadCSolver(): csolverlb.applyPredicate.restype = c_void_p csolverlb.applyLogicalOperation.argtypes = [c_void_p, c_uint, c_void_p, c_uint] csolverlb.applyLogicalOperation.restype = c_void_p + csolverlb.applyExactlyOneConstraint.argtypes = [c_void_p, c_void_p, c_uint] + csolverlb.applyExactlyOneConstraint.restype = c_void_p + csolverlb.applyAtMostOneConstraint.argtypes = [c_void_p, c_void_p, c_uint] + csolverlb.applyAtMostOneConstraint.restype = c_void_p csolverlb.applyLogicalOperationTwo.argtypes = [c_void_p, c_uint, c_void_p, c_void_p] csolverlb.applyLogicalOperationTwo.restype = c_void_p csolverlb.applyLogicalOperationOne.argtypes = [c_void_p, c_uint, c_void_p] @@ -86,13 +107,27 @@ def loadCSolver(): csolverlb.orderConstraint.restype = c_void_p csolverlb.solve.argtypes = [c_void_p] csolverlb.solve.restype = c_int + csolverlb.solveIncremental.argtypes = [c_void_p] + csolverlb.solveIncremental.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.getElementValue.restype = c_void_p + csolverlb.freezeElement.argtypes = [c_void_p, c_void_p] + csolverlb.freezeElement.restype = c_long csolverlb.getBooleanValue.argtypes = [c_void_p, c_void_p] csolverlb.getBooleanValue.restype = c_int csolverlb.getOrderConstraintValue.argtypes = [c_void_p, c_void_p, c_long, c_long] csolverlb.getOrderConstraintValue.restype = c_int csolverlb.printConstraints.argtypes = [c_void_p] csolverlb.printConstraints.restype = None + csolverlb.turnoffOptimizations.argtypes = [c_void_p] + csolverlb.turnoffOptimizations.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