summaryrefslogtreecommitdiff
path: root/test/unit/api
AgeCommit message (Collapse)Author
2019-10-18Update overflow check to handle negative numbers (#3396)makaimann
2019-10-08New C++ API: Term: Add missing checks for null. (#3364)Aina Niemetz
Co-Authored-By: Andres Noetzli <andres.noetzli@gmail.com>
2019-10-07New C++ API: Add Term::getId(). (#3360)Aina Niemetz
+ use explicit types in NodeValue + add unit test for Term::isParameterized() Co-Authored-By: makaimann <makaim@stanford.edu>
2019-09-18Add support for creating constant arrays to the new C++ API (#3296)makaimann
* Add support for constant arrays to new C++ API * Fix macro usage in unit test * Add not null check * Add test for null term * Formatting
2019-08-19New C++ API: Add checks for Solver::checkValid and ↵Aina Niemetz
Solver::checkValidAssuming. (#3197)
2019-08-13New C++ API: Add checks and tests for Solver::simplify. (#3170)Aina Niemetz
2019-08-13New C++ API: Fix test names of solver_black unit test. (#3170)Aina Niemetz
2019-08-11New C++ API: Add templated getIndices method for OpTerm (#3073)makaimann
* Implement templated getIndices method for OpTerm * Add getIndices unit tests * Update src/api/cvc4cpp.cpp Co-Authored-By: Aina Niemetz <aina.niemetz@gmail.com> * Update src/api/cvc4cpp.cpp Co-Authored-By: Aina Niemetz <aina.niemetz@gmail.com> * Add comment about DIVISIBLE_OP * Update test/unit/api/opterm_black.h Co-Authored-By: Aina Niemetz <aina.niemetz@gmail.com> * Update test/unit/api/opterm_black.h Co-Authored-By: Aina Niemetz <aina.niemetz@gmail.com> * Update test/unit/api/opterm_black.h Co-Authored-By: Aina Niemetz <aina.niemetz@gmail.com> * Update test/unit/api/opterm_black.h Co-Authored-By: Aina Niemetz <aina.niemetz@gmail.com> * Add exception checks to other unit tests (instead of having its own function) * Fix unit test names in opterm_black.h * Add description to docstring for getIndices * Formatting * Clang format older commits * Use '-' in docstring list to match other docstrings * Support creating DIVISIBLE_OP with a string (for arbitrary precision integers) * Move mkOpTerm(DIVISIBLE_OP, <str>) test to solver_black.h * Fix pointer access * Replace switch statement with if statement * Guard string input for CVC4::Integer in mkOpTerm for consistency on GMP/CLN back-end
2019-08-07New C++ API: Add checks and tests for push/pop. (#3121)Aina Niemetz
2019-06-21Fix and simplify handling of --force-logic (#3062)Andres Noetzli
The `--force-logic` command line argument can be used to override a logic specified in an input file or to set a logic when none is given. Before this commit, both the `SmtEngine` and the parser were aware of that argument. However, there were two issues if an input file didn't specify a logic but `--force-logic` was used: - Upon parsing `--force-logic`, the `SmtEngine` was informed about it and set the logic to the forced logic. Then, the parser detected that there was no `set-logic` command, so it set the logic to `ALL` and emitted a corresponding warning. Finally, `SmtEngine::setDefaults()` detected that `forceLogic` was set by the user and changed the logic back to the forced logic. The warning was confusing and setting the logic multiple times was not elegant. - For eager bit-blasting, the logic was checked before resetting the logic to the forced logic, so it would emit an error that eager bit-blasting couldn't be used with the logic (which was `ALL` at that point of the execution). This was a problem in the competition because our runscript parses the `set-logic` command to decide on the appropriate arguments to use and passes the logic to CVC4 via `--force-logic`. This commit moves the handling of `--force-logic` entirely into the parser. The rationale for that is that this is not an API-level issue (if you use the API you simply set the logic you want, forcing a different logic in addition doesn't make sense) and simplifies the handling of the option (no listeners need to be installed and the logic is set only once). This commit also removes the option to set the logic via `(set-option :cvc4-logic ...)` because it complicates matters (e.g. which method of setting the logic takes precedence?). For the CVC and the TPTP languages the commit creates a command to set the logic in `SmtEngine` when the logic is forced in the parser instead of relying on `SmtEngine` to figure it out itself.
2019-04-25New C++ API: Clean up API: mkVar vs mkConst vs mkBoundVar. (#2977)Aina Niemetz
This cleans up naming of API functions to create first-order constants and variables. mkVar -> mkConst mkBoundVar -> mkVar declareConst is redundant (= mkConst) and thus, in an effort to avoid redundancy, removed. Note that we want to avoid redundancy in order to reduce code duplication and maintenance overhead (we do not allow nested API calls, since this is problematic when tracing API calls).
2019-03-26Update copyright headers.Aina Niemetz
2019-03-23BV: Fix typerules for rotate operators. (#2895)Aina Niemetz
2019-03-18New C++: Remove redundant mkBoundVar function.Aina Niemetz
2019-03-18New C++: Remove redundant mkVar function.Aina Niemetz
s
2019-03-18BitVector: Allow base 10 in constructor. (#2870)Aina Niemetz
2019-02-13New C++ API: Remove redundant declareFun function. (#2837)Aina Niemetz
2019-02-12New C++ API: Remove redundant mkTerm function. (#2836)Aina Niemetz
2019-02-11New C++ API: Unit tests for declare* functions. (#2831)Aina Niemetz
2019-01-29New C++ API: Fix checks for mkTerm. (#2820)Aina Niemetz
This required fixing the OpTerm handling for mkTerm functions in the API.
2019-01-11New C++ API: Add unit tests for setInfo, setLogic, setOption. (#2782)Aina Niemetz
2019-01-10New C++ API: Get rid of mkConst functions (simplify API). (#2783)Aina Niemetz
2019-01-07New C++ API: Add missing getType() calls to kick off type checking. (#2773)Aina Niemetz
2019-01-04C++ API: Fix OOB read in unit test (#2774)Andres Noetzli
There were two typos in the unit tests that caused OOB accesses. Instead of doing `d_solver.mkConst(CONST_BITVECTOR, std::string("101"), 6)`, the closing parenthesis was in the wrong place resulting in `std::string("101", 6)`. The second argument to `std::string(const char*, size_t)` says how many characters to copy and results in undefined behavior if the number is greater than the length of the string, thus the OOB access. The commit fixes the typo and removes one of the tests because it should not actually fail (16 is an accepted base).
2019-01-03API/Smt2 parser: refactor termAtomic (#2674)Andres Noetzli
2019-01-03C++ API: Reintroduce zero-value mkBitVector method (#2770)Andres Noetzli
PR #2764 removed `Solver::mkBitVector(uint32_t)` (returns a bit-vector of a given size with value zero), which made the build fail when SymFPU was enabled because solver_black used it for SymFPU-enabled builds. This commit simply adds a zero default argument to `mkBitVector(uint32_t, uint64_t)` to allow users to create zero-valued bit-vectors without explicitly specifying the value again. Additionally, the commit replaces the use of the `CVC4_USE_SYMFPU` macro by a call to `Configuration::isBuiltWithSymFPU()`, making sure that we can catch compile-time errors regardless of configuration. Finally, `Solver::mkConst(Kind, uint32_t, uint32_t, Term)` now checks whether CVC4 has been compiled with SymFPU when creating a `CONST_FLOATINGPOINT` and throws an exception otherwise (solver_black has been updated correspondingly).
2019-01-02New C++ API: Add tests for mk-functions in solver object. (#2764)Aina Niemetz
2018-12-17New C++ API: Add tests for term object. (#2755)Aina Niemetz
2018-12-14New C++ API: Add tests for opterm object. (#2756)Aina Niemetz
2018-12-13New C++ API: Add tests for sort functions of solver object. (#2752)Aina Niemetz
2018-12-12API: Add simple empty/sigma regexp unit tests (#2746)Andres Noetzli
2018-11-05New C++ API: Split unit tests. (#2688)Aina Niemetz
2018-11-05API: Fix assignment operators (#2680)Andres Noetzli
The assignment operators of `Term`, `OpTerm`, and `Sort` currently have an issue. The operators dereference their `shared_ptr` member and assign the corresponding member of the other object. This is problematic because if we have for example two `Term`s pointing to the same `Expr`, then the assignment changes both `Term`s even though we only assign to one, which is not what we want (see the unit test in this commit for a concrete example of the desired behavior). To fix the issue, the assignment operator should just copy the pointer of the other object. This happens to be the behavior of the default assignment operator, so this commit simply removes the overloaded assignment operators. Testing: I did `make check` with an ASAN build and no errors other than the one fixed in #2607 were reported.
2018-10-04New C++ API: Add checks for Sorts. (#2519)Aina Niemetz
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback