25 Commits

Author SHA1 Message Date
Gereon Kremer
fe939c31bd Fix some issues with the Python API tests (#8746)
This PR addresses a few issues in the Python API:
    the implementation of defineFunsRec() lacked the call to the C++ function
    a bunch of tests for defineFunsRec() were missing
    the test for getInstantiations() was incorrectly named and thus not valled.
    add missing test for hashing of Sort
2022-05-10 17:47:52 +00:00
Mathias Preiner
d01e59c13b Update copyright headers for release 1.0 (#8539) 2022-04-05 20:38:57 +00:00
Andrew Reynolds
40910fb3c6 Remove variant of mkDatatypeDecl with one sort parameter (#8543)
Subsumed by the vector version.

Also marks more methods as experimetnal.
2022-04-02 19:21:46 +00:00
Aina Niemetz
5dcb750667 api: Rename get(Selector|Constructor)Term() to getTerm(). (#8537) 2022-04-02 18:57:50 +00:00
Gereon Kremer
a7779de22d Remove decorator from python API (#8505)
This PR removes the expand_list_arg decorator from the python API. It was used to allow calling a function f(x, *args) with a list as second argument and automatically expand the list into *args. While it merely allows for calling f(x, l) instead of f(x, *l), it adds considerable complexity to the code and documentation. Thus, following the Zen of python (have only one way to do it) we remove this decorator. This is also consistent with the pythonic API, were we made the same decision.
2022-04-01 16:58:00 +00:00
Mathias Preiner
467c95cffb api: Use std::optional for symbols in mk* functions. (#8495)
Makes all symbols in mk* functions optional.
2022-04-01 01:10:29 +00:00
Aina Niemetz
27fbec71ee Sort, TypeNode: Rename functions related to datatypes. (#8472) 2022-03-31 20:50:45 +00:00
Aina Niemetz
bf06678fee api: Add Sort::getUninterpretedSortConstructor(). (#8459)
This further introduces TypeNode::isInstantiatedUninterpretedSort().
2022-03-30 19:39:52 +00:00
Aina Niemetz
e7fe90e7b8 api: Add Sort::getInstantiatedParameters(). (#8445)
This adds a function to retrieve the sort arguments an instantiated
sort has been instantiated with. It further deletes
Sort::getDatatypeParamSorts() and
Sort::getUninterpretedSortParamSorts().
2022-03-29 21:36:12 +00:00
Aina Niemetz
4f57370210 api: Add Sort::isInstantiated(). (#8425)
This further removes Sort::isUinterpretedSortParameterized().
2022-03-29 01:37:13 +00:00
Aina Niemetz
748c884353 api: Rename *SortConstructor* to *UninterpretedSortConstructor*. (#8406) 2022-03-26 05:40:42 +00:00
Aina Niemetz
a94548b57c api: Remove Sort::isParametricDatatype(). (#8405)
Previously, Sort::isParametricDatatype() returned true for both
instantiated and non-instantiated parametric datatypes.

This deletes the method, instead one can check getDatatype().isParametric(). Parametric datatypes will be distinguished from instantiated parametric datatypes via a forthcoming method Sort::isInstantiated.

Co-authored-by: ajreynol <andrew.j.reynolds@gmail.com>
2022-03-25 22:43:35 +00:00
Aina Niemetz
e8ef445fe7 api: Remove Sort::isFirstClass(). (#8312) 2022-03-15 22:51:42 +00:00
Andrew Reynolds
2f1483e2e3 Remove unecessary methods from the API (#8260)
Removes checkEntailed from Solver.
Removes isEntailed, isNotEntailed, isEntailedUnknown from Result.
Removes isSubsortOf, isFunctionLike, getUninterpretedSortName, getSortConstructorName from Sort.

Updates examples and unit tests.
2022-03-14 18:29:30 +00:00
Alex Ozdemir
6388657820 Change name of Python API's package from pycvc5 to cvc5. (#7953)
In the process, I changed a CMake target name from pycvc5 to
cvc5_base_py_api. I could not change the target to cvc5, because that
name is taken.
2022-02-02 23:45:42 +00:00
Aina Niemetz
acba737109 api: Remove Sort::isComparableTo(). (#7903)
Since we do not support arithmetic subtyping on the API level anymore,
this function is obsolete. Consequently, this now requires that
replacement terms as arguments to Term::substitute() are of the same
sort as the replaced terms.
2022-01-10 19:27:04 +00:00
Aina Niemetz
94c5c54989 api: Add Sort::hasSymbol() and Sort::getSymbol(). (#7825) 2021-12-16 18:50:01 +00:00
Gereon Kremer
881464ade1 Turn kinds in python API into a proper Enum (#7686)
This PR does multiple things:
- the kinds are changed from custom objects to a proper enum.Enum class
  (including according changes to the cython code and the kind generation scripts)
- all examples and tests are modified to account for the change how to use kinds
  (Kind instead of kinds)
- add docstrings to the kind enum values
- add a custom documenter that properly renders enums via autodoc
- extend doxygen setup so that we can write comments as rst (allowing us to copy
  the documentation for kinds from the cpp api to the other apis)
2021-12-08 04:16:03 +00:00
Aina Niemetz
eea329d3e0 Reorganize test/unit/api directory. (#7612)
This moves .cpp files to directory test/unit/api/cpp and python files in
test/python/unit/api to test/unit/api/python.
2021-11-10 00:08:29 +00:00
makaimann
116114d927 Run python tests during make check (#5226)
If building with python bindings, check the pytest is installed, and adds a command to run pytest after the existing make check tests. If built without python bindings, it just uses a null command. Note: the current semantics are such that the pytest tests will not run if the ctest run fails (unless you pass the correct flag to make to continue --ignore-errors I believe). I can look into changing this semantics if that would be preferred.
2020-11-02 16:17:21 -08:00
mudathirmahgoub
cedeef257a Remove subtyping for sets (#5205)
Removed subtyping for sets in type_node.h

Fixes #4502, fixes #4631.
2020-10-05 19:49:32 -05:00
Mathias Preiner
e3cd4670a0 Update copyright header script to support CMake and Python files (#5067)
This PR updates the update-copyright.pl script to also update/add copyright headers to CMake specific files. It further fixes a small typo in the header.
2020-09-22 09:51:56 -07:00
Andres Noetzli
3830d80ce3 [API] Fix Python Examples (#4943)
When testing the API examples, Python examples were not included. This
commit changes that and fixes multiple minor issues that came up once
the tests were enabled:

- It adds `Solver::supportsFloatingPoint()` as an API method that
  returns whether CVC4 is configured to support floating-point numbers
  or not (this is useful for failing gracefully when floating-point
  support is not available, e.g. in the case of our floating-point
  example).
- It updates the `expections.py` example to use the new API.
- It fixes the `sygus-fun.py` example. The example was passing a _set_
  of non-terminals to `Solver::mkSygusGrammar()` but the order in which
  the non-terminals are passed in matters because the first non-terminal
  is considered to be the starting terminal. The commit also updates the
  documentation of that function.
- It fixes the Python API for datatypes. The `__getitem__` function had
  a typo and the `datatypes.py` example was crashing as a result.
2020-09-01 23:37:14 -07:00
Andres Noetzli
2ff7f9a5cd Python API: Add support for sequences (#4757)
Commit 9678f58a7f added front end support
for sequences. This commit extends that support to the Python API. It
also adds simple C++ and Python examples that demonstrate how the API
works for sequences.
2020-07-30 16:56:33 -07:00
makaimann
5cd6f0e5e9 Python Sort tests (#4639)
This commit ports over the sort_black tests to the pytest infrastructure to test the Python bindings. It also adds missing functionality that was revealed during the testing.
2020-06-29 14:28:17 -07:00