summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2021-06-02Move public wrapper functions out of options class (#6600)Gereon Kremer
This PR moves options wrapper functions out of the Options class. These wrapper functions are meant to be called by "external" code that should not access the options modules. This PR thereby significantly reduces the interface of the Options class.
2021-06-02Fix issues with double negation in circuit propagator (#6669)Gereon Kremer
This PR fixes a subtle issue with double negations when producing proofs in the circuit propagator. Adds the test case as a new regression, as well as some similar instances. Fixes cvc5/cvc5-projects#277.
2021-06-02Fix issues when poly is disabled (#6668)Gereon Kremer
Recent changes introduced issues when libpoly is disabled.
2021-06-02Make `Options::assign()` specializations free functions (#6648)Gereon Kremer
This PR removes the next two heavily specialized template functions. Both Options::assign() and Options::assignBool() are only used within options.cpp now and there is thus no reason to keep them in the public interface. Furthermore, we can just make them properly named functions instead of template functions.
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-01Use top-level substitutions in ITE simp (#6651)Andrew Reynolds
With this PR, we use the central top-level substitutions instance in the ITE simplification preprocessing pass. Previously the ITE simplification pass maintained its own copy of the substitutions. Since the top-level substitutions now are the authority on models, this led to model failures after this change: ac8cf53#diff-30677c5a1752b1d0e83ef25fd2cfb8949576ea42cf7821fe0ac00ebbd0122f8aL276. This PR corrects the issue. This is required for SMT-COMP.
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-31Remove Options::ref() (#6647)Gereon Kremer
This PR gets rid of the templated Options::ref() method (and all its specializations for every option).
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-31Compute model values for nested sequences in order (#6631)Andres Noetzli
Fixes #6337 (the other benchmarks in this issue are either solved correctly or time out after the changes in #6615) and fixes #5665. While computing the model for a nested equivalence class containing seq.unit, we were looking up the representative of the argument in (seq.unit (seq.unit j)) and the representative was simpliy (seq.unit j). However, we had assigned (seq.unit 0) to (seq.unit j) earlier. A second equivalence class of type (Seq (Seq Int)) and length 1 was later assigned (seq.unit (seq.unit 0)) and we didn't detect that (seq.unit (seq.unit j)) and (seq.unit (seq.unit 0)) have the same value. This was incorrect because we do not allow assigning the same value to different equivalence classes. In this case, it led to one of the assertions being false. This commit fixes the issues in two ways: it ensures that types are processed in ascending order of nesting (e.g., (Seq Int) terms are processed before (Seq (Seq Int)) terms) and it changes the procedure to look up the representative in the model instead of the theory state to take into account the model values assigned to the elements of sequences. cc @yoni206
2021-05-29Remove `Options::set()` method (#6556)Gereon Kremer
This PR gets rid of the Options::set() method, replacing it by direct access to the options data. This method was only used internally and did nothing except for resolving the options data from the option tag type via template specializations (via ref()), which is no longer necessary.
2021-05-28(Optimization) remove popObjective, add resetObjectives, rename ↵Ouyancheng
pushObjective => addObjective (#6634) In order for OptimizationSolver to support pushing & popping, we could remove popObjective because it might be difficult to handle cases like: optSlv->pushObjective(...); optSlv->push(); optSlv->popObjective(); optSlv->pop(); In this case we need to add back the popped objective... If push/pop is supported, pop does not bring back objectives if you resetObjective but it will revert the objs you add. just like assertFormula and resetAssertions.
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-28Add non-templated method to set option defaults (#6540)Gereon Kremer
This PR replaces the templated Options::setDefault() methods by new non-templated free functions options::{module}::setDefault{option}(). These methods should be used instead of the common if (!set by user) { set option value } pattern.
2021-05-27`STRINGS_CTN_DECOMPOSE`: Avoid multiple conflicts (#6632)Andres Noetzli
Fixes #5508. `STRINGS_CTN_DECOMPOSE` could be triggered multiple times by the same term, which resulted in an assertion failure. This commit returns immediately after the first conflict to avoid the assertion failure.
2021-05-27Fix regular expression aggressive elim (#6627)Andrew Reynolds
Fixes #6620, fixes #6622. Fixes cvc5/cvc5-projects#254. The benchmarks from the 2 issues timeout, a regression is added for the projects issue.
2021-05-27Fix `str.replace_re` and `str.replace_re_all` (#6615)Andres Noetzli
Fixes #6057. The reductions of `str.replace_re` and `str.replace_re_all` were not correctly enforcing that the operations replace the _first_ occurrence of some regular expression in a string. This commit fixes the issue by introducing a new operator `str.indexof_re(s, r, n)`, which, analoguously to `str.indexof`, returns the index of the first match of the regular expression `r` in `s`. The commit adds basic rewrites for evaluating the operator as well as its reduction. Additionally, it converts the reductions of `str.replace_re` and `str.replace_re_all` to use that new operator. This simplifies the reductions of the two operators and ensures that the semantics are consistent between the two.
2021-05-27Add Lexicographic + Pareto Optimizations (#6626)Ouyancheng
Lexicographic optimizations: Optimize the objectives one-by-one, in the order they are pushed. Pareto optimizations: Optimize the objectives to the extend that further optimization on any objective will worsen the other objective. Units tests are of course added. Lexicographic optimization is using iterative implementation, pretty similar to the naive box optimization.
2021-05-27Update proof namespaces (#6614)Andrew Reynolds
This removes namespace theory from proof utilities, and moves MethodId to its own file in src/proof/.
2021-05-27Fix CEGQI for datatypes with Boolean subfields (#6630)Andrew Reynolds
Fixes a solution soundness issue caused by allowing ineligible terms of kind BOOLEAN_TERM_VARIABLE to appear in instantiations. This also corrects the expected solution on a benchmark that had an incorrect status. Fixes #6603.
2021-05-27Fix spurious assertion for trivial abduction (#6629)Andrew Reynolds
Fixes 2nd benchmark from #6605.
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-27Return `REWRITE_AGAIN` after rewriting bvcomp (#6624)Andres Noetzli
This commit fixes an assertion failure in the rewriter on some of the SMT-LIB QF_ABVFP benchmarks (the regression in this commit is the minified version of `non_incremental/QF_ABVFP/20170428-Liew-KLEE/imperial_gsl_benchmarks_statistics_klee.x86_64/query.14.smt2`). The problem was that after applying the `BvComp` rewrite, the bit-vector rewriter was returning `REWRITE_DONE` instead of `REWRITE_AGAIN`. The rewrite simplifies expressions of the form `bvcomp(t, c)` where `c` is a constant of bit-width 1. If `c` is zero, then the rewrite returns `bvnot(t)`. This node can potentially be rewritten further, e.g., if `t` is `bvnot(x)`. This commit fixes the response and adds the corresponding tests.
2021-05-27Add support for Box optimization (#6599)Ouyancheng
Add support for box optimization -- independently optimize each goal as if the other goals do not exist. Single minimize() / maximize() now maintains the pushed / popped context. Of course unit tests are here as well.
2021-05-27Enable new justification heuristic by default (#6613)Andrew Reynolds
This enables the new implementation of justification heuristic by default. Fixes #5454, fixes #5785. Fixes wishues 114, 115, 149, 160.
2021-05-26Use references instead of getter functions (#6597)Gereon Kremer
This PR follows a suggestions of @ajreynol to use public references instead of getter functions to access the individual option modules.
2021-05-26 More precise includes of `Node` constants (#6617)Andres Noetzli
We store constants, e.g., BitVector and Rational, in our node infrastructure. As a result, we were indirectly including some headers in almost all files, e.g., the GMP headers. This commit changes that by forward-declaring the classes for the constants. As a result, we have to include headers like util/rational.h explicitly when we use Rational but it saves about 3 minutes in compile time (CPU time). The commit changes RoundingMode from an enum to an enum class such that it can be forward declared.
2021-05-25Replace deprecated calls to `std::allocator` (#6606)Andres Noetzli
Fixes #6453. This commit replaces all calls to std::allocator with calls to std::allocator_traits. Strictly speaking, allocate() and deallocate() are not deprecated but the commit replaces them for uniformity.
2021-05-25[Unit tests] Fix path of Java bindings (#6616)Andres Noetzli
Currently, when configuring cvc5 with Java bindings, CMake complains about `get_filename_component(CVC5_JNI_PATH ${CVC5_JAR_PATH} DIRECTORY)` not using the correct number of arguments in the Java unit tests. The issue is that `${CVC5_JAR_PATH}` is empty. The value of `${CVC5_JAR_PATH}` was computed in the Java API bindings but then not shared with the rest of the build system. Because `${CVC5_JAR_PATH}` is not used anywhere else, this commit moves the computation of `${CVC5_JAR_PATH}` to the unit tests. The commit also ensures that the API subdirectories are processed before the test subdirectories.
2021-05-24Fix non-fixed length case in re-elim (#6612)Andrew Reynolds
Fixes followup issues from #6604.
2021-05-24Implementation of the new justification heuristic (#6465)Andrew Reynolds
This adds the new implementation of the justification heuristic. It does not enable this strategy yet. A followup PR will activate this strategy within DecisionEngine.
2021-05-24Move proof utilities to src/proof/ (#6611)Andrew Reynolds
This moves all generic proof utilites from src/expr/ and src/theory/ to src/proof/. It also changes the include for term conversion proof generator to conv_proof_generator in preparation to rename this utility on a followup PR (to avoid confusion with the use of "Term").
2021-05-24Fix re-elim length requirement for symbolic RE memberships (#6609)Andrew Reynolds
Fixes #6604. Previously, re-elim was solution unsound for cases where the LHS and a component of the RHS were both empty. This ensures a length requirement is given for the LHS to ensure proper containment.
2021-05-24Fix instance of no rewrite in extended rewriter (#6610)Andrew Reynolds
Fixes #6545. An assertion failure was being raised indicating that we were reporting a rewrite that was not changing the original term.
2021-05-24Better formalization of regular expression unfolding skolems (#6602)Andrew Reynolds
This replaces our previous formalization of RE unfolding skolems with a more explicit one that is amenable to external proof conversion. It adds a few associated utility methods to SkolemManager required for LFSC proof conversion for RE_UNFOLD_POS. It also changes the order of equalities in the RE_UNFOLD_POS rule, which simplifies LFSC proof checking.
2021-05-21Fix tests of unsat cores (#6593)Andrew Reynolds
This updates all regressions that pass check-unsat-cores to enable check-unsat-cores. This includes any incremental benchmark, which was disabled in run_regression.py previously. It adds --no-check-unsat-cores to a few corner benchmarks that were previously disabled based on --incremental. It also reverts a change to when proofs are disabled: options like sygus-inference should not permit proofs (or unsat cores).
2021-05-21Fix and refactor relevant domain (#6528)Andrew Reynolds
In a handcrafted case, one can make the body of quantified formula another quantified formula when special attributes are used. The relevant domain utility was not robust to this case, leading to instantiations with free variables. This fixes the issue and also updates its style to use a term context stack, which also avoids a tree traversal of the bodies of quantified formulas in this utility. Fixes #6476. The benchmark from that issue now times out.
2021-05-21Formalize shared selectors as skolem functions (#6591)Andrew Reynolds
This is work towards properly printing shared selectors in external proofs.
2021-05-21Minor simplification to boolean proof checker (#6590)Andrew Reynolds
2021-05-21(proof-new) Minor documentation sync (#6592)Andrew Reynolds
2021-05-21Add utility to get all types occurring in a term (#6588)Andrew Reynolds
Required for external proof conversions.
2021-05-21Update to sygus standard output for check-synth responses (#6521)Andrew Reynolds
This PR does two things: (1) It eliminates the ad-hoc implementation of printSynthSolutions and removes it from the API. Now, printing response to a check-synth command is done in a more standard way, using the API + symbol manager. This is analogous to recent refactoring to get-model. (2) It updates cvc5's output in response to check-synth to be compliant with the upcoming sygus 2.1 standard. The standard has changed slightly: responses to check-synth are now closed in parentheses, mirroring the smt2 response to get-model. It also removes the unused command GetSynthSolutionCommand.
2021-05-21Support braced-init-lists with `mkNode()` (#6580)Andres Noetzli
This commit adds support for braced-init-lists in calls to `mkNode()`, e.g., `mkNode(REGEXP_EMPTY, {})`. Previously, such a call would result in a node of kind `REGEXP_EMPTY` with a single null node as a child because the compiler chose the `mkNode(Kind kind, TNode child1)` variant and converted `{}` to a node using the default constructor. This commit adds an overload of `mkNode()` that takes an `initializer_list<TNode>` to allow this use case. It also adds a `mkNode()` overload with zero children for convenience and removes the 4- and 5-children variants because they saw little use. Finally, it makes the default constructor of `NodeTemplate` explicit to avoid accidental conversions.
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-21Move option names out of struct (#6554)Gereon Kremer
This PR moves the option names out of the option struct (which will be removed) to free constexpr string constants.
2021-05-21BV: Rename BITVECTOR_PLUS to BITVECTOR_ADD. (#6589)Aina Niemetz
2021-05-20Properly initialize. (#6586)Gereon Kremer
This PR fixes a missing initialization that lead to a valgrind warning.
2021-05-20Remove old unsat cores (#6581)Haniel Barbosa
This commit removes the remaining old proof code and the code to produce unsat cores based on it.
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
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback