summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2021-07-09Fix sets cardinality inference involving equivalent parents (#6855)Andrew Reynolds
This fixes an unsoundness issue in the sets + cardinality solver. One rule of this solver applies in sets when two parents of a child of a cardinality graph are equal, in which case we know that child or one of its siblings must be equal to the opposite parent. For example, this rule tells us that: if T = (union T S), then (intersect T S) = S. The explanation of this rule could consider the representative term of one the parents instead of the term itself say (union T S) is representative T, giving the unsound inference: if (union T S) = (union T S), then (intersect T S) = S. This ensures we use the original terms. This PR also does some minor cleanup.
2021-07-08Disable ordering heuristic for justification by default (#6848)Andrew Reynolds
2021-07-07[unsat cores] Adding regressions from #4971 (#6852)Haniel Barbosa
Adds remaining regressions from issue #4791, which we can handle with the different new unsat-core modes. Note that issue4971-1.smt2 requires the sat-proof mode for unsat cores.
2021-07-07Rename operator pow2 to int.pow2. (#6849)Aina Niemetz
This name is the name of the symbol we parse. Internally, we still call it POW2. This is a fix for the problem that `pow2` may clash (and already does clash on SMT-LIB benchmarks) with user-defined symbols.
2021-07-07Fix regressions for competition build (#6846)Andrew Reynolds
Fixes one of the issues in the nightlies.
2021-07-06Integrate Lazard into CAD module (#6812)Gereon Kremer
This PR adds two new command line options that govern how the CAD module does projection and lifting, allowing to use the new Lazard evaluation. By default, we use McCallum with regular lifting which does not require CoCoA. Additionally, this PR adds a bunch of unit tests for the CAD module.
2021-07-05[Strings] Fix incorrect rewrite (#6837)Andres Noetzli
Fixes #6834. There were two cases in our extended rewriter for string equalities that were modifying the node without returning and without updating information computed from the original node. This mismatch led to incorrect rewrites. This commit fixes the issue by adding a flag to returnRewrite() that determines whether node that was an equality before and after the rewrite should be rewritten again with the extended rewriter. We generally do not do that (we'd run in danger of rewriting equality nodes with the extended rewriter even though we shouldn't) but for the rewrites that were previously continuing to rewrite the node, we set this flag and return. This ensures that we do not have an issue with information being out of date. The commit additionally fixes an issue where we would apply the rewrite STR_EQ_UNIFY even though the node hadn't changed.
2021-07-03Fix performance of string regression (#6832)Andres Noetzli
Regression cmu-dis-0707-3.smt2 has been timing out when using an ASan build after commit a4f38d6. Before that commit --strings-exp implicitly enabled --fmf-bound. After the commit, the solver was supposed to apply the same reasoning but only to interal quantifiers and without enabling --fmf-bound. However, the commit missed some options checks that now also have to check whether --strings-exp is enabled. This commit updates those option checks. With this fix, we get a slightly different value for bug590.smt2 after replying unknown. This commit updates the regression to be more lenient with the value returned.
2021-07-03Add output tags -o, --output. (#6826)Mathias Preiner
Output tags are similar to debug/trace tags, but are always enabled (except for muzzled builds) to provide useful information for users. Available output tags can be queried via -o help/--output help and are specified in the base options module via enum values. Co-authored-by: Gereon Kremer <nafur42@gmail.com>
2021-07-02Fix bv assert input reset assertions (#6820)Mathias Preiner
If reset-assertions was called it will now reset the SAT solver and the CNF stream if clauses were permanently added to the SAT solver via option --bv-assert-input.
2021-07-02Fix rewriter for negative constant seq.nth (#6827)Andrew Reynolds
Fixes #6777.
2021-07-02Add reverse iterators to `Node`/`TNode` (#6825)Andres Noetzli
This feature is useful for example for succinctly inserting children of a node in the reverse order. To make this work, the commit fixes the declaration of `reference` in the `NodeValue::iterator`. The `std::reverse_iterator` adapter expects the `reference` type to match the return type of `operator*` in the corresponding iterator (as mandated by the standard). Despite its name, `reference` does not have to be a C++ reference. Note that we cannot actually make it a C++ reference because `NodeValue::iterator` wraps the `NodeValue*` in a `Node`/`TNode` in `operator*`.
2021-07-01Add recursive function definitions to subsolver in sygus (#6824)Andrew Reynolds
This passes recursive function definitions to the verification subsolver in sygus, with a default bounded limit of 3. This required improving the interface for setting up subsolvers by allowing custom options; the sygus solver statically computes an instance of the options that it uses in all calls. This allows us to solve non-PBE sygus problems with recursive function definitions. The PR adds an example.
2021-06-30Use SAT context level for --bv-assert-input instead of decision level. (#6758)Mathias Preiner
The decision level as previously implemented was not accurate since it did not consider the user context level. This resulted in facts being incorrectly recognized as input assertions, which happened for incremental benchmarks.
2021-06-30pow2: new test (#6819)yoni206
This PR adds a more "real life" unit test for the pow2 solver. Thanks @4tXJ7f for the help with the options.
2021-06-30Do not apply fmfBound to standard quantifiers when only stringsExp is ↵Andrew Reynolds
enabled (#6816) There are compelling use cases that combine strings/sequences and quantifiers. Prior to this PR, strings enabled "bounded integer" quantifier instantiation so that internally generated quantifiers for strings reductions are handled in a complete manner. However, this enabled bounded integer quantifier instantiation globally. This degrades performance for "unsat" on quantified formulas in general. After this PR, we do not enable bounded integer quantifier globally. Instead, we ensure that bounded integer quantification is applied to at least the internally generated quantified formulas; all other quantified formulas are handled as usual. Notice this required ensuring that all quantified formulas generated by strings are marked properly. It also required adding --fmf-bound to a few regressions that explicitly require it.
2021-06-30Fix pre vs. post-rewrite in proofs for theory preprocessor (#6801)Andrew Reynolds
This changes an annotation of a step of rewriting from "post" to "pre" in the theory preprocessor. Fixes #6754.
2021-06-30int-to-bv: correct model values (#6811)yoni206
the int-to-bv preprocessing pass produced wrong models. This PR fixes this in a similar fashion to other preprocessing passes, by adding a substitution to the preprocessing pass context. This requires moving the main translation function to be a class method, rather than a helper method in an empty namespace. Thanks to @alex-ozdemir for raising this issue and producing a triggering benchmark (added to regressions in this PR).
2021-06-28Rewrite POW to POW2 when the base is 2 (#6806)yoni206
This PR introduces a rewrite from (^ 2 t) to (pow2 t) in order to make use of the specialized pow2 solver. One regression that expects an error when t is not a constant is changed accordingly.
2021-06-28Rename internal string kinds to match API (#6797)Andrew Reynolds
This commit replaces (old) internal string kind names to match the API / smt2 standard names.
2021-06-25pow2 -- final changes (#6800)yoni206
This commit adds the remaining changes for a working and integrated `pow2` solver. In particular, it adds a rewrite and a lemma that identify `pow2(x)` with `0` whenever `x<0`. Regressions are added as well, including `pow2-native-0.smt2` that shows the semantics of `pow2` on negative values. The next steps are new rewrites and and more lemma schemas.
2021-06-24api: getRealValue: Fix printing of integer values. (#6795)Aina Niemetz
2021-06-24Fix linear arithmetic for duplicate lemmas in incremental (#6784)Andrew Reynolds
The linear arithmetic solver was not robust to cases where a duplicate lemma is emitted. This leads to non-linear arithmetic not being called to check at full effort, leading to potential model soundness issues. Fixes #6773.
2021-06-23[hol] Disable bound fmf when HOL (#6792)Haniel Barbosa
Fixes #6536
2021-06-23[regressions] Adding regression from #5371 (#6791)Haniel Barbosa
2021-06-23[parser] [hol] Fix parser check for allowing functions when HOL is enabled ↵Haniel Barbosa
(#6790) Fixes #6526
2021-06-22Avoid full normalization of lambdas in getValue (#6787)Andrew Reynolds
This ensures that we don't apply lambda rewriting, which involves array value normalization, to lambda terms returned by TheoryModel::getValue. This can significantly speed up our time to return function terms for getValue.
2021-06-22python api unit tests for Op (#6785)yoni206
Unit tests are translated from https://github.com/cvc5/cvc5/blob/master/test/unit/api/op_black.cpp to python. The only thing that is not faithfully translated is that the `cpp` tests expect the template function `[getIndices](https://github.com/cvc5/cvc5/blob/master/src/api/cpp/cvc5.h#L841)` to fail when an inappropriate type is given to it, while in the [`python` API](https://github.com/cvc5/cvc5/blob/90d19f7cdbaf41e389bdcbd099471f658a35ce98/src/api/python/cvc5.pxi#L343) this function is not a template, but just tries every supported type. For example, the following line is not translated: https://github.com/cvc5/cvc5/blob/90d19f7cdbaf41e389bdcbd099471f658a35ce98/test/unit/api/op_black.cpp#L206
2021-06-22Always check legal eliminations in quantified logics (#6720)Andrew Reynolds
Fixes #6699.
2021-06-22Fix type enumeration for non first-class sorts in FMF (#6719)Andrew Reynolds
Fixes #6690.
2021-06-22Python api unit tests for Result (#6763)yoni206
This PR translates the cpp API unit tests about results to python. The original cpp file is: https://github.com/cvc5/cvc5/blob/master/test/unit/api/result_black.cpp The translation made rise to one addition to the python API: The UnknownExplanation object from the cpp API was represented by a string in the python API. Now we have a more faithful representation, as an enum.
2021-06-21[Attributes] Remove parameter `context_dependent` (#6772)Andres Noetzli
After commit d70a63324c95210f1d78c2efc46395d2369d2e2b, context-dependent attributes have not been supported and, as a result, the template parameter `context_dependent` of `Attribute` has not been used. Context-dependent attributes also do not fit with our current design of sharing attributes across different solvers, so it is unlikely that we will add that feature back in the future. This commit removes the unused template parameter.
2021-06-21Fix model issues with --bitblast=eager. (#6753)Mathias Preiner
For model construction we only compute model values for relevant terms. The set of relevant terms is computed in https://github.com/cvc5/cvc5/blob/master/src/theory/model_manager_distributed.cpp#L58, which skips equalities by default because equalities are usually handled by the equality engine. When --bitblast=eager is enabled all assertions are wrapped into BITVECTOR_EAGER_ATOM nodes and passed to the BV solver, which results in equalities below BITVECTOR_EAGER_ATOM nodes not being handled by the equality engine but by the BV solver directly. These equalities, however, are skipped when computing the relevant terms and therefore the BV solver is not asked to compute model values for variables below these equalities. If --bitblast=eager is enabled the BV solver now additionally adds the variables encountered during bit-blasting to the relevant terms via computeRelevantTerms. Co-authored-by: Andres Noetzli <andres.noetzli@gmail.com>
2021-06-21Add Grammar.java to the java API (#6388)mudathirmahgoub
This commit adds Grammar.java GrammarTest.java and cvc5_Grammar.cpp to the java api.
2021-06-21Make CaDiCaL a required dependency. (#6761)Mathias Preiner
Since the new BV solver is enabled by default and uses CaDiCaL (and optionally CryptoMiniSat) we make CaDiCaL a required dependency.
2021-06-19Adding python API test part 5 (#6743)Ying Sheng
This commit (follow #6553) adds more functions and unit tests for python API. Subsequent PR will include additional missing functions and unit tests. 1. Adding getNullSort() and mkEmptyBag() functions. 2. Allowing mkOp() with a list of arguments (previously allowed at most 2). 3. Allowing mkString() with additional boolean argument useEscSequences. 4. Corresponding changes to the tests.
2021-06-18Make CnfStream::toCNF iterative (#6757)Mathias Preiner
This commit makes toCNF() iterative to avoid this issue. Note that the order in which nodes are visited and thus SatLiterals are created remains the same. Fixes #6111
2021-06-17Fix build without libpoly (#6759)Andres Noetzli
Commit f10087c3b347da6ef625a2ad92846551ad324d73 added new files that do not compile without libpoly. This commit excludes those files when building without libpoly. It also updates one of the regressions to ignore a warning about approximate values in the model.
2021-06-16Make symfpu a required dependency. (#6749)Aina Niemetz
2021-06-15[Optimization] Use Result in OptimizationResult (#6740)Ouyancheng
OptimizationResult now contains: - cvc5::Result - optimal value for objective - whether the objective is unbounded This gets benefit from cvc5::Result (e.g., we could get explanation for UNKNOWN) and it's slightly easier to integrate to the current API. Also refactors BV optimizer so that it uses switch statement (instead of if-then-else) to judge the checkSat results (I was planning to do this a long while ago)...
2021-06-15Remove public option wrappers (#6716)Gereon Kremer
This PR gets rid of almost all remaining public option wrappers. It does so by - making base, main and parser options public such that they can directly be used from the driver and the parser - moving incremental and the resource limiting options to base - moving dumping options to main After this PR, the only option wrapper left is becoming obsolete as well after (the follow-up of) #6697.
2021-06-11Better support for HOL parsing and set up (#6697)Haniel Barbosa
This commit adds a new parser option, --hol, which marks that HOL is being used. This option has the effect of prepending the problem's logic with "HO_", which teels the solver that the logic is higher order. The parser builder, base parser, and SMT2 and TPTP parsers are all updated to work with this new setting, as is the logic info class. For now this parser option is enabling the --uf-ho option for internal use, since for now higher-order solving relies it. In a future PR this dependency will be removed (since this information is already given to the SMT solver via the logic).
2021-06-11Remove support for lazy BV extended function reductions and inferences (#6728)Andrew Reynolds
solve-int-as-bv is now the preferred method for solving these benchmarks. Adds solve-int-as-bv to a regression that became slow in my previous commit.
2021-06-10Ensure bv2nat and int2bv are not rewritten when using solve-bv-as-int (#6725)Andrew Reynolds
This PR ensures we do not eagerly rewrite bv2nat and int2bv when using solve-bv-as-int. Instead they are rewritten during expandDefinitions (at the end of preprocessing). It also updates regressions that relied on lazy extended function reductions in the lazy solver to use solve-bv-as-int, and adds a missing case (INT_TO_BITVECTOR) in the solve-int-as-bv preprocessing pass. A followup PR will remove support for lazy extended function reductions for bv2nat / int2bv altogether.
2021-06-09Make `--solve-int-as-bv=X` robust to rewriting (#6722)Andres Noetzli
After commit 327a24508ed1d02a3fa233e680ffd0b30aa685a9, the int-to-bv preprocessing pass is getting rewritten terms. As a result, the terms can contain negative constants (instead of `(- c)`, i.e., `UMINUS` of a positive constant) and `NONLINEAR_MULT`. The commit adds support for those cases, does some minor cleanup, and adds regressions. The regressions should allow us to detect if/when the preprocessing pass breaks in the future.
2021-06-09Reorder ITE rewrites (#6723)Andres Noetzli
Fixes #6717. Commit 11c1fba added some new rewrites for ITE. Due to the new rewrites taking precedence over existing rewrites, it could happen that some of the previous rewrites did not apply anymore even though they would have further simplified the ITE. In the example from the issue, (ite c c true) was rewritten to (or (not T) T) instead of (ite T true true) and then true. The commit fixes the issue by moving rewrites resulting in conjunctions/disjunctions to the end.
2021-06-09[Optimization] support for push/pop (#6706)Ouyancheng
Use CDList for optimization objectives so that optimization solver supports push and pop (just use SmtEngine's push/pop). SmtEngine::resetAssertions will also clears the optimization objectives, so no need to have the reset objectives function.
2021-06-09Require statistics for regression (#6714)Gereon Kremer
This PR makes a new regression explicitly require statistics.
2021-06-08Fix for 2 dimensional dependent bounded quantifiers (#6710)Andrew Reynolds
This updates 2-dim dependent bounded quantifiers to not map constants to terms when computing ranges, when the type of the variable is closed enumerable. This is require to fix an incorrect model (possible solution unsoundness) issue in the reduction of str.indexof_re. Fixes the 1st, 4th and 5th benchmarks from #6653. Fixes #6635.
2021-06-08Fix statistics option handler (#6703)Gereon Kremer
This PR fixes a typo in the option handler for the statistics options, which lead to options not properly propagating.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback