T getIndices[T]() except +
string toString() except +
+ cdef cppclass OpHashFunction:
+ OpHashFunction() except +
+ size_t operator()(const Op & o) except +
+
cdef cppclass Result:
# Note: don't even need constructor
bint isUninterpretedSortParameterized() except +
string toString() except +
+ cdef cppclass SortHashFunction:
+ SortHashFunction() except +
+ size_t operator()(const Sort & s) except +
+
cdef cppclass Term:
Term()
bint operator==(const Term&) except +
const_iterator begin() except +
const_iterator end() except +
+ cdef cppclass TermHashFunction:
+ TermHashFunction() except +
+ size_t operator()(const Term & t) except +
+
cdef extern from "api/cvc4cpp.h" namespace "CVC4::api::RoundingMode":
cdef RoundingMode ROUND_NEAREST_TIES_TO_EVEN,
from cvc4 cimport Result as c_Result
from cvc4 cimport RoundingMode as c_RoundingMode
from cvc4 cimport Op as c_Op
+from cvc4 cimport OpHashFunction as c_OpHashFunction
from cvc4 cimport Solver as c_Solver
from cvc4 cimport Sort as c_Sort
+from cvc4 cimport SortHashFunction as c_SortHashFunction
from cvc4 cimport ROUND_NEAREST_TIES_TO_EVEN, ROUND_TOWARD_POSITIVE
from cvc4 cimport ROUND_TOWARD_ZERO, ROUND_NEAREST_TIES_TO_AWAY
from cvc4 cimport Term as c_Term
+from cvc4 cimport TermHashFunction as c_TermHashFunction
from cvc4kinds cimport Kind as c_Kind
#### Result class can have default because it's pure python
+## Objects for hashing
+cdef c_OpHashFunction cophash = c_OpHashFunction()
+cdef c_SortHashFunction csorthash = c_SortHashFunction()
+cdef c_TermHashFunction ctermhash = c_TermHashFunction()
+
+
cdef class Datatype:
cdef c_Datatype cd
def __cinit__(self):
def __repr__(self):
return self.cop.toString().decode()
+ def __hash__(self):
+ return cophash(self.cop)
+
def getKind(self):
return kind(<int> self.cop.getKind())
def __repr__(self):
return self.csort.toString().decode()
+ def __hash__(self):
+ return csorthash(self.csort)
+
def isBoolean(self):
return self.csort.isBoolean()
term.cterm = ci
yield term
+ def __hash__(self):
+ return ctermhash(self.cterm)
+
def getKind(self):
return kind(<int> self.cterm.getKind())