summaryrefslogtreecommitdiff
path: root/src/smt
AgeCommit message (Collapse)Author
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-26Move set defaults function to its own file (#4154)Andrew Reynolds
This moves SmtEngine::setDefaults to its own file. This design is not final. One could imagine this being a part of a "OptionsSetter" utility. I am leaving this as is until we refactor the relationship between SmtEngine and Options. Regardless, the general file structure should be such that this method is separate from SmtEngine, since setting default options is a large task that should be addressed independently from the core of SmtEngine. This is initial preparation towards converting the SmtEngine from Expr -> Node. A few very minor changes were made to the code to make the separation possible.
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-20Handle failures for sygus QE preprocess (#4072)Andrew Reynolds
If the user explicitly disabled the QE algorithm and asked for QE, then we should resort to normal methods. Fixes #4064 and fixes #4109.
2020-03-19Bv2int fail on demandyoni206
Postpone failure in bv-to-int preprocessing pass.
2020-03-19SyGuS must use total bitvector division (#4119)Andrew Reynolds
Our SyGuS utilities are not designed to deal with partial bitvector division. If a user forced an older version of SMT-LIB semantics while using SyGuS, this led to a number of issues. For now, we disable this option when it is combined with SyGuS, regardless of whether the user turns it on. A more permanent solution will be to remove the old SMT-LIB semantics option bv-div-zero-const entirely. Fixes #4097 and fixes #4088 and fixes #4104.
2020-03-18Move node visitor class from smt_util/ to expr/ (#4110)Alex Ozdemir
Done by: Running rg 'smt_util/node_visitor' -l | xargs sed -i 's/smt_util\/node_visitor/expr\/node_visitor/' in src to change the #includes Moving the file Changing src/expr/CMakeLists.txt and src/CMakeLists.txt clang-format, omitting node_visitor.h. In reference to discussion, here.
2020-03-16SmtEngine: Convert members owned by SmtEngine to unique pointers. (#4108)Aina Niemetz
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-12Remove local theory extension option (#4048)Andrew Reynolds
This option was unimplemented and was equivalent to setting the instantiation level of all quantified formulas to 0.
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-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-10Fix issue with reset-assertions. (#3988)Aina Niemetz
Calling (reset-assertions) in start mode was not handled correctly. Additionally, when calling (check-sat) after (reset-assertions) after a (check-sat) call that answered unsat, we answered unsat instead of sat. This cleans up and fixes reset-assertions) handling.
2020-03-10Consolidate options that disable produceModels (#3973)Andrew Reynolds
Also adds --sort-inference to this list, fixes #3936.
2020-03-09Rename sygus option name (#3977)Andrew Reynolds
This option enables the sygus solver (previous name was ceGuidedInst, deprecated from CAV 15 specific approach). It also improves when this option is set. In particular we ensure it is enabled when sygus is enabled for any reason.
2020-03-06Simplify DatatypeDeclarationCommand command (#3928)Andrew Reynolds
The new API does not use inheritence for Sorts. The current DatatypeDeclarationCommand uses DatatypeType, which inherits from Type. This commit simplifies the class DatatypeType -> Type and updates the necessary code (e.g. in the printers). Notice we are not yet converting commands Type -> Sort here. It also makes the main call for constructing datatypes in the parser from DatatypeType -> api::Sort. This is in preparation for converting Expr-level Datatype to Term-level DatatypeDecl in the parsers.
2020-03-05Remove --apply-to-const preprocessing pass (#3919)Andres Noetzli
Fixes #3914. The pass was only applicable to inputs with UFs that were exclusively applied to single integer values. This limitation seems to make the preprocessing pass not very useful in practice and it is subsumed by our Ackermannization pass, which can remove UFs from more complex inputs. Thus, this commit removes the preprocessing pass.
2020-03-05Move ownership of DecisionEngine into PropEngine. (#3850)Aina Niemetz
This is in preparation of fixing the issue we currently have with reset-assertions. This also removes a competition hack for QF_LRA.
2020-03-05Revert "Move ownership of DecisionEngine into PropEngine. (#3850)"Aina Niemetz
This reverts commit bbba915f44f9e75eaa6238a10ba667643dacb00b.
2020-03-05Move ownership of DecisionEngine into PropEngine. (#3850)Andrew Reynolds
This is in preparation of fixing the issue we currently have with reset-assertions. This also removes a competition hack for QF_LRA.
2020-03-05Enable -Wshadow and fix warnings. (#3909)Mathias Preiner
Fixes all -Wshadow warnings and enables the -Wshadow compile flag globally. Co-authored-by: Clark Barrett <barrett@cs.stanford.edu> Co-authored-by: Andres Noetzli <andres.noetzli@gmail.com> Co-authored-by: Aina Niemetz <aina.niemetz@gmail.com> Co-authored-by: Alex Ozdemir <aozdemir@hmc.edu> Co-authored-by: makaimann <makaim@stanford.edu> Co-authored-by: yoni206 <yoni206@users.noreply.github.com> Co-authored-by: Andrew Reynolds <andrew.j.reynolds@gmail.com> Co-authored-by: AleksandarZeljic <zeljic@stanford.edu> Co-authored-by: Caleb Donovick <cdonovick@users.noreply.github.com> Co-authored-by: Amalee <amaleewilson@gmail.com> Co-authored-by: Scott Kovach <dskovach@gmail.com> Co-authored-by: ntsis <nekuna@gmail.com>
2020-02-29 Throw warning instead of error for non-constant values in check-model ↵Andrew Reynolds
stages (#3844) Fixes #3729 and fixes #3720. This updates two more stages of check-model (checking whether values assigned to terms are constants and internally checking whether assertions belonging to theories) to only throw warnings when a term/assertion has a non-constant value in the model. This is to accommodate cases where check-model is infeasible.
2020-02-26More fixes for printing sygus commands (#3812)Andrew Reynolds
Towards v1 -> v2 sygus conversion. This makes several fixes and improvements related to printing sygus commands: (1) The logic is extended with LIA, DT, UF internally during setDefaults instead of during parsing. This is the correct place for this extension of the logic since it should be applied regardless of the parser. 5 existing logic bugs were discovered as a result of this in regressions, which are fixed by this PR. (2) Ensures that terms in sygus grammars are printed without letification, since this is prohibited in sygus. Notice the formulas printed by constraints need to be letified (otherwise we can't convert large lustre benchmarks). Thus, the letification threshold should determine this but always be overridden for grammar terms. (3) Ensures final options are set for all sygus-specific commands, which follows the standards prescribed by sygus v2 (all set-* commands come before other commands).
2020-02-26Remove portfolio leftovers (#3821)Andres Noetzli
Commit 1c09572e0e2031519a103caa2a4af0d9bd34a9c5 removed the portfolio build but there were some leftovers. This commit removes them.
2020-02-24bv_to_int preprocessing passyoni206
Introduces a preprocessing pass that translates bv problems to integer problems.
2020-02-24Fix bugs related to printing Sygus commands (#3804)Abdalrhman Mohamed
With this commit, most Sygus problems should print correctly. The current printing functionality was tested on 158 Sygus regress files (0, 1, and 2) and 153 of them were printed in Sygus2 format and contained "(check-synth)". The printing functionality was tested again on the generated files and gave almost the same results.
2020-02-20Remove unused code (#3782)Andres Noetzli
2020-02-20Remove parser from bindings (#3779)Andres Noetzli
2020-02-19resource manager: Add statistic for every resource. (#3772)Mathias Preiner
This commit adds statistics for all resource steps. A resource statistic is incremented by 1 if the resource is spent (via `spendResource`). Fixes #3751.
2020-02-17Support dumping Sygus commands. (#3763)Abdalrhman Mohamed
2020-02-14Remove quantifiers rewrite rules infrastructure (#3754)Andrew Reynolds
2020-02-13Forcing rewrite pass rather than asserting if formula has been rewritten (#3748)Haniel Barbosa
This ensures that users or developers don't accidentally break the solver either via options or changing the SMT engine flow so that the formula is not rewritten up to a given point.
2020-02-12Rename Java package to edu.stanford.CVC4 (#3752)Andres Noetzli
2020-02-08Make "unknown" non-critical for unsat cores check (#3728)Andres Noetzli
2020-02-07Refactor check-model handling in SmtEngine (#3723)Andrew Reynolds
2020-02-06Generalize containsQuantifiers to hasClosure (#3722)Andrew Reynolds
2020-01-31Allow PBE symmetry breaking with sygus stream (#3686)Andrew Reynolds
2020-01-30Weaken assertion for models with approximations (#3667)Andrew Reynolds
2020-01-15New C++ API: Add nullary constructor for Result. (#3603)Aina Niemetz
2019-12-17Generate code for options with modes. (#3561)Mathias Preiner
This commit adds support for code generation of options with modes (enums). From now on option enums can be specified in the corresponding *.toml files without the need of extra code. All option enums are now in the options namespace.
2019-12-16Support ackermannization on uninterpreted sorts in BV (#3372)Ying Sheng
Support ackermannization on uninterpreted sorts in BV. For uninterpreted sorts, we create a bit-vector sort to replace it. For an uninterpreted sort `S`, if the number of variables within sort `S` is `n`, the replacing bit-vector will have size (log n)+1.
2019-12-16Trace tags for dumping the decision tree in org-mode format (#2871)makaimann
This would add tracing options to print the decision tree in [org-mode](https://orgmode.org/) format which can be viewed with emacs or [vim-orgmode](https://github.com/jceb/vim-orgmode). In the raw format, the number of asterisks denote the decision level of a decision, and within a propagation node, the number of spaces denote the level. Most viewers render the asterisks as indented bullets. There are some options for controlling verbosity: `dtview` - prints the decisions (basic option) `dtview::command` - also prints smt-lib commands as they're issued `dtview::conflict` - also prints conflicts `dtview::prop` - also prints propagations Example usage: `cvc4 -t dtview -t dtview::command -t dtview::conflict -t dtview::prop <example smt2 file> &> example-trace.org` The resulting file when opened with an org-mode viewer has collapsible nodes, where "..." marks a node with children.
2019-12-10Allow unsat cores with sygus inference (#3550)Andrew Reynolds
2019-12-09Disable sygus inference when combined with incremental and proofs (#3539)Andrew Reynolds
2019-12-06Throw exception instead of warning for approximate models (#3542)Andrew Reynolds
2019-12-06New algorithm for interpolation and abduction based on unsat cores (#3255)Andrew Reynolds
2019-12-05Refactor mode options for Unif+PI (#3531)Andrew Reynolds
2019-12-02OpTerm Refactor: Allow retrieving OpTerm used to create Term in public C++ ↵makaimann
API (#3355) * Treat uninterpreted functions as a child in Term iteration * Remove unnecessary const_iterator constructor * Add parameter comments to const_iterator constructor * Use operator[] instead of storing a vector of Expr children * Switch pos member variable from int to uint32_t * Add comment about how UFs are treated in iteration * Allow OpTerm to contain a single Kind, update OpTerm construction * Update mkTerm to use only an OpTerm (and not also a Kind) * Remove unnecessary function checkMkOpTerm * Update mkOpTerm comments to not use _OP Kinds * Update examples to use new mkTerm * First pass on fixing unit test * Override kind for Constructor and Selector Terms * More fixes to unit tests * Updates to parser * Remove old assert (for Kind, OpTerm pattern which was removed) * Remove *_OP kinds from public API * Add hasOpTerm and getOpTerm methods to Term * Add test for UF iteration * Add unit test for getOpTerm * Move OpTerm implementation above Term implemenation to match header file Moved in header because Term::getOpTerm() returns an OpTerm and the compiler complains if OpTerm is not defined earlier. Simply moving the declaration is easier/cleaner than forward declaring within the same file that it's declared. * Fix mkTerm in datatypes-new.cpp example * Use helper function for creating term from Kind to avoid nested API calls * Rename: OpTerm->Op in API * Update OpTerm->Op in examples/tests/parser * Add case for APPLY_TESTER * operator term -> operator * Update src/api/cvc4cpp.h Co-Authored-By: Aina Niemetz <aina.niemetz@gmail.com> * Comment comment suggestion Co-Authored-By: Aina Niemetz <aina.niemetz@gmail.com> * Add not-null checks and implement Op from a single Kind constructor * Undo sed mistake for OpTerm replacement * Add 'd_' prefix to member vars * Fix comment and remove old commented-out code * Formatting * Revert "Formatting" This reverts commit d1d5fc1fb71496daeba668e97cad84c213200ba9. * More fixes for sed mistakes * Minor formatting * Undo changes in CVC parser * Add isIndexed and prefix with d_ * Create helper function for isIndexed to avoid calling API functions in other API functions
2019-12-01Ensure quantifiers options are set with --no-strings-lazy-pp (#3515)Andrew Reynolds
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback