summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2021-11-13Skip `str.code` inferences for sequence eqcs (#7644)Andres Noetzli
Fixes cvc5/cvc5-projects#340. Type checking failed because cvc5 was trying to construct a term (str.to_code (seq.unit false)). We do not allow the construction of terms (str.to_code t) where t is not of type string. This commit fixes the issue by skipping sequence equivalence classes when doing inferences related to str.to_code. Note that the regression test is slightly different from the original unit test. It asserts that the index passed to seq.nth is non-negative, which ensures that we can check the resulting model. I have checked that the modified regression test triggers the issue before the change in this commit.
2021-11-13Fix type error for rewriting bag.map bag.union_disjoint (#7640)mudathirmahgoub
Fix type error for rewriting bag.map bag.union_disjoint
2021-11-13Add operator set.map to theory of sets (#7641)mudathirmahgoub
Towards supporting set.map operator in the sets solver.
2021-11-12bags: Rename kinds with a more consistent naming scheme (#7611)mudathirmahgoub
2021-11-12Remove `ConstantMap<Rational>` (#7635)Andres Noetzli
This is in preparation of having two different kinds (CONST_RATIONAL and CONST_INT) share the same payload. To do so, we cannot rely on ConstantMap<Rational> anymore to map the payload type to a kind. This commit extends support in the mkmetakind script to deal with such payloads by adding a + suffix to the type. The commit also does some minor refactoring of NodeManager::mkConst() and NodeManager::mkConstInternal() to support setting the kind explicitly. Finally, the commit addresses all instances where mkConst<Rational>() is used, including the API.
2021-11-11Add an API method to get the raw name of a term. (#7618)Abdalrhman Mohamed
2021-11-11Add lazy approach for handling lambdas in the HO extension (#7625)Andrew Reynolds
This adds a new option --uf-lazy-ll for not applying lambda lifting eagerly. This is motivated by HO operators in theory of bags, e.g. bag.map, which cannot answer "sat" for simple problems where lambdas are mapped to bags, due to the introduction of quantified formulas for eliminating lambdas. It moves lambda lifting from term formula removal to a utility module within TheoryUF. If lazy lambda lifting is enabled, this module does not introduce quantified formulas for lambdas eagerly. It adds 2 lemma schemas for reasoning about quantifier-free constraints with lambdas natively in TheoryUF. It extends the model construction in the HoExtension to assign lambdas in the case that an equivalence class contains a variable that is defined by a lambda.
2021-11-10api: Add Solver::mkRegexpAll(). (#7614)Aina Niemetz
2021-11-10Fix soundness issue of missing premises for count bag lemmas (#7615)mudathirmahgoub
This PR fixes soundness issues found by cvc5 fuzzy sygus when it answers unsat for sat problems. The error is related to a previous fix which did not include the required antecedent in the two lemmas: (=> (= e x) (= (bag.count e (bag x c)) (ite (>= c 1) c 0))) and (=> (distinct x e)) (= (bag.count e (bag x c)) 0))
2021-11-10Fix parsing array constants (#7617)Andrew Reynolds
This generalizes a fix for parsing array constants. Fixes #7596.
2021-11-10sets: Rename set.intersection to set.inter. (#7622)Aina Niemetz
This further renames kind SET_INTERSECTION to SET_INTER.
2021-11-10Reorganize test/unit/api directory. (#7612)Aina Niemetz
This moves .cpp files to directory test/unit/api/cpp and python files in test/python/unit/api to test/unit/api/python.
2021-11-09Only eliminate lambdas in higher-order elimination if ho-elim is enabled (#7603)Andrew Reynolds
Required for lazy lambdas in HO. Also properly guards the case when the preprocessing pass is a no-op.
2021-11-09Clean up ctest configuration and CI test configuration. (#7620)Aina Niemetz
Previously, on CI, unit tests and api tests were run twice since we use a ctest exclude rule based on labels (-LE) which includes unit and api tests, but then run them separately again. This cleans up the CI test configuration. Further, unit gtest unit tests were added with gtest_add_tests, which adds every test of a unit test binary as a single test target to ctest. In theory, this may speed up testing (because more parallelism) but in practice it slows it down due to the start up overhead. It also clutters CI output. This cleans up the gtest configuration to add the gtest unit tests per test binary rather then per test of a test binary.
2021-11-09[proofs] Generalize trivial cycle detection in LazyCDProofChain (#7619)Haniel Barbosa
Previously the trivial cycle check only covered the case in which the currently-being-expanded assumption `A` had as its stored proof node `pf` an assumption proof justifying itself. However, it can be the case that `pf` is not an assumption proof, but a proof that nevertheless has `A` as one of its free assumptions. This commit generalizes the trivial cycle check to account for this.
2021-11-09regex: Rename REGEXP_EMPTY and REGEXP_SIGMA to match SMT-LIB. (#7609)Aina Niemetz
This renames kinds REGEXP_EMPTY to REGEXP_NONE and REGEXP_SIGMA to REGEXP_ALLCHAR to match their SMT-LIB representation (re.none, re.allchar). It further renames api::Solver::mkRegexpEmpty() to mkRegexpNone and api::Solver::mkRegexpSigma to mkRegexpAllchar.
2021-11-09Remove `CVC5Message` (#7610)Gereon Kremer
This PR removes the few remaining usages of the CVC5Message() and gets rid of the whole thing.
2021-11-09Remove command-verbosity option (#7581)Gereon Kremer
This PR removes the command-verbosity option. It is implemented as a weird special case, and nobody seems to use it anyway.
2021-11-08expand bag.choose operator (#7481)mudathirmahgoub
This PR expands bag.choose operator as a preprocessing step. It also refactors the implementation of choose operator for sets
2021-11-08sets: Rename kinds with a more consistent naming scheme. (#7595)Aina Niemetz
This prefixes sets kinds with SET_ and relation kinds with RELATION_. It also prefixes the corresponding SMT-LIB operators with 'set.' and relation operators with 'rel.'.
2021-11-06Integrate java unit tests into ctest (#7593)Gereon Kremer
This PR properly integrates the java api unit tests into ctest.
2021-11-06Print `unsupported` for unrecognized flags. (#7384)Abdalrhman Mohamed
Fixes #7374.
2021-11-06Do not use extended rewrites on recursive function definitions (#7549)Andrew Reynolds
Leads to potential non-idempotent behavior in the rewriter. The issue cannot be replicated on master, but this safe guards this case anyways. Fixes #5278.
2021-11-06Remove `Notice()` in favor of new `verbose()` (#7588)Gereon Kremer
This PR removes the remaining usages of the Notice() macros and uses verbose() instead.
2021-11-06Disable regress2 test. (#7591)Mathias Preiner
2021-11-05Fix exclusion criteria for codatatype model values (#7546)Andrew Reynolds
This fixes codatatype model value construction. Model construction for codatatypes is non-standard since it requires analyzing whether (possibly recursively defined) terms are alpha equivalent to others during model construction. This is currently handled as a special case within the theory model builder. (This should eventually be moved somewhere more appropriate via a new callback to theory). This fixes the criteria which was too permissive about which values can be used in models. We now exclude values that match the skeleton of representative codatatype terms. Previously we additionally required that the terms were bisimilar. Fixes #4851.
2021-11-05[proofs] Fix open sat proof (#7509)Haniel Barbosa
Improves how LazyCDProofChain handles cycles, which fixes a particular case triggered by the added regression. Also makes LazyCDProofChain::getProofFor more robust in that when it can't connect the requested fact it yields an assumption proof node. Fixes cvc5/cvc5-projects#324
2021-11-05Eliminate a level of nesting of traversals in theory preprocessing (#7345)Andrew Reynolds
This simplifies the theory preprocessor so that it does not rely on the term formula removal to do a nested traversal. Instead, it only relies on its "runCurrent" method. Notice that this PR essentially replaces TheoryPreprocessor's theoryPreprocess method with TermFormulaRemoval's runInternal method, while adding the required call to rewriteWithProof and preprocessWithProof as post-rewrites. This is far simpler than the previous method, which invoked nested traversals using TermFormulaRemoval::run. There are two things that will be improved in follow up PRs: The initial full rewrite step in the theory preprocessor can be merged into the main traversal of theory preprocess (I believe this is why we are slower on nec benchmark than we were previously), We should eliminate the traversal methods from TermFormulaRemoval altogether, as they are now subsumed by the theory preprocessors main traversal. This will require refactoring how "early ITE removal" works, as this is the only user now of TermFormulaRemoval::run. Note we should probably performance test this change. This incidentally fixes #6973, as the previous theory preprocessing code was to blame for that issue.
2021-11-05Remove `Chat()` in favor of new `verbose()` (#7586)Gereon Kremer
This PR completely removes the first of several logging macros. Instead of Chat(), we now use verbose(2).
2021-11-05[FP] Do not assert that model has shared term (#7585)Andres Noetzli
Fixes #7569. Currently, the FP solver asserts that m->hasTerm(sharedTerm) is always true for the real term in the conversion from real to floating-point value. This is not necessarily the case because the arithmetic solver computes values for the variables in the shared terms but not necessarily for the terms themselves. This commit removes the assertion and instead relies on the fact that a later assertion checks that m->getValue(sharedTerm).isConst(), which is the property that we are actually interested in.
2021-11-05Remove quadratic solving in NlModel (#7542)Gereon Kremer
This PR removes obsolete code from NlModel concerned with solving quadratic equations. This code is only used on nonlinear real problems where the cad solver is not used.
2021-11-04Add -o sygus-grammar to print auto-generated SyGuS grammars (#7573)Andrew Reynolds
Fixes #5341.
2021-11-04Improve defaults for sygus default grammars (#7553)Andrew Reynolds
We now add constants from the conjecture to default grammars by default. We also ensure that integer constants are used as real constants when applicable.
2021-11-04Replace the old dump infrastructure (#7572)Andrew Reynolds
This deletes the old dumping infrastructure, which due to changes in our usage of SolverEngine does not print valid benchmarks. This eliminates the concept of a "NodeManagerListener" which has been problematic to maintain. This PR reimplements the --dump=assertions:pre-X and --dump=assertions:post-X as -t assertions::pre-X and -t assertions::post-X. This is done in a self contained utility method in ProcessAssertions using smt::PrintBenchmark and does not require keeping the rest of the code in sync. The other dumping tags are deleted for now, and will be reimplemented as needed.
2021-11-04Start refactoring of `-o` and `-v` (#7449)Gereon Kremer
This PR does the first step in consolidating our various output mechanisms. The goal is to have only three major ways to output information: - verbose(level) prints log-like information to the user via stderr, -v and -q increase and decrease the verbosity, respectively. - output(tag) prints structured information (as s-expressions) to the user via stdout, -o enables individual tags. - Trace(tag) prints log-like information to the developer via stdout, -t enables individual tags. While Debug and Trace (and eventually Dump) will be combined within Trace, all of Warning, Message, Notice and Chat will be combined into verbose.
2021-11-04Refactor cmake to build either static or shared (#7534)Gereon Kremer
This PR simplifies the cmake setup to only build either shared or statically. It also attempts to fix windows builds, both shared and static.
2021-11-04Enable CDCAC solver for selected quantified logics (#7571)Gereon Kremer
This PR enables the CDCAC solver for quantified logics with reals, but no integers. Also, it disables SyGuS if no integers are used. The regression is a benchmark that is only solved with this new configuration.
2021-11-03api: Rename some separation logic functions for consistency. (#7564)Aina Niemetz
This renames Solver::getSeparationHeap to Solver::getValueSepHeap, Solver::getSeparationNilTerm to Solver::getSepNil and Solver::declareSeparationHeap to Solver::declareSepHeap. @mudathirmahgoub @alex-ozdemir @yoni206
2021-11-03Add unit test to cover previous failure with second solver instance. (#7565)Aina Niemetz
Fixes #5893.
2021-11-03Enable CI for Junit tests (#7436)mudathirmahgoub
This PR enables CI for java tests by adding --java-bindings to ci.yml. It also replaces the unreliable finalize method and instead uses AutoCloseable and explicit close method to clean up dynamic memory allocated by java native interface. The PR fixes compile errors for SolverTest.java and runtime errors for Solver.defineFun.
2021-11-03Refactor skolem construction (#7561)Andrew Reynolds
This makes all methods for constructing skolems local to SkolemManager. It removes infrastructure for node manager listeners being notified when skolems are constructed. This was used for 2 things: (1) The old dumping infrastructure, where skolems could contribute in part to traces to print benchmarks. This code will be deleted soon. (2) The miplib preprocessing pass, which used this functionality to listen to what skolems were constructed, and subsequently assumed these skolems coincided with what Boolean variables appeared in assertions. This is highly error prone, and has been replaced by a simple traversal to collect Boolean variables in assertions. This is in preparation for a lazy lambda lifting technique, which will require more infrastructure in SkolemManager.
2021-11-03Formalize more string skolems (#7554)Andrew Reynolds
This properly formalizes all string skolems used in reduction and preprocessing. This avoids proof checking failures due to non-deterministism when checking steps for these modules. Fixes cvc5/cvc5-projects#334. Fixes cvc5/cvc5-projects#331.
2021-11-03Fix preregistration for floating point theory (#7558)Andrew Reynolds
Preregistering terms must always add them to the equality engine of TheoryFp, otherwise there may be preregistered terms that do not occur in the equality engine of TheoryFp, thus leading to crashes during theory combination. Fixes cvc5/cvc5-projects#329.
2021-11-02Improve syntax for fmf cardinality constraints (#7556)Andrew Reynolds
This is an experimental extension of smt2.
2021-11-02Make quant elimination robust to presence of other quantified formulas (#7551)Andrew Reynolds
Fixes #4813
2021-11-01Weaken assertion in CEGQI (#7548)Andrew Reynolds
The assertion can be violated in mixed Int/Real arithmetic. The instantiator utility nevertheless safe guards Int vs Real subtyping. Fixes #7537.
2021-11-01bv: Remove layered solver. (#7455)Mathias Preiner
This commit removes the old bit-vector solver code.
2021-11-01Fix upwards closure for relations (#7515)Andrew Reynolds
This PR fixes an issue where we did compute upwards closure (for join, product, etc.) on equivalence classes whose membership cache had already been initialized (perhaps recursively from the computation of upwards/downwards closures on other terms). It also generalizes the fix from #7511. Instead of doing explicit splitting, we mark shared terms and let theory combination (when necessary) do splitting. This is required to fix a more general version of the benchmark from the previous PR, where instead now a term c+1 is used in a position that is relevant to a join. It disables a regression that times out after these fixes, and does further cleanup.
2021-11-01Refactor DidYouMean (#7535)Gereon Kremer
This refactors the `DidYouMean` class, which is used to make helpful suggestions for misspelled tags and options. It uses `std::vector` instead of `std::set`, moves it from `options` to `util` (so that we can keep using it in both libcvc5 and the driver) and generally modernizes the code a bit. Also, it replaces the stand-alone and never executed test by a regular unit test.
2021-10-31Fix soundess issue for bags with negative multiplicity (#7539)mudathirmahgoub
This PR fixes soundness issues found by cvc5 fuzzy sygus when it answers unsat for sat problems. One error was with the rewrite rule (bag.count x (bag x c) = c which did not account for cases when c is negative. This conflicts with fact that all multiplicities are non-negative. Another error was that the difference_remove inference rule didn't consider the negative case for (count e B) (= (count e (difference_remove A B)) (ite (= (count e B) 0) (count e A) 0))) ; not enough (= (count e (difference_remove A B)) (ite (<= (count e B) 0) (count e A) 0))) ; the right rule
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback