summaryrefslogtreecommitdiff
path: root/src/theory/strings
AgeCommit message (Collapse)Author
2021-04-14Rename public and private headers in src/include. (#6352)Aina Niemetz
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-12Strings: Move implementation of type rules from header to .cpp file. (#6334)Aina Niemetz
2021-04-12Fix computation of whether a type is finite (#6312)Andrew Reynolds
This PR generalizes TypeNode::isFinite / TypeNode::isInterpretedFinite with TypeNode::getCardinalityClass. It then uses this method to fix our computation of when a type should be treated as finite. Fixes #4260, fixes #6100 (that benchmark now says unknown without an error).
2021-04-12Refactor and update copyright headers. (#6316)Aina Niemetz
2021-04-09Rename CVC4_ macros to CVC5_. (#6327)Aina Niemetz
2021-04-09Rename CVC4__ header guards to CVC5__. (#6326)Aina Niemetz
2021-04-09Add identifiers for extended function reductions (#6314)Andrew Reynolds
This adds identifiers for extended function reductions, which are reasons for why an extended term no longer needs to be processed. The motivation is help understand check-model failures. This PR adds identifiers to the ExtTheory utility. It also cleans up some unused parts of this utility. Some blocks of code changed indentation in this class.
2021-04-08Add identifiers for sources of incompleteness (#6311)Andrew Reynolds
This PR classifies all internal kinds of incompleteness as identifiers. It makes it so TheoryEngine records an identifier when its incomplete flag is set. The next step will be to possibly communicate this value to the user.
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-06Remove template argument from `NodeBuilder` (#6290)Andres Noetzli
Currently, NodeBuilder takes a single template argument: An integer that determines the expected number of arguments. This argument is used to determine the size of the d_inlineNvChildSpace array. This array is used to construct nodes inline. The advantage of this is that we don't have to allocate a NodeValue on the heap for the node under construction until we are sure that the node is new. While templating the array size may save some stack space (or avoid a heap allocation if we statically know that we a fixed number of children and that number is greater than 10), it complicates the code and leads to longer compile times. Thus, this commit removes the template argument and moves some of the NodeBuilder code to a source file for faster compilation. CPU build time before change (debug build): 2429.68s CPU build time after change (debug build): 2228.44s Signed-off-by: Andres Noetzli noetzli@amazon.com
2021-04-06Remove stdPrintAscii option (#6280)Andrew Reynolds
Fixes #4179.
2021-04-05Fix spurious antecedant for symbolic regular expressions (#6284)Andrew Reynolds
Fixes #6271. This was triggered by recent fixes, this fixes solution soundness issues with symbolic regular expressions due to spuriously included antecedants, which made lemmas SAT-context dependent while being cached as user-context dependent.
2021-04-05[proof-new] Registering proof checkers uniformly from the SMT solver (#6275)Haniel Barbosa
Each theory has its own proof checker, responsible for checking the rules pertaining to that theory. The main proof checker uses these specialized checkers. Previously the main proof checker (of the proof node manager used across the SMT solver) was connected to these theory proof checkers during initialization of the theory. This commit adds an interface to the theories for retrieving its proof checker (analogous to how one retrieves the rewriter of a theory) which is used by a new method in the theory engine to register a theory proof checker to a given proof checker according to a theory id. This is in preparation for the new unsat cores based on proofs.
2021-04-03Disable substring component contains in strip endpoints (#6266)Andrew Reynolds
Fixes the first benchmark from #6203.
2021-04-02Fix case where RE unfolding generates a trivially true lemma (#6267)Andrew Reynolds
An RE unfolding lemma may rewrite to true for tautological RE memberships that our rewriter does not rewrite the membership to true. An example is (str.in_re x (re.* (re.union (str.to_re "A") (str.to_re x))). This PR ensures we are robust to these cases. This fixes benchmarks 3-5 from #6203. Benchmark 3 is added here, 4-5 time out.
2021-04-01Simplify caching of regular expression unfolding (#6262)Andrew Reynolds
This ensures that we always cache regular expressions in a user-dependent manner. Previously, we were erroneously caching in a SAT-dependent way for very rare cases when non-constant regular expressions were used. Since we never dependent on current assertions for the unfolding, there is no need to cache in the SAT context. This fixes the second benchmark from #6203. This PR also improves our traces for checking models in strings.
2021-04-01Rename namespace CVC5 to cvc5. (#6258)Aina Niemetz
2021-03-31Rename namespace CVC4 to CVC5. (#6249)Aina Niemetz
2021-03-29Move decision manager into theory inference manager (#6231)Andrew Reynolds
This makes it so that the decision manager is accessible from TheoryInferenceManager. This is work towards breaking circular dependencies in quantifiers, and also helps simplify several other dependencies in e.g. UF and datatypes.
2021-03-21Simplify strings term registration (#6174)Andrew Reynolds
String terms may enter into the equality engine without appearing in assertions, due to eager context-dependent simplification internal to the equality engine (--strings-eager-eval). In rare cases, we did not catch when a new string constant appeared in the equality engine, meaning it would not be marked as relevant leading to bogus models in incremental mode. This makes it so that proxy variables are stored in a user-context dependent manner, which impacts when terms marked as having a proxy variable are registered. The PR also simplifies our policies for when string terms are registered slightly. Fixes #6072.
2021-03-20Improved tracing for equivalence classes of EE (#6169)Andrew Reynolds
Helps debugging model issues.
2021-03-16Further standardization of strings statistics (#6128)Andrew Reynolds
Also eliminates use of raw output channel in strings.
2021-03-15Fix rewrite for double replace (#6152)Andrew Reynolds
Fixes #6142.
2021-03-15Replace HistogramStat by IntegralHistogramStat (#6126)Gereon Kremer
This PR uses IntegralHistogramStat instead of HistogramStat when appropriate, that is everywhere.
2021-03-11First refactoring of statistics classes (#6105)Gereon Kremer
This PR does a first round of refactoring on the statistics, in particular the Stat class and derived classes. It significantly shrinks the class hierarchy, modernizes some code (e.g. use std::chrono instead of clock_gettime), removes unused features (e.g. nesting of statistics) and does some general cleanup and consolidation. Subsequent PRs are planned to change the ownership model (right now every module owns the Stat object) which makes the whole register / unregister mechanism obsolete.
2021-03-11Delete Expr layer. (#6117)Aina Niemetz
2021-03-11(proof-new) Clean up uses of witness with skolem lemmas (#6109)Andrew Reynolds
This ensures we do not return WITNESS terms in response to ppRewrite. This makes standard utility methods in SkolemLemma to help make this easy. It also removes TheorySetsPrivate::expandDefinitions, which was returning WITNESS in response to expandDefinitions, which is no longer permitted.
2021-03-10(proof-new) Update ppRewrite to use skolem lemmas (#6102)Andrew Reynolds
This is required for proofs. The internal calculus no longer uses witness forms for reasoning, and hence we cannot return witness terms in ppRewrite. This is required to fix a debug failure, as well as making life easier on external proof conversions. As a result of this PR, for example, given (P a) as input to ppRewrite, previous we returned: (P (witness ((x T)) (A x))) now we return: (P k), with skolem lemma ( (A k), k ) Followup PRs will remove the use of WITNESS in ppRewrite (e.g. in sets and strings); this PR modifies arithmetic to not return WITNESS in response to ppRewrite.
2021-03-10Fix extended equality rewrite involving replace. (#6104)Andrew Reynolds
Fixes #6075.
2021-03-09Some more cleanup of includes (#6083)Gereon Kremer
This PR does some more cleanup of the includes.
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.
2021-03-08Do not process conjunctions as facts in strings (#6065)Andrew Reynolds
This changes things so we process inferences with AND conclusions as lemmas always. This fixes #6056, that benchmark times out.
2021-03-03More cleanup of includes to reduce compilation times (#6037)Gereon Kremer
Similar to #6031, this PR implements suggestions from iwyu to reduce the number of includes in header files by introducing forward declarations and moving includes to source files.
2021-03-02Clean up includes to reduce compile times (#6031)Gereon Kremer
This PR cleans up a ton of includes, based on the suggestions of iwyu. Mostly, it removes includes from header files in favor of forward declarations and adds includes to source files.
2021-02-25(proof-new) Fix regular expression unfolding under substitution (#5958)Andrew Reynolds
This case was previously unhandled and exercised by a recently added regression.
2021-02-22Require length-in-conclusion form for strings inferences (#5953)Andrew Reynolds
Previously, it was optional whether to put length constraints in conclusion for deq string inferences. However, due to optimizations in skolem caching, it is now required to guard these length constraints. It furthermore changes the policy to not ignore the lengths for the registered skolem, since it may be shared elsewhere. Fixes #5940. Notice that proof-new already requires this option to be enabled when proofs are enabled. Hence, this will simplify proof-new when merged.
2021-02-19Refactoring theory inference process (#5920)Andrew Reynolds
This PR refactors TheoryInference so that it is not responsible for calling back into InferenceManager, instead it sets data so that InferenceManagerBuffered has enough information to do this itself. It also makes the decision of whether to cache lemmas in theory inference manager a global choice per-theory instead of per-lemma.
2021-02-19Fix rewrite for contains over replace (#5924)Andrew Reynolds
Fixes model soundness issue (fixes #5915).
2021-02-19Remove string stat for inferences (#5932)Andrew Reynolds
This is now subsumed by the general stat in TheoryInferenceManager
2021-02-18Add statistic for InferenceId to TheoryInferenceManager. (#5913)Gereon Kremer
This PR uses the IntegralHistogramStat to obtain statistics about the sent inferences within the TheoryInferenceManager. All theories are adapted to provide a proper name (prefix) for the name of the statistic.
2021-02-11Make most methods of TheoryInferenceManager expect an InferenceId. (#5897)Gereon Kremer
This PR makes most methods of the TheoryInferenceManager expect an InferenceId. All classes that inherit from TheoryInferenceManager are adapted accordingly and InferenceIds are passed everywhere. In some cases, there are no appropriate InferenceIds yet. We use InferenceId::UNKNOWN for the time being and introduce proper values in future PRs. The InferenceIds are not yet used, but will be used for statistics and debug output.
2021-02-11Add InferenceId member to TheoryInference, adapt all derived classes. (#5894)Gereon Kremer
This PR adds a new InferenceId member to the TheoryInference class. All classes derived from TheoryInference are adapted accordingly.
2021-02-11Merge InferenceIds into one enum (#5892)Gereon Kremer
This PR is the first step in consolidating the various variants of Inferences, InferenceIds and InferenceManagers of the theories. It merges all InferencedIds into one global enum and makes all theories use them.
2021-02-11Fix spurious assertion failure in regexp normalization (#5852)Andrew Reynolds
Fixes #5816.
2021-02-10Simplify method for inferring proxy lemmas in strings (#5789)Andrew Reynolds
This PR simplifies our heuristic for inferring when an explanation for a strings lemma can be minimized based on proxy variable definitions. In particular, we do not turn solved equalities for proxy variables into substitutions. This aspect of the heuristic is incompatible with the new eager solver work, and moreover is buggy since substitutions should not be applied within string terms. The latter was leading the incorrect models on the 2 issues fixed by this PR. Current results on the eager solver on SMT-LIB shows this change has very little performance impact. Fixes #5692, fixes #5610.
2021-02-08Fix disequality between seq.unit terms (#5880)Andrew Reynolds
This adds a missing inference for disequality between seq.unit terms, which was not handled previously. Fixes #5666.
2021-02-08Avoid spurious traversal of terms during preregistration (#5860)Andrew Reynolds
This simplifies a few places in the code which unecessarily traverse terms during preregistration (which already traverses terms).
2021-01-24rename InferInfo::d_newSkolem to InferInfo::d_skolems (#5799)mudathirmahgoub
Rename strings::InferInfo::d_newSkolem to InferInfo::d_skolems to match bags::InferInfo:d_skolems
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback