summaryrefslogtreecommitdiff
path: root/src/api/python
AgeCommit message (Collapse)Author
2021-10-27Python api documentation for sorts (#7440)yoni206
This PR adds documentation for the Sort python API.
2021-10-25Java and python unit tests for mkCardinalityConstraint (#7486)Andrew Reynolds
Adds leftover missing unit tests for new API call for mkCardinalityConstraint from eeb78c8.
2021-10-20api: Add Solver::mkSepEmp(). (#7432)Aina Niemetz
@alex-ozdemir
2021-10-20Add `isNull` and `isUpdater` to `Sort` class of python API (#7423)yoni206
This adds two missing functions to the python API, along with tests for them. It also adds a missing test for the cpp API.
2021-10-20api: Rename get(BV|FP)*Size functions for consistency. (#7428)Aina Niemetz
2021-10-15Python api documentation: Op, Grammar, Result, Enums (#7095)yoni206
This PR adds documentation to the python class Op, Grammar, Result, and for API enums. Additionally, documentation for isNull functions in the datatype classes is added for the python API, and a small change in the cpp API documentation is introduced.
2021-10-15Fix bad cast in the python API (#7359)Alex Ozdemir
2021-10-07Add new versioning scheme (#7253)Gereon Kremer
This introduces a new versioning mechanism that allows for better automation.
2021-10-04Various improvements to documentation (#7283)Gereon Kremer
This PR adds a couple of improvements to our documentation setup - add an explicit dependency on the extension so that sphinx rebuilds pages appropriately when an extension is modified - sphinx now emits warnings for examples that are not implemented in all languages (smt2, cpp, java and python) - add -v to make the sphinx output more log-file friendly - avoid a warning when the java bindings (and thus java docs) are not build - replace file(WRITE by configure_file to avoid rather common erroneous rebuilds of python docs - fix a reference to a label in the python docs - suppress timestamps in javadoc output to avoid docs-ci being triggered for every PR - improve placeholder message when java bindings are disabled
2021-10-01Fix some python docstrings which lead to sphinx warnings (#7293)Gereon Kremer
This PR fixes some docstrings that are not properly indented for sphinx.
2021-09-30Refactor our static builds (#7251)Gereon Kremer
This PR does a major refactoring on how we organize our builds to allow both shared and static builds. We now build the libraries using object libraries to allow building the libraries both dynamically and statically in the same build folder, though the static library is optional (ENABLE_STATIC_LIBRARY). The binary is linked either dynamically or statically (depending on ENABLE_STATIC_BINARY).
2021-09-20Start python API Solver documentation (#7064)Alex Ozdemir
2021-08-30python docs for Datatype-related classes (#7058)yoni206
2021-08-27Add missing methods to Solver API for models (#7052)Andrew Reynolds
This adds the last two remaining API methods required for implementing the text output of get-model on the API side. A followup PR will implement GetModelCommand on the API side and eliminate the (last remaining) call to getSmtEngine() from the command layer. This PR does some minor reorganization of the model cores code to account for the new interface. It also removes a deprecated interface from TheoryModel.
2021-08-27Add `isNull` to cpp api tests, python api, and python api tests (#7059)yoni206
While working on API documentation for python, I noticed that isNull is not wrapped by the python API. It is also not tested in the cpp API tests. This PR fixes both issues, and also updates the python api tests accordingly.
2021-08-23Adding parameters to Datatype python API documentation (#7027)yoni206
2021-08-23api: Require size argument for mkBitVector. (#6998)Aina Niemetz
This removes support for creating bit-vectors from a string without a size argument. We further also now require that the base argument is always given (it has no default value).
2021-08-20Make driver use options from the solver (#6930)Gereon Kremer
This PR removes explicit ownership of the options object from the main function and replaces it by an api::Solver object. To achieve this, it does a number of minor changes: - api::Solver not takes a unique_ptr<Options> in its constructor - CommandExecutor only holds a reference to (a unique ptr of) the api::Solver - the main functions accesses options via the solver
2021-07-28Fixes for building python wheels on manylinux2014 (#6947)makaimann
This PR makes several fixes to the wheel building infrastructure for manylinux2014. don't statically link to Python (see: this section of PEP-513) use standard 'build' directory. I noticed that the wheel infrastructure uses directory 'build' to prepare the wheel anyway, so it doesn't make a lot of sense for us to use a separate working directory. I tried changing the name of the build directory in setuptools by setting member variables in initialize_options but that didn't seem to work and I decided it wasn't worth the effort. The wheel should be built in a clean environment anyway, i.e., docker. find the correct include directory and python library paths for building on manylinux2014 using skbuild. manylinux2014 has several versions of python installed in /opt/python. The CMake infrastructure can't find the necessary information (plus the libraries are deleted from the docker image to save space -- the library is just set to a generic libpython<version>.a). Instead, this PR would manually set them via CMake options. to allow setting the python information, I extended the configure.sh script to allow directly setting CMake options. There are definitely other options here if you'd rather not change configure.sh. My reasoning was that it could be useful in other situations and I just marked it as an advanced feature. Another approach would be to use skbuild directly in the CMake infrastructure. I didn't like that solution because it would make the CMakeLists.txt more complicated and it wouldn't follow the standard CMake/Cython/Python approach which means we won't benefit from future improvements to that CMake infrastructure. Plus, this issue should only come up on systems with non-standard installations of Python, such as manylinux. This approach (setting CMake options) is basically what scikit-build does automatically if we had used that infrastructure directly.
2021-07-08Add script to build wheel for pycvc5 (#6839)makaimann
This PR adds a script for building a wheel distribution for pycvc5. It automatically reads the top-level CMakeLists.txt to obtain the current version number, and then runs the standard setup from setuptools with an extension command class that configures and builds cvc5 with Python bindings. This wheel file is sufficient for uploading to Pypi. Although, note that we need to build for different operating systems and different Python versions because of the extension modules. Note: another option is to use the scikit-build instead of doing the configuring and building manually. However, I ran into some issues when the setup.py file was not at the top-level. Because we prefer to have it hidden in a sub-folder, I took the manual route for now. In the future, we could consider changing this.
2021-06-22python api unit tests for Op (#6785)yoni206
Unit tests are translated from https://github.com/cvc5/cvc5/blob/master/test/unit/api/op_black.cpp to python. The only thing that is not faithfully translated is that the `cpp` tests expect the template function `[getIndices](https://github.com/cvc5/cvc5/blob/master/src/api/cpp/cvc5.h#L841)` to fail when an inappropriate type is given to it, while in the [`python` API](https://github.com/cvc5/cvc5/blob/90d19f7cdbaf41e389bdcbd099471f658a35ce98/src/api/python/cvc5.pxi#L343) this function is not a template, but just tries every supported type. For example, the following line is not translated: https://github.com/cvc5/cvc5/blob/90d19f7cdbaf41e389bdcbd099471f658a35ce98/test/unit/api/op_black.cpp#L206
2021-06-22Python api unit tests for Result (#6763)yoni206
This PR translates the cpp API unit tests about results to python. The original cpp file is: https://github.com/cvc5/cvc5/blob/master/test/unit/api/result_black.cpp The translation made rise to one addition to the python API: The UnknownExplanation object from the cpp API was represented by a string in the python API. Now we have a more faithful representation, as an enum.
2021-06-19Adding python API test part 5 (#6743)Ying Sheng
This commit (follow #6553) adds more functions and unit tests for python API. Subsequent PR will include additional missing functions and unit tests. 1. Adding getNullSort() and mkEmptyBag() functions. 2. Allowing mkOp() with a list of arguments (previously allowed at most 2). 3. Allowing mkString() with additional boolean argument useEscSequences. 4. Corresponding changes to the tests.
2021-06-16Make symfpu a required dependency. (#6749)Aina Niemetz
2021-06-08Change output of getRealValue to a fraction. (#6692)Alex Ozdemir
Our documentation for `toPythonObj` says that real values are represented as Fractions. However, getRealValue yields a float approximation thereof. We should probably stick to Fractions, since they allow us to precisely capture values in LRA. Also, that's more aligned with the C++ API, which returns a string representation of the (unapproximated) Rational. Also, document some (potential) weirdness with calling mkReal on floating-point values.
2021-06-03Adding unit tests for the datatypes python API (#6658)yoni206
This commit adds unit tests that are translated from `datatype_api_black.cpp`. One API function is also added to the python API. This is the last part of the python api unit tests for datatypes. Co-authored-by: Andres Noetzli <andres.noetzli@gmail.com>
2021-06-02Adding getters to the python API and testing them (#6652)yoni206
This PR adds missing API functions from the cpp Term API to the python API. Corresponding tests are translated from term_black.cpp.
2021-06-01Some additions to the datatypes python API (#6640)yoni206
This commit makes the following additions, in order to sync the python API with the cpp API. 1. adding `getName` functions to datatypes related classes 2. allowing `mkDatatypeSorts` with 1 or 2 arguments (previously allowed only 2). 3. In case there is a second argument to `mkDatatypeSorts`, we make sure it is a set. 4. Corresponding changes to the tests.
2021-06-01FP value support in python API (#6644)yoni206
This PR adds new is* functions from the cpp API to the python API. In particular, it adds getFloatingPointValue() function from the cpp API. A test (translated from term_black.cpp) is added. getFloatingPointValue() returns a tuple, and so this requires importing an instance of tuples into cython.
2021-05-31Update `toPythonObj` to use new getters -- part 1 (#6623)yoni206
Following #6496 , this PR adds new getters to the python API, as well as tests for them. This makes toPythonObj simpler. A future PR will add more getters to the python API. Co-authored-by: Gereon Kremer nafur42@gmail.com
2021-05-28Python API: bugfix + translating tests from cpp unit tests (#6559)yoni206
This PR fixes an issue in the python API for datatypes, and also introduces tests translated from https://github.com/cvc5/cvc5/blob/master/test/unit/api/datatype_api_black.cpp The next PR will translate more tests and will also introduce missing functions in the python API for datatypes.
2021-05-21Use scikit-build CMake files for pycvc5 (#6543)makaimann
This PR removes copied CMake files for the pycvc5 Cython target, and instead adds a dependency on scikit-build (where those CMake files originated anyway). This keeps us up to date with fixes. Furthermore, the PR switches from distutils to the more modern setuptools. This does add another dependency but it's a fairly reasonable one. setuptools is not part of the base Python distribution, but my understanding is that it is now the de facto standard, and most package managers install it automatically with Python. The main motivation for switching is in preparation for building wheels. This PR is a piece of this old one (#5657) which I am closing and splitting up.
2021-05-20Avoid using printSynthSolution in the python API and examples (#6564)yoni206
The function printSynthSolution declared here is going to be removed in #6521. This PR removes it from the python API. Following #6530, this PR also replaces its usages in the examples by a utility function. For this, we also add support for getSynthSolutions in the python API.
2021-05-20Minor improvements to the API (#6585)Gereon Kremer
This PR does some minor improvements to the API: - remove getConstSequenceElements(), use getSequenceValue() instead - improve documentation for Term
2021-05-20Add more getters for api::Term (#6496)Gereon Kremer
This PR adds more getter functions for api::Term to retrieve values from constant terms (and terms that the average API use might consider constant). It also introduces std::wstring as regular representation for string constants instead of std::vector<uint32> for the SMT-LIB parser and the String class.
2021-05-13Adding functions to the python API and testing them -- part 2 (#6517)yoni206
This PR adds some functions that are missing in the python API, along with unit tests for them. The unit tests are translated from https://github.com/cvc5/cvc5/blob/master/test/unit/api/term_black.cpp
2021-05-13Fix error message in toPythonObj (#6524)Alex Ozdemir
2021-05-08Adding functions to the python API and testing them (#6477)yoni206
This PR adds some functions that are missing in the python API, along with unit tests for them. Subsequent PR will include additional missing functions. Also includes a yapf run to reformat the test file. Co-authored-by: Makai Mann makaim@stanford.edu
2021-05-07Add support for datatype update (#6449)Andrew Reynolds
This removes the special case of TUPLE_UPDATE and RECORD_UPDATE in favor of the more general datatype update. Datatype update is handled analogously to APPLY_SELECTOR / APPLY_TESTER.
2021-05-07Fix for toPythonObj of integer value with real sort (#6505)makaimann
2021-05-04Improve generation of python API documentation (#6482)Gereon Kremer
This PR makes generating the python part of our API documentation more reliable. If python bindings are enabled, it makes the docs target depend on pycvc5 and renders a warning into the documentation if python bindings are disabled. To make the dependency on pycvc5 work properly, it changes the python bindings build so that the library is directly put in the right place and avoid the manual rename, so that the pycvc5 target actually points to the correct file. Unfortunately, this means we need to build libcvc5 when building docs with python bindings enabled.
2021-04-27Initial setup for docs of python API (#6445)Gereon Kremer
This PR adds the basic setup for including the python API in our sphinx documentation and shows how it works using the Datatype class as an example. In detail - it enables sphinx.ext.autodoc and makes sure the generated pycvc5 is in the search path - adds a index page for the python API - adds a page for the Datatype class - adds docstrings for the Datatype class - does some finetuning (remove source locations, but adds signature information)
2021-04-27Use std::hash for API types (#6432)Gereon Kremer
This PR replaces all api::*HashFunction objects by specializations of std::hash. std::hash is meant to be extended in this way, and it allows for a much cleaner usage of std::unordered_set and std::unordered_map with these types.
2021-04-21Goodbye CVC4, hello cvc5! (#6371)Mathias Preiner
This commits changes the build system to cvc5 and removes the remaining occurrences of CVC4. It further cleans up outdated/unused scripts in contrib/.
2021-04-20Add instantiation pool feature to the API (#6358)Andrew Reynolds
This adds the command declare-pool to the public API. It also adds parsing support for this feature, lifts the internal kinds to public kinds, adds an example regression, and a unit test for the new declare-pool solver method.
2021-04-20python API sorts: adding functions and tests (#6361)yoni206
This PR does the following: 1. removes old python sort API test 2. creates a new python sort API test, obtained by translating the (entire) cpp unit test https://github.com/CVC4/CVC4/blob/master/test/unit/api/sort_black.cpp 3. adds support for bags and datatype selectors/testers domain/codomain in the python API.
2021-04-15Rename occurrences of CVC4 to CVC5. (#6351)Aina Niemetz
This renames everything but GitHub links and build system related macros. Switching the build system to cvc5 will be the last step in the renaming process.
2021-04-12Refactor and update copyright headers. (#6316)Aina Niemetz
2021-04-09Rename CVC4_ macros to CVC5_. (#6327)Aina Niemetz
2021-04-07cmake: Do not always regenerate cvc4kinds.{pxi,pxd}. (#6300)Mathias Preiner
Only regenerate files if dependencies changed. This avoids unnecessary rebuilds of the Cython code.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback