summaryrefslogtreecommitdiff
path: root/src/theory/strings/skolem_cache.cpp
AgeCommit message (Collapse)Author
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-05-27Fix `str.replace_re` and `str.replace_re_all` (#6615)Andres Noetzli
Fixes #6057. The reductions of `str.replace_re` and `str.replace_re_all` were not correctly enforcing that the operations replace the _first_ occurrence of some regular expression in a string. This commit fixes the issue by introducing a new operator `str.indexof_re(s, r, n)`, which, analoguously to `str.indexof`, returns the index of the first match of the regular expression `r` in `s`. The commit adds basic rewrites for evaluating the operator as well as its reduction. Additionally, it converts the reductions of `str.replace_re` and `str.replace_re_all` to use that new operator. This simplifies the reductions of the two operators and ensures that the semantics are consistent between the two.
2021-05-12Ensure sequences of Booleans generate Boolean term variable skolems when ↵Andrew Reynolds
applicable (#6529) Fixes #6510. This PR also eliminates a deprecated variant mkBooleanTermVariable from SkolemManager.
2021-04-13Formalize more skolems (#6307)Andrew Reynolds
This formalizes more skolems in preparation for moving Theory::expandDefinitions to Rewriter::expandDefinitions. It also adds proof support for datatypes purification.
2021-04-12Refactor and update copyright headers. (#6316)Aina Niemetz
2021-04-07Replace calls to NodeManager::mkSkolem with SkolemManager::mkDummySkolem (#6291)Andrew Reynolds
This is in preparation for refactoring skolem creation throughout the code base to improve proofs and migrate Theory::expandDefinitions to Rewriter::expandDefinitions. This PR also eliminates some unused code in TheoryArithPrivate. Followup PRs will start formalizing/eliminating calls to mkDummySkolem.
2021-04-01Rename namespace CVC5 to cvc5. (#6258)Aina Niemetz
2021-03-31Rename namespace CVC4 to CVC5. (#6249)Aina Niemetz
2021-03-09Update copyright headers to 2021. (#6081)Aina Niemetz
2021-03-08(proof-new) Separating optimizations for strings skolem caching (#6064)Andrew Reynolds
This PR ensures that several optimizations are not performed in the reference implementation of skolem sharing (d_useOpts=false). This is to ensure that the many of the rules in the strings proof checker do not depend on the rewriter. These errors were caught by the LFSC proof checker.
2020-12-16(proof-new) Use bound variable manager (#5679)Andrew Reynolds
This uses BoundVarManager for several key places where bound variables are introduced, including for array extensionality witness terms, string preprocessing, quantifiers rewriting, and skolemization. This is motivated by making certain steps in solving deterministic for the sake of proofs, and gives a more consistent pattern in general for constructing bound variables.
2020-12-08Proper implementation of expand definitions for sequences (#5616)Andrew Reynolds
Expand definitions for sequences was wrong in two ways: (1) we replaced str.from_code with a witness term. This led to it being unevaluatable in models. (2) we did not handle seq.nth, meaning its model value was unevaluatable if it was out of bounds. Now it evaluates the value of the uninterpreted function we replace with. This corrects both issues and adds a regression to demonstrate both kinds of terms evaluate correctly. To do this, I added a helper function to skolem cache as well as a new (internal-only) kind SEQ_NTH_TOTAL. Notice applications of this kind should only be used for model evaluation. Notice this fixes several check-model warnings in the regressions. It still does not fix others since other things must be corrected for model evaluation (e.g. expandDefinitions must be applied on theory assertions for --debug-check-models). This will be done in later PRs.
2020-09-22Update copyright header script to support CMake and Python files (#5067)Mathias Preiner
This PR updates the update-copyright.pl script to also update/add copyright headers to CMake specific files. It further fixes a small typo in the header.
2020-06-16Update copyright headers.Aina Niemetz
2020-06-05(proof-new) Rename ProofSkolemCache to SkolemManager (#4556)Andrew Reynolds
This PR changes the design of ProofSkolemCache so that it has facilities for tracking proofs. This is required so that the term formula removal pass can be made proof-producing. This makes it so that ProofSkolemCache is renamed to SkolemManager, which lives in NodeManager. Creating (most) skolems must be accompanied by a corresponding ProofGenerator that can provide the proof for the existential corresponding to their witness form. Further updates will include refactoring the mkSkolemExists method of SkolemManager so that its contract wrt proofs is simpler. Once all calls to mkSkolem go through the standard interface, then NodeManager::mkSkolem will be moved to SkolemManager::mkSkolemInternal.
2020-05-26(proof-new) Updates to strings skolem cache. (#4524)Andrew Reynolds
This PR makes strings skolem cache call the ProofSkolemCache. This is required for proper proof checking, as it makes all skolems be associated with their formal definition, encapsulated by a witness term. It furthermore makes skolem sharing more uniform and aggressive by noting that most string skolems correspond to purification variables (typically for some substr term). A purification variable for a term that rewrites to a constant can be replaced by the constant itself. It also introduces an attribute IndexVarAttribute which is used to ensure reductions involving universal variables are deterministic.
2020-04-30Remove skolem share involving pre_first_ctn. (#4423)Andrew Reynolds
This fixes a soundness issue in strings caused by an incorrect skolem share. This adds a regression that corresponds to the rewrite that this skolem share was justified by, which is "sat" (the rewrite does not hold). This benchmark in fact was answered "unsat" by CVC4 prior to this PR.
2020-04-03Split sequences rewriter (#4194)Andrew Reynolds
This is in preparation for making the strings rewriter configurable for stats. This moves all utility functions from SequencesRewriter to a proper place. This includes three new groupings of utility functions: those involving arithmetic entailments, those involving string entailments, those involving regular expression entailments. Here, "entailments" loosely means any question regarding a (set of) terms or formulas. No major code changes. Added some missing documentation and lightly cleaned a few blocks of code in cpp.
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.
2019-06-18 Strings: More aggressive skolem normalization (#2761)Andres Noetzli
This PR makes the skolem normalization in the string solver quite a bit more aggressive by reducing more skolems to prefix and suffix skolems. Experiments show that this PR significantly improves performance on CMU benchmarks.
2019-03-26Update copyright headers.Aina Niemetz
2018-11-28Improve skolem caching by normalizing skolem args (#2723)Andres Noetzli
In certain cases, we can share skolems between similar reductions, e.g. `(str.replace x y z)` and `(str.replace (str.substr x 0 n) y z)` because the first occurrence of `y` in `x` has to be the first occurrence of `y` in `(str.substr x 0 n)` (assuming that `y` appears in both, otherwise the value of the skolems does not matter). This commit adds a helper function in the skolem cache that does some of those simplifications.
2018-11-21Support string replace all (#2704)Andrew Reynolds
2018-10-16Improve strings reductions including skolem caching for contains (#2641)Andrew Reynolds
2018-09-17More aggressive skolem caching for strings, document and clean preprocessor ↵Andrew Reynolds
(#2478)
2018-09-14Add Skolem cache for strings, refactor length registration (#2457)Andrew Reynolds
This PR is in preparation for doing more aggressive caching of skolems (for example, in the strings preprocessor). It refactors sendLengthLemma -> registerLength, which unifies how length lemmas for skolems and other string terms are handled.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback