summaryrefslogtreecommitdiff
path: root/src/api/python/cvc4.pxd
diff options
context:
space:
mode:
authorAndres Noetzli <andres.noetzli@gmail.com>2020-09-02 14:02:26 -0700
committerGitHub <noreply@github.com>2020-09-02 16:02:26 -0500
commit0f9fb31069d51e003a39b0e93f506324dec2bdac (patch)
treee59f8a6d5a6290ad7e4d83abc2c721c5efd6757f /src/api/python/cvc4.pxd
parentf845c04a147021937f1b0a942ee2080df950cda3 (diff)
[Python API] Add missing methods to Datatype/Term (#4998)
Fixes #4942. The Python API was missing some methods related to datatypes. Most importantly, it was missing mkDatatypeSorts, which meant that datatypes with unresolved placeholders could not be resolved. This commit adds missing methods and ports the corresponding tests of datatype_api_black.h to Python. The commit also adds support for __getitem__ in Term.
Diffstat (limited to 'src/api/python/cvc4.pxd')
-rw-r--r--src/api/python/cvc4.pxd10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/api/python/cvc4.pxd b/src/api/python/cvc4.pxd
index 841fbb44d..76dcc5317 100644
--- a/src/api/python/cvc4.pxd
+++ b/src/api/python/cvc4.pxd
@@ -1,6 +1,7 @@
# import dereference and increment operators
from cython.operator cimport dereference as deref, preincrement as inc
from libc.stdint cimport int32_t, int64_t, uint32_t, uint64_t
+from libcpp.set cimport set
from libcpp.string cimport string
from libcpp.vector cimport vector
from libcpp.pair cimport pair
@@ -27,6 +28,12 @@ cdef extern from "api/cvc4cpp.h" namespace "CVC4::api":
Term getConstructorTerm(const string& name) except +
size_t getNumConstructors() except +
bint isParametric() except +
+ bint isCodatatype() except +
+ bint isTuple() except +
+ bint isRecord() except +
+ bint isFinite() except +
+ bint isWellFounded() except +
+ bint hasNestedRecursion() except +
string toString() except +
cppclass const_iterator:
const_iterator() except +
@@ -127,6 +134,8 @@ cdef extern from "api/cvc4cpp.h" namespace "CVC4::api":
Sort mkBitVectorSort(uint32_t size) except +
Sort mkFloatingPointSort(uint32_t exp, uint32_t sig) except +
Sort mkDatatypeSort(DatatypeDecl dtypedecl) except +
+ vector[Sort] mkDatatypeSorts(const vector[DatatypeDecl]& dtypedecls,
+ const set[Sort]& unresolvedSorts) except +
Sort mkFunctionSort(Sort domain, Sort codomain) except +
Sort mkFunctionSort(const vector[Sort]& sorts, Sort codomain) except +
Sort mkParamSort(const string& symbol) except +
@@ -313,6 +322,7 @@ cdef extern from "api/cvc4cpp.h" namespace "CVC4::api":
Term()
bint operator==(const Term&) except +
bint operator!=(const Term&) except +
+ Term operator[](size_t idx) except +
Kind getKind() except +
Sort getSort() except +
Term substitute(const vector[Term] es, const vector[Term] & reps) except +
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback