summaryrefslogtreecommitdiff
path: root/examples
AgeCommit message (Collapse)Author
2021-08-30Add API function to obtain information about a single option (#6980)Gereon Kremer
This PR adds api::Solver::getOptionInfo() that returns information about a single option, including its name, aliases, current and default value and its domain.
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-19Make the python quickstart example run using ctest (#7023)yoni206
2021-07-29Python quick start example (#6939)yoni206
This is a translation of quickstart.cpp to python.
2021-07-06Porting C++ API examples to SMT-LIB examples (#6789)Haniel Barbosa
SyGuS examples will come later.
2021-07-05Add doc page about transcendentals (#6755)Gereon Kremer
This PR adds a theory reference page for the transcendental extension.
2021-06-23docs: Add quickstart guide. (#6782)Aina Niemetz
2021-06-16Make symfpu a required dependency. (#6749)Aina Niemetz
2021-06-15CVC4 -> cvc5 in cpp API examples (#6746)Haniel Barbosa
2021-06-15An example for a quick start guide (#6686)yoni206
Co-authored-by: Aina Niemetz <aina.niemetz@gmail.com>
2021-06-09docs: Migrate sets and relations theory reference. (#6698)Aina Niemetz
This migrates page https://cvc4.github.io/sets-and-relations. It further adds the SMT2 version of examples/api/cpp/sets.cpp and adds test/regress/regress0/rels/relations-ops.smt2 as smtlib example for relations.
2021-05-27FP: Rename FLOATINGPOINT_PLUS to FLOATINGPOINT_ADD. (#6628)Aina Niemetz
This is to make it consistent with the name of the SMT-LIB operator (fp.add).
2021-05-26Add more examples to the documentation (#6569)Gereon Kremer
This PR adds (most of) the existing examples to the documentation, and does some other minor updates on the documentation. Some details: - for consistency, all cpp examples are moved from examples/api to examples/api/cpp - add capabilities for SMT-LIB examples, and two simple smt2 examples - more docs/examples/*.rst files - two new documentation categories: installation (how to obtain, compile and install cvc5) and binary (about the cvc5 binary)
2021-05-21BV: Rename BITVECTOR_PLUS to BITVECTOR_ADD. (#6589)Aina Niemetz
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-14Stop using the solver for printing sygus synthesis solutions. (#6530)Abdalrhman Mohamed
This PR uses custom methods for printing the synthesis solutions instead of Solver::printSynthSolution, which is going to be removed by #6521.
2021-05-14Add getId function to python API (#6523)Alex Ozdemir
(Z3 exposes it to facilitate custom hashes)
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-20Remove support for CVC3 language. (#6369)Aina Niemetz
2021-04-12Refactor and update copyright headers. (#6316)Aina Niemetz
2021-04-09Rename CVC4_ macros to CVC5_. (#6327)Aina Niemetz
2021-04-05New C++ Api: Rename and move headers. (#6292)Aina Niemetz
2021-04-01Delete hashsmt example. (#6263)Aina Niemetz
This example does not serve the purpose of documenting how to use the new API. It uses Command, which is not available via the API, and it's not worth the effort to migrate it.
2021-04-01Rename namespace CVC5 to cvc5. (#6258)Aina Niemetz
2021-03-31Rename namespace CVC4 to CVC5. (#6249)Aina Niemetz
2021-03-20Generate cvc/Kind.java for the java API (#6143)mudathirmahgoub
PR changes: Refactor python/genkinds.py by separating parsing from file generation. Add java/genkinds.py to generate file Kind.java. Enable java API in ./configure.sh with "under development" warning.
2021-03-09Update copyright headers to 2021. (#6081)Aina Niemetz
2020-12-02Update copyright headers.Aina Niemetz
2020-11-20Updates to API in preparation for using symbol manager for model (#5481)Andrew Reynolds
printModel no longer makes sense if the list of declared symbols is managed outside the solver. Also, mkConst needs a variant to distinguish a provided name of "" vs. a name that is not provided.
2020-11-05Remove mkSingleton from the API (#5366)mudathirmahgoub
This PR removes mkSingleton from the API after removing subtyping from set theory and introducing mkInteger to the API. Instead the user needs to use Solver::mkTerm(api::SINGLETON, element) where element has the right type. Internally NodeManager::mkSingleton(type, element) is still needed to determine the type of the set. Other changes: Renamed Solver::mkTerm(Op op, .. functions to Solver::mkTermFromOp(Op op, ... Added mkTermFromOp to the python API
2020-10-29Add mkInteger to the API (#5274)mudathirmahgoub
This PR adds mkInteger to the API and update mkReal to ensure that the returned term has real sort. The parsers are modified to parse numbers like "0" "5" as integers and "0.0" and "15.0" as reals. This means subtyping is effectively eliminated from all theories except arithmetic. Other changes: Term::isValue is removed which was introduced to support parsing for constant arrays. It is no longer needed after this PR. Benchmarks are updated to match the changes in the parsers Co-authored-by: Andrew Reynolds andrew-reynolds@uiowa.edu
2020-10-04Remove subtyping for sets theory (#5179)mudathirmahgoub
This PR removes subtyping for sets theory due to issues like #4502, #4507 and #4631. Changes: Add SingletonOp for singletons to specify the type of the single element in the set. Add mkSingleton to the solver to enable the user to pass the sort of the single element. Update smt and cvc parsers to use mkSingleton when the kind is SINGLETON
2020-09-22Update copyright header script to support CMake and Python files (#5067)Mathias Preiner
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-01[API] Fix Python Examples (#4943)Andres Noetzli
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-08-03Examples for using sygus python api (#4822)yoni206
This PR adds examples for using the sygus python api. The examples are obtained from the examples of the cpp sygus api.
2020-07-30Python API: Add support for sequences (#4757)Andres Noetzli
Commit 9678f58a7fedab4fc061761c58382f4023686108 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-07Increase the minimum version of CMake due to the use of 'APPEND' with ↵Andrew V. Jones
strings (#4702) Signed-off-by: Andrew V. Jones <andrew.jones@vector.com>
2020-06-29Make ExprManager constructor private (#4669)Andres Noetzli
This commit makes the ExprManager constructor private and updates the initialization of subsolvers, unit tests, and system tests accordingly. This is a step towards making options part of SmtEngine instead of NodeManager.
2020-06-23New C++ API: Remove examples for old API. (#4650)Aina Niemetz
This removes obsolete examples for the old API in preparation of making the old API private. Examples for the new API are renamed from *-new.cpp to *.cpp.
2020-06-19Cleanup examples (#4634)Andres Noetzli
This commit removes examples from unsupported programming languages and fixes a compilation issue in the sets-translate example. The issue arised due to changes to the `DefineFunctionCommand` in commit fd60da4a22f02f6f5b82cef3585240c1b33595e9 and wasn't detected by our CI because the sets-translate example requires Boost.
2020-06-18Improve memory management in Java bindings (#4629)Andres Noetzli
Fixes #2846. One of the challenges of the Java bindings is that the garbage collector can delete unused objects at any time in any order. This is an issue with CVC4's API because we require all `Expr`s to be deleted before the corresponding `ExprManager`. In the past, we were using `NewGlobalRef`/`DeleteGlobalRef` on the wrapper object of `ExprManager`. The problem is that we can have multiple instances of the wrapper that internally all refer to the same `ExprManager`. This commit implements a different approach where the Java wrappers hold an explicit reference to the `ExprManager`. The commit also removes some unused or unimportant API bits from the bindings.
2020-06-16Update copyright headers.Aina Niemetz
2020-06-09Language bindings: Enable catching of exceptions (#2813)Andres Noetzli
Fixes #2810. SWIG relies on throw specifiers to determine which exceptions a method can throw. The wrappers generated by SWIG catch those C++ exceptions and turn them into exceptions for the target language. However, we have removed throw specifiers because they have been deprecated in C++11, so SWIG did not know about any of our exceptions. This commit fixes the issue using the %catches directive, declaring that all methods may throw a CVC4::Exception or a general exception. Note: This means that users of the language bindings will just receive a general CVC4::Exception instead of more specific exceptions like TypeExceptions. Given that we are planning to have a single exception type for the new CVC4 API, this seemed like a natural choice. Additionally, the commit (significantly) simplifies the mapping of C++ to Java exceptions and fixes an issue with Python exceptions not inheriting from BaseException. Finally, the commit adds API examples for Java and Python, which demonstrate catching exceptions, and adds Python examples as tests in our build system.
2020-06-08Fix Java target and Relations example (#4583)Andres Noetzli
Currently, our CVC4Config file is never including the CVC4 Java targets because of a typo in `cmake/CVC4Config.cmake.in`. For this reason, our build system for the examples would never actually build the examples. Fixing this issue brought up another issue in our Relations Java example that was using an outdated `System.loadLibrary()` call. This commit fixes the typo and the example. Note: Most changes in `Relations.java` were caused by ClangFormat.
2020-06-04Wrap Result in Python API (#4473)makaimann
This PR would change the Python API to wrap the C++ Result class instead of translating it to a pure Python class. This is more convenient because there are several possibilities other than sat/unsat/unknown. Furthermore, this PR updates the bitvectors.py example which had an incorrect function name "checkEntailment" and adds a floating point example contributed by Eva Darulova.
2020-06-03New C++ Api: First batch of API guards. (#4557)Aina Niemetz
This is the first batch of API guards, mainly extending existing guards in the Solver object with checks that Ops, Terms, Sorts, and datatype objects are associated to this solver object. This further changes how DatatypeConstructorDecl objects are created. Previously, they were not created via the Solver object (while DatatypeDecl was). Now, they are created via Solver::mkDatatypeConstructorDecl, consistent with how DatatypeDecl objects are created.
2020-05-22Fix mistakes in sygus API comments. (#4520)Abdalrhman Mohamed
2020-05-21Make Grammar reusable. (#4506)Abdalrhman Mohamed
This PR modifies the Grammar implementation to make it reusable (i.e., can be copied or passed multiple times to synthFun/synthInv) with the catch that it becomes read-only after the first use.
2020-04-20Introduce a public interface for Sygus commands. (#4204)Abdalrhman Mohamed
This commit addresses issue #38 in cvc4-projects by introducing public API for Sygus commands. It also includes two simple examples of how to use the API.
2020-04-15Change option names --default-dag-thresh and --default-expr-depth (#4309)Andrew Reynolds
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback