summaryrefslogtreecommitdiff
path: root/test/unit
AgeCommit message (Collapse)Author
2018-06-15String rewriter: Add length preserving rewriteAndres Noetzli
This commit adds methods to the string rewriter to transform a string into a normalized string with the same length (but not the same content necessarily). One of the use cases is normalizing the string before the start index in an indexof operation. For example: ``` str.indexof(str.++("ABCD", x), y, 3) ---> str.indexof(str.++("AAAD", x), y, 3) ``` In addition to the helper methods, this commit adds the indexof rewrite above.
2018-06-04Only enable transcendentals if logic is N[I]RAT (#2052)Andres Noetzli
2018-04-10Refactored BVGauss preprocessing pass. (#1766)Aina Niemetz
2018-04-02Reorganize bitblaster code. (#1695)Mathias Preiner
This splits bitblaster_template.h into the separate header files {aig,eager,lazy}_bitblaster.h and bitblaster.h (the template class TBitblaster). All the bitblaster related code is moved into the sub-directory bitblast/.
2018-03-26Better normalization of string concatenation (#1719)Andres Noetzli
2018-03-26 Add reasoning for inequalities in str rewriter (#1713)Andres Noetzli
2018-03-26Rewrites for substr of strings of length one (#1712)Andres Noetzli
This commit adds a rewrite for substrings of strings of length one to the empty string if it can be shown that it is not possible that the start position and the length are both greater than zero: ``` (str.substr "A" x y) --> "" if x = 0 |= 0 >= y ``` The commit introduces a set of functions to check such entailments with assumptions.
2018-03-08Fix Travis for unit test compilation errors. (#1651)Mathias Preiner
make units does not fail if we have compile error for a unit test, however, make check does. -Wsuggest-override is now explicitly disabled for unit tests since CxxTest does not add override keywords to the generated source code and thus get a lot of compiler warnings. Further, this fixes some issues introduced with #1647 due to make units not failing on Travis and fixes the nightly builds.
2018-03-06Remove printf from output utilities (#1629)Andres Noetzli
This commit removes the unused printf functions from the output utilities. It also adds `const` keywords where possible. Finally, it removes overloaded `const char*` functions if the same function existed for `const std::string&` and the `const char*` version was only casting the `const char*` to an `std::string`. This conversion happens implicitly, so the `const char*` version is not needed.
2018-02-23Add unit tests for BitVector, minor BV rewrite fix (#1622)Andres Noetzli
This commit adds unit tests for the BitVector class and adds some additional argument checks. Additionally, it fixes a minor issue in the ZeroExtendUltConst rule if the zero_extend was by 0 bits. In that case, the rule was calling BitVector::extract() with high < low.
2018-02-15Fix context memory manager unit test (#1609)Andres Noetzli
Commit 83f150c727f197c530d6f46a75b516eea52bed29 changed the flag that we use to determine whether to use the context memory manager or the debug version. However, the change was not reflected in the context memory manager unit test. This commit fixes the unit test to check the correct flag.
2018-02-14Quantifiers subdirectories (#1608)Andrew Reynolds
2018-02-09Renaming CHECK to CVC4_CHECK. This avoids name collisions with other popular ↵Tim King
assertion macros. This name is likely temporary while Assert() is deprecated. (#1590)
2018-02-08Updated copyrightAina Niemetz
2018-02-07Adds a new CHECK macro that abort()s on failure. (#1532)Tim King
2018-01-24Added unit tests for PLUS, NEG, NOT ICs for CBQI BV. (#1534)Aina Niemetz
2018-01-21Refactor and fix solveBvLit for CBQI BV. (#1526)Aina Niemetz
This refactors and simplifies solveBvLit() and fixes the following: - generate side conditions for BITVECTOR_NEG, BITVECTOR_NOT, BITVECTOR_PLUS, BITVECTOR_XOR over inequalities and disequality - fix CONCAT handling (generate side conditions rather then computing an inverse which was incorrect) - fix SIGN_EXTEND handling (same as with CONCATs)
2018-01-09Fix linearization for terms where the solve variable does not occur. (#1506)Mathias Preiner
2018-01-05Add UGT/SGT side conditions for AND/OR + other fixes. (#1481)Mathias Preiner
2018-01-02Add side conditions for inequalities over BITVECTOR_UDIV for CBQI BV. (#1464)Aina Niemetz
We now can handle all cases of (in|dis)equality over BITVECTOR_UREM. This also simplifies some of the side conditions for equality.
2018-01-02Fix handling for UGT/SGT. (#1467)Mathias Preiner
Previously, we only handled the case x s < t. With this fix, we now get BITVECTOR_[SU]GT for litk if we encounter a literal t < x s.
2017-12-29Add side conditions for inequalities over BITVECTOR_UREM for CBQI BV. (#1460)Aina Niemetz
We now can handle all cases of (in|dis)equality over UREM. Previously, we could not handle equality for index=0 and had to rewrite x % s = t to x - x / s * s. Since we can now handle this case, we do not apply this rewriting anymore.
2017-12-28Fix unit tests for ineq for CBQI BV. (#1456)Aina Niemetz
2017-12-28Add unit tests for side conditions for inequality for CBQI BV. (#1455)Aina Niemetz
2017-12-20Add explicit disequality handling when generating side condition for CBQI ↵Aina Niemetz
BV. (#1447) This refactors solveBvLit to support explicit handling of disequalities (and, in the next step, inequalities) when generating side conditions.
2017-12-13Add missing side conditions for SHL, LSHR, ASHR for CBQI BV. (#1441)Aina Niemetz
This adds side conditions for operators BITVECTOR_SHL, BITVECTOR_LSHR and BITVECTOR_ASHR for index = 1, i.e., s << x = t and s >> x = t. Previously, we treated these cases as non-invertible.
2017-12-08Add CEGQI BV linearization of additions and equalities over additions. (#1417)Mathias Preiner
Adds support for linearizing additions w.r.t. to a variable. For example, a * x + b + c * d * -x = e + x is rewritten to x * (a - c * d - 1) = e - b. This also adds an additional rewriting rule x * x = x --> x < 2.
2017-12-08Fixed side conditions for CBQI BV, added unit tests. (#1434)Aina Niemetz
This fixes the side conditions for BITVECTOR_UREM_TOTAL, BITVECTOR_UDIV_TOTAL, BITVECTOR_LSHR, BITVECTOR_ASHR, BITVECTOR_SHL. It refactors side condition generation for better readability and unit testing. It further adds unit tests for all side conditions we generate in order to check if they too weak or to restrictive (which may result in unsound behavior). This is achieved by checking the following two implications: not (exists x. s * x = t => SC) ... if sat, SC is too restrictive not (SC => exists x. s * x = t) ... if sat SC is too weak This simplifies to checking not (SC <=> exists x. s * x = t).
2017-12-06Remove CDChunkList (#1414)Andres Noetzli
2017-11-30Add debugging tools for ContextMemoryManager (#1407)Andres Noetzli
This commit adds two configuration options that help debugging memory issues with allocations in the ContextMemoryManager: --enable/disable-valgrind: This flag enables/disables Valgrind instrumentation of the ContextMemoryManager. Enabled by default for debug builds if the Valgrind headers are available. --enable/disable-context-memory-manager: This flag enables/disables the use of the ContextMemoryManager. If the flag is disableda dummy ContextMemoryManager is used that does single allocations instead of chunks. The flag is enabled by default.
2017-11-30Add Gaussian Elimination as a preprocessing pass for BV. (#1342)Aina Niemetz
This adds Gaussian Elimination as a preprocessing pass for BV. Gaussian Elimination is only applied if the given bit-width guarantees that no overflows can occur.
2017-11-15Adding garbage collection for Proof objects. (#1294)Tim King
2017-11-09Add modular arithmetic operators. (#1321)Aina Niemetz
This adds functions on Integers to compute modular addition, multiplication and inverse. This is required for the Gaussian Elimination preprocessing pass for BV.
2017-10-25Removing throw specifiers from OutputChannel and subclasses. (#1209)Tim King
2017-10-16Adds unit test that show Node and TNode work with for each loops. (#1230)Tim King
Extends test/unit/expr/node_black.h with tests that show Node and TNode can work with C++11 for each loops.
2017-10-04Add mkZero, mkOne and mkUmulo to bv utils. (#1200)Aina Niemetz
This adds several utility functions for the theory BV. Function mkUmulo encodes an unsigned multiplication overflow detection operation, which we need for CBQI BV. In the future, we will introduce a Umulo node kind (and a corresponding bit-blasting strategy based on the encoding implemented in mkUmulo).
2017-09-14Remove unhandled subtypes (#1098)Andrew Reynolds
* Remove unhandled subtypes, which consequently makes typing rules uniformly stricter based on weakening the subtype relation. Ensure coercions in the smt2 and cvc parser for Real decimal constants whose type is Integer. Ensure type annotations are computed during preRewrite to ensure rewriting (which does not preserve types) does not impact term construction for parametric datatypes. This fixes issue #1048 (we now give an type exception). * Update unit test for parametric datatypes to reflect new subtyping relation. * Remove deprecated test. * Make array construction for lambdas work with new subtype relations to handle lambdas like (lambda ((x Int) (y Int)) (ite (= x 0) 0.5 0.0)).
2017-08-21Change Bugzilla urls to Github issues.Mathias Preiner
2017-08-17Remove unused SubrangeBound(s) classes (#221)Andres Noetzli
As discussed in pull request #220, commit 360d6ee8d3cdd5ddb47c328043eaed3a107b8db1 mostly got rid of SubrangeBound(s). There were still a few mentions of it left in the code, most of them commented out. The occurrences in expr.i and expr_manager.i, however, created issues with the Python wrapper. This commit removes the SubrangeBound(s) implementation and other leftovers.
2017-07-26Use TEST_CPPFLAGS/TEST_CXXFLAGS to add path to CxxTest headers in ↵Mathias Preiner
configure.ac. (#200) CxxTest headers were included in test/unit/Makefile.am as -I@CXXTEST@. However, in configure.ac if CXXTEST was not set by the user, it was initially set to `dirname "$CXXTESTGEN"` while determining the path to the header files. If CXXTESTGEN pointed to /usr/bin and if the headers were found in /usr/include, CXXTEST was not reset, which led to CXXTEST being replaced by /usr/bin in test/unit/Makefile.am. As a consequence, the locale binary in /usr/bin got included instead of the locale header file.
2017-07-22Deprecating the unused convenience_node_builders.h (#203)Tim King
2017-07-20Moving from the gnu extensions for hash maps to the c++11 hash mapsTim King
* Replacing __gnu_cxx::hash_map with std::unordered_map. * Replacing __gnu_cxx::hash_set with std::unordered_set. * Replacing __gnu_cxx::hash with std::hash. * Adding missing includes.
2017-07-19Removing the unused CDAttribute. This makes CDHashMap::obliterate unused. ↵Tim King
Removing it as well.
2017-07-12Fix unit tests for subranges. Fix destructors for context objs in unit tests.ajreynol
2017-07-07Remove unused stacking_vector class (#185)Andres Noetzli
2017-07-07Update copyright headers.Mathias Preiner
2017-07-05Update unit test, news.ajreynol
2017-05-13Fix out-of-bounds access in testAndres Notzli
2017-05-12Make signal handlers saferAndres Notzli
As reported in bug 769, the signal handlers currently use unsafe functions such as dynamic memory allocations and fprintf. This commit fixes the issue by introducing functions for printing statistics in signal handlers (functions with the `safe` prefix). It also avoids copying statistics, which further avoids dynamic memory allocation. The safe printing of statistics has some limitations (it does not support SExprStats or printing CVC4::Result), which should not matter much in practice. Printing statistics in a non-signal handler is not affected by these changes as that uses a separate code path (the functions without the `safe` prefix). Additional changes: - Remove ListStat as it is not used anywhere - Add unit test for safe printing statistics
2017-03-02Eliminate Boolean term conversion. Generalizes removeITE pass to remove ↵ajreynol
Boolean terms, treats distinguished BOOLEAN_TERM_VARIABLE kind as theory literal. Fixes bugs 597, 604, 651, 652, 691, 694. Add regressions.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback