summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2020-03-31Fix fmf benchmark (#4193)Andrew Reynolds
Fixes regress1. This benchmark is too delicate in the current state.
2020-03-31Fix strange bound regression (#4192)Andrew Reynolds
Several things have happened with this regression lately, in chronological order: (1) Instantiations involving bounded set quantifiers were changed to use choice to represent symbolic instantiations, (2) fmf-bound was decoupled from finite-model-find (the latter is not enabled when the former is), (3) choice was set to be an "unevaluated" kind (in 0060de3). After (1) and (2), for the regression test/regress/regress1/fmf/fmf-strange-bounds.smt2, CVC4 was answering "sat" correctly but internally there was a source of incompleteness. In particular, a choice term was being generated in an instantiation that was later incorrectly evaluated, thus allowing CVC4 to skip an instantiation it shouldn't have. The recent commit of (3) resolved this issue, making it so that choice is not an evaluated kind. This meant the benchmark went "sat" -> "unknown". This PR fixes this issue by enabling --finite-model-find, which is now necessary to answer "sat". It also adds a further test quantifier that was used in debugging this issue. Fixes regress1.
2020-03-31Fixing regressions (#4189)Andrew Reynolds
An option was recently deleted, forgot to disable it from a regression. Fixes a failure in regress1.
2020-03-30Support indexed operators re.loop and re.^ (#4167)Andrew Reynolds
Towards support for the strings standard. This modifies our interface so that we accept the SMT-LIB standard versions of re.loop and re.^. This means re.loop no longer accepts 3 arguments but 1 (with 2 indices). This means we no longer accept re.loop with only a lower bound and no upper bound on the number of repetitions. Also fixes #4161.
2020-03-30Frontend support for the choice operator (#4175)mudathirmahgoub
Added the operator choice to Smt2.g and Cvc.g. Removed the unused parameter hasBoundVars from TheoryModel::getModelValue
2020-03-28Change is-cons to (_ is cons) in Sygus benchmarks. (#4174)Abdalrhman Mohamed
2020-03-28Convert the last few Sygus benchmarks to V2. (#4172)Abdalrhman Mohamed
2020-03-27Node traversal iterator (#3845)Alex Ozdemir
Implement an iterator for pre- and post-order traversals. I believe that this will be useful in pre-processing passes, many of which do postorder traversals that they implement by hand. Right now this iterator does not support modification of the traversal pattern, but we could add this later on, if we want it. Co-authored-by: Andres Noetzli <andres.noetzli@gmail.com> Co-authored-by: Mathias Preiner <mathias.preiner@gmail.com>
2020-03-27Fix issues with unsat cores and reset-assertions (#4159)Andres Noetzli
Fixes #4151. Commit e9f4cec2cad02e270747759223090c16b9d2d44c fixed how `(reset-assertions)` is handled by destroying and recreating the `PropEngine` owned by `SmtEngine`. When unsat cores are enabled, creating a `PropEngine` triggers the creation of a SAT proof and a CNF proof. In the `ProofManager`, we had assertions that checked that those kinds of proofs were only created once, which is not true anymore. This commit removes the assertions, cleans up the memory management in `ProofManager` to use `std::unique_ptr` and makes all the `ProofManager::init*` methods non-static for consistency. The commit also fixes an additional issue that I encountered while testing the fix: When creating the new `PropEngine`, we were not asserting `true` and `(not false)`, which lead to an error if we tried to get the unsat core after a `(reset-assertion)` command and we had asserted `(assert false)`. The commit fixes this by asserting `true` and `(not false)` in the constructor of `PropEngine`. The regression test is an extension of the example in #4151 and covers both issues.
2020-03-27Fix expected output on arith regression (#4162)Andrew Reynolds
A benchmark went unknown -> sat, likely due to the arith-brab commit, thus leading to a failure on regress1.This updates the status on this benchmark (also adds --nl-ext-tplanes to it).
2020-03-27Move string utility file (#4164)Andrew Reynolds
Moves the string file to string.h. This is required since other required utilities will soon need to be added to regexp.h.
2020-03-27Support unicode internal representation and escape sequences (#3852)Andrew Reynolds
Work towards support for the strings standard. This updates the string solver and parser such that: The internal representation of strings is vectors of code points, Generation of the previous internal representation of strings has been relegated to the type enumerator. This is the code that ensures that "A" is the first character chosen for values of strings in models, The previous ad-hoc escape sequence handling is moved from the String class to the parser. It will live there for at least one version of CVC4, until we no longer support non-smt-lib complaint escape sequences or non-printable characters in strings, Handle unicode escape sequences according to the SMT-LIB standard in String, Simplify a number of calls to String utility functions, since the conversion between the previous internal format and code points is now unnecessary, Fixed a bug in the handling of TO_CODE: it should be based on the alphabet cardinality, not the number of internal code points.
2020-03-26Added unit-cube-like test for branch and bound (#3922)Amalee
* unit-cude test wip * test for wip unit cube test * fixed simple rounding * wip * Passing tests except for sat vs unknown ones * added flag for cube test * put example back to normal * Fixed for style guidelines. * fixed rewrite bug * removed extra comments * unit-cude test wip * test for wip unit cube test * fixed simple rounding * wip * Passing tests except for sat vs unknown ones * added flag for cube test * put example back to normal * Fixed for style guidelines. * fixed rewrite bug * removed extra comments * Small fixes based on PR feedback * replace NodeManager::currentNM with nm and clang formatted * renamed test * Added a regression test that triggers branch and bound * Added ; COMMAND-LINE: --arith-brab * Updated arith-brab test * arith-brab enabled by default * Added --nl-ext-tplanes to regress0/nl/ext-rew-aggr-test.smt2 Co-authored-by: Amalee Wilson <amalee@cis.uab.edu> Co-authored-by: Ahmed Irfan <43099566+ahmed-irfan@users.noreply.github.com> Co-authored-by: Andrew Reynolds <andrew.j.reynolds@gmail.com>
2020-03-26Disable slow regression (#4157)Andrew Reynolds
Should fix timeout in asan build.
2020-03-24Int2BV fail on demand (#4079)yoni206
This PR delays error on unsupported symbols as much as possible, by only throwing the error when actually constructing the node.
2020-03-23Simplify auxiliary variable handling in CEGQI (#4141)Andrew Reynolds
Fixes #3849 and fixes #4062. Overall, the effect of this PR is that CEGQI will generate better instantiations more frequently for quantified formulas that involve the introduction of auxiliary variables. In CEGQI, auxiliary variables introduced in CEX lemmas must be given special treatment (since the instantiations should not involve them, thus they must be solved for as well). Previously, auxiliary variables that are introduced as parts of CEX lemmas were currently assumed to be: (1) Only occurring from ITE removal, e.g. s[(ite C t1 t2]) ---> s[k] ^ ite( C, k = t1, k = t2 ) (2) Always trivially solvable by looking at which literal was asserted (k = t1 or k = t2). Both of these assumption do not hold in general (aux variables can come from other kinds of terms e.g. choice functions, and the user can force options that rewrite arithmetic equalities to inequalities). This makes auxiliary variable handling in CEGQI more robust by treating auxiliary variables as standard variables. Effectively, this means that the entire procedure for determining instantiations is run for auxiliary variables. This PR removes the specific hacks that were used previously that were based on the assumptions above. Additionally, #3849 triggered a second issue: SyGuS solution reconstruction that involves auxiliary variables that are introduced as part of instantiation lemmas should not be considered valid solutions. Previously, only a warning was given.
2020-03-22Sort inference does not handle APPLY_UF when higher-order is enabled (#4138)Andrew Reynolds
Fixes #4092 and fixes #4134. Typically, APPLY_UF has special treatment in sort inference. It is significantly more complicated when higher-order logic is enabled. This disables special handling when ufHo() is enabled.
2020-03-21Convert V1 Sygus files to V2. (#4136)Abdalrhman Mohamed
2020-03-20Don't run bv_nat parse test with competition build (#4126)Andres Noetzli
This commit should fix the nightlies.
2020-03-20Fix variable shadowing issue in sygus-inference (#4121)Andrew Reynolds
This makes the sygus-inference preprocessing pass avoid variable shadowing, which technically could happen by forcing unexpected options. Fixes #4083.
2020-03-20Guard cases of sort inference in quantifier free logics in uf cardinality ↵Andrew Reynolds
(#4074) Fixes #4068 and fixes #4085 and fixes #4063.
2020-03-20Split string-specific operators from TheoryStringsRewriter (#3920)Andrew Reynolds
Organization towards theory of sequences. The motivation of this PR is to ensure that string-specific operators in the rewriter are in their own file; thus the use of mkConst<String> / getConst<String> is allowable in rewriter_str.cpp.
2020-03-20Do not assign higher-order representative if function does not exist (#4073)Andrew Reynolds
2020-03-19Fix regression output related to sygus+bv-div-zero (#4122)Andrew Reynolds
2020-03-19Bv2int fail on demandyoni206
Postpone failure in bv-to-int preprocessing pass.
2020-03-19Only apply testConstStringInRegExp to const regexp (#4120)Andres Noetzli
Fixes #4070. `TheoryStringsRewriter::rewriteConcatRegExp()` rewrites `(a)* ++ (_)*` to `(_)*`. To do so, it checks whether the elements preceding `(_)*` match the empty string using `TheoryStringsRewriter::testConstStringInRegExp()`. However, this method only expects to be called on constant regular expressions (i.e. regular expressions without string variables). This commit adds a corresponding check before calling `TheoryStringsRewriter::testConstStringInRegExp()`.
2020-03-18Only allow bv2nat/int2bv with BV and integer logic (#4118)Andres Noetzli
CVC4 supports `bv2nat` and `int2bv` to convert bit-vectors to/from integers. Those operators are not standard. This commit only enables those operators when parsing is non-strict and both bit-vectors and integers are enabled in the logic. To achieve this, the commit simplifies the handling of logics in the parser: Instead of defining a separate `Logic` enum in the `Smt2` class, we simply use `LogicInfo` directly.
2020-03-18Fix issue with multiple infinities in CEGQI for LIRA (#4114)Andrew Reynolds
Fixes #4086. Quantifier instantiation involves two symbolic representations of infinities for real and int and was not handled correctly previously.
2020-03-16SmtEngine: Convert members owned by SmtEngine to unique pointers. (#4108)Aina Niemetz
2020-03-16Issue 4077: Add unit test to reproduce issue. (#4107)Aina Niemetz
This adds the unit test reported in issue #4077. The issue was fixed in #4081.
2020-03-16Create master equality engine at context level 0 (#4081)Andres Noetzli
Fixes #4077. The master equality engine in `TheoryEngine` was being created at SAT context level 1. If the context was popped to level zero by `(reset-assertions)`, `true` and `false` were removed from the master equality engine, which lead for example to `(= ((_ extract 3 3) x) (_ bv1 1))` and `(_ bv1 4)` being merged (this can be gathered from looking at `-t equality`). This commit fixes the issue by postponing the global context pushes until after the theory engine has been initialized.
2020-03-13Remove regress for real to int (#4071)Andrew Reynolds
Missed this one when real to int was disabled for quantifiers. Fixes regress1.
2020-03-12Add options for nec regression (#4056)Andrew Reynolds
Currently an nec benchmark in regress2 is very slow (57 seconds in production) due to disabling the nec-specific options in 67c730c). This reenables these options for this benchmark.
2020-03-12Do not allow quantifiers over real variables in real to int pass. (#4049)Andrew Reynolds
With quantifiers over real variables, --solve-real-as-int is neither sound nor complete. Thus we should abort in this case.
2020-03-12Do not make models for quantified function variables (#4039)Andrew Reynolds
If we combine finite model finding and higher-order, then we could try to find a model find operators whose kind was BOUND_VARIABLE.
2020-03-12New C++ API: Remove support for (reset). (#4037)Aina Niemetz
Supporting SMT-LIB's (reset) command on the API level is dangerous and not required -- it's sufficient to just destroy the solver object and create a new one if necessary. It's dangerous because invalidated objects can be passed in after a reset, and we would need to find a clean way to guard against this. We want to guard against this in the future, but for now it is cleaner to make it explicit (by not having this functionality in the API but forcing the user to destroy and recreate the solver object) that these objects can't be reused.
2020-03-11Fix double notify in equality engine (#4036)Andrew Reynolds
Fixes #3955. Previously we were getting two calls to notifyNewEqClass from the equality engine for new application nodes, since the notification was being done in an internal call to newNode(...). The proper place to call this is in addTermInternal(...) which is called only once per Node per SAT context. This bug potentially impacted some performance (due to redundant calls), and also broke the contract that notifyNewEqClass should only be called once per node per SAT context. In most cases, this was being handled in a benign way by theory solvers, although an assertion was failing in EqualityQuery, which is fixed by this PR. A block of code changed indentation in this commit.
2020-03-11Simplifications to the Datatypes API (#4040)Andrew Reynolds
Removes DatatypeSelectorDecl and DatatypeDeclSelfSort. Add selectors is now inlined. A special case is added for the "self selector", instead of using a class as a dummy argument. I updated the Python files, although would be helpful to double check this is correct. Co-authored-by: makaimann <makaim@stanford.edu>
2020-03-11Do not enable some SMT-COMP specific options by default (#4038)Andrew Reynolds
Moves SMT-COMP-specific options to the SMT-COMP script. Both of these options have led to issues (segfaults or infinite loops). Issue #789 can be downgraded to "minor" after this PR. Btw, I did not add these specialized options to the "incremental" script of SMT-COMP, since I'm assuming they should not be used there.
2020-03-11Guard against null relevancy condition in SyGuS (#4033)Andrew Reynolds
Fixes #4025. Also makes our sygus default grammar for strings (slightly) better by including a dummy character, which is required for solving the regression added by this PR. A more robust (but unintuitive to the user) solution would be to include str.from_code( Start_Int ).
2020-03-11Add missing datatype functions to new API (#3930)Andrew Reynolds
This is in preparation for migrating the parser to use the Term-level API for datatypes. Notably, this adds the function mkDatatypeSorts for making mutually recursive datatypes. I've added a unit test that demonstrates this method (which mirrors the Expr-level datatype API).
2020-03-11Switch to Nodes for conjecture generator (#4026)Andrew Reynolds
Fixes #4022.
2020-03-11reset-assertions: Update TheoryEngine's PropEngine* (#4032)Andres Noetzli
Fixes #4028. TheoryEngine's pointer was not updated to the new PropEngine when resetting assertions. This commit fixes that. As far as I can tell, this was the only class storing a PropEngine* that isn't owned by PropEngine, so we should hopefully not have other similar issues.
2020-03-11Remove experimental symmetry breaker (#4005)Andrew Reynolds
This never impacted performance positively. Fixes #3997 and fixes #4015. There was a folder that the symmetry breaker was used on regress1/sym. These are simple examples that show when it is possible to find symmetries in SMT; the symmetry breaker is not critical for solving these. For now I'm leaving them as regressions documenting possible benchmarks to target if we revisit this technique.
2020-03-11Fix non-parametrized operators in subgoal generation (#4023)Andrew Reynolds
Fixes #4021. We were previously constructing a malformed HO_APPLY as part of a subgoal for induction.
2020-03-11Fix duplicate variable issue in sygus-qe-preproc (#4013)Andrew Reynolds
2020-03-10Set assertion in `CnfStream::ensureLiteral()` (#3927)Andres Noetzli
Fixes #3814. `CnfProof` has a stack of assertions that are being converted to clauses. `CnfStream::ensureLiteral()` can result in clauses being added to the SAT solver. When adding a clause, we require an assertion that can be associated with the clause (https://github.com/CVC4/CVC4/blob/ba6ade0fc3f4cd339885652bb9bf5c87113c498d/src/prop/minisat/core/Solver.cc#L471-L476). However, in the issue that was reported, the stack was empty, resulting in an assertion failure. This commit fixes the issue by setting the current assertion to be the null node when a literal is being ensured (and changing the proof code to update the assertion associated with a literal if it is currently null). This should be ok since the clauses are not inputs or lemmas (if they are, the assertion associated with the clause will be updated).
2020-03-10Fix real to int for parameterized kinds (#4016)Andrew Reynolds
2020-03-10Fix options for regression: --sort-inference is incompatible with unsat ↵Andrew Reynolds
cores. (#4011)
2020-03-10Fix sort inference for top-level Boolean variables (#4012)Andrew Reynolds
Fixes #4010.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback