summaryrefslogtreecommitdiff
path: root/src/theory/quantifiers/extended_rewrite.cpp
AgeCommit message (Collapse)Author
2020-06-17Do not traverse WITNESS for partial substitutions in extended rewriter (#4630)Andrew Reynolds
Fixes #4620. The extended rewrite (and A B) ---> (and A (B * { A -> true } ) triggers an unsoundness when B contains witness terms. More generally, contextual substitution into witness terms is unsound since the skolemization of witness terms is added globally whereas the substitution corresponds to a fact that holds locally. This means that A -> true above may be added as a global constraint indirectly through witness skolemization. A general example of this unsoundness: (or (and (>= x 0) (P (witness ((z Int)) (=> (>= x 0) (= (* z z) x))))) F) rewrites to (or (and (>= x 0) (P (witness ((z Int)) (= (* z z) x)))) F) preprocesses to (and (or (and (>= x 0) (P k)) F) (= (* k k) x)) which now implies that (>= x 0) by the last conjunct, whereas this was not implied in the original formula This PR limits the kinds that can be traversed when applying substitutions in the extended rewriter, including from the rewrite above. In particular, the fix ensures that the partialSubstitute method is used in the extended rewriter when applicable, which now explicitly disallows recursion on WITNESS. Notice that this fixes contextual substitutions in the extended rewriter, but does not fix the more general issue. In particular, we still should be careful to check if contextual substitutions are applied by any other preprocessing passes.
2020-06-16Update copyright headers.Aina Niemetz
2020-06-02Fix scope issue with pulling ITEs in extended rewriter. (#4547)Andrew Reynolds
Fixes #4476.
2020-04-12Fixes for extended rewriter (#4278)Andrew Reynolds
Fixes #4273 and fixes #4274 . This also removes a spurious assertion from the Node::substitute method that the result node is not equal to the domain. This is violated for f(f(x)) { f(x) -> x }.
2020-04-03Update theory rewriter ownership, add stats to strings (#4202)Andres Noetzli
This commit adds statistics for string rewrites. This is work towards proof support in the string solver. At a high level, this commit adds a pointer to a `SequenceStatistics` in the rewriters and modifies `SequencesRewriter::returnRewrite()` to count the rewrites done. In practice, to make this work requires a couple of changes, some of them temporary: - We can't have a single `Rewriter` instance shared between different `SmtEngine` instances anymore. Thus the `Rewriter` is now owned by the `SmtEngine` and calling the rewriter retrieves the rewriter associated with the current `SmtEngine`. This is a temporary workaround before we get rid of singletons. - Methods in the `SequencesRewriter` and the `StringsRewriter` are made non-`static` because they need access to the statistics instance. - `StringsEntail` now has non-`static` methods because it needs a reference to the sequences rewriter that it can call. - The interaction between the `StringsRewriter` and the `SequencesRewriter` changed: the `StringsRewriter` is now a proper `TheoryRewriter` that inherits from `SequencesRewriter` and calls its `postRewrite()` before applying its own rewrites (this is essentially a reversal of roles from before: the `SequencesRewriter` used to call `static` methods in the `StringsRewriter`). - The theory rewriters are now owned by the individual theories. This design mirrors the `EqualityEngine`s owned by the individual theories.
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-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-12Ensure ext rewrites for associative ops dont throw assertions for kind ↵Andrew Reynolds
arities (#3681)
2020-01-30Make eq chain an aggressive rewrite in extended rewriter (#3679)Andrew Reynolds
2019-03-26Update copyright headers.Aina Niemetz
2018-12-15Revert "Move ss-combine rewrite to extended rewriter (#2703)" (#2759)Andres Noetzli
2018-12-14 Fix extended rewriter for binary associative operators. (#2751)Andrew Reynolds
This was causing assertion failures when using Sets + Sygus.
2018-11-21Move ss-combine rewrite to extended rewriter (#2703)Andres Noetzli
We found that the `ss-combine` rewrite hurts solving performance, so this commit is moving it to the extended rewriter.
2018-09-28Rewrites for (= "" _) and (= (str.replace _) _) (#2546)Andres Noetzli
2018-09-25Fix warnings uncovered by cmake build (#2521)Andrew Reynolds
2018-09-24Refactor strings equality rewriting (#2513)Andrew Reynolds
This moves the extended rewrites for string equality to the main strings rewriter as a function rewriteEqualityExt, and makes this function called on every equality that is generated (from non-equalities) by our rewriter.
2018-09-05 More extended rewrites for strings equality (#2431)Andrew Reynolds
2018-09-05 Extended rewriter for string equalities (#2427)Andrew Reynolds
2018-08-27Refactor extended rewriter, move rewrites to aggressive (#2387)Andrew Reynolds
This is work towards #2305. With this PR, CVC4's performance is fairly reasonable on the Kind2 BMC benchmarks with --decision=internal --ext-rew-prep --ext-rew-prep-agg.
2018-07-06 sygusComp2018: improve extended rewriter for Bool (#2107)Andrew Reynolds
2018-06-25Updated copyright headers.Aina Niemetz
2018-05-10Sygus repair constants (#1812)Andrew Reynolds
2018-04-27Core improvements to extended rewriter (#1820)Andrew Reynolds
2018-04-25Equality resolution in the extended rewriter (#1811)Andrew Reynolds
2018-04-02Improvements to extended rewriter for Booleans and ITE (#1705)Andrew Reynolds
2018-02-12Option to use extended rewriter as a preprocessing pass (#1600)Andrew Reynolds
2018-01-28Sort children of all commutative operators for sygus. (#1544)Andrew Reynolds
2018-01-02Improve rewriter for string equality (#1427)Andrew Reynolds
2017-11-16(Refactor) Arithmetic monomial sum (#1381)Andrew Reynolds
* Add arithmetic monomial sum utility. * Clang format * Fix * Address review. * Fix missed comment. * Format * Fix
2017-11-14(Refactor) Split sygus term db (#1335)Andrew Reynolds
* Split explain utility, invariance tests. * Split extended rewriter. * Remove unused function. * Minor * Move generic term utilities to term_util. * Documentation, minor. * Make arguments private in eval invariance. * Document * More documentation. * Clang format. * Fix, improve. * Format * Address review. * Address missed comment. * Add line breaks * Format
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback