summaryrefslogtreecommitdiff
path: root/src/theory
AgeCommit message (Collapse)Author
2021-09-14bv: Unify bit-blasting code for udiv and urem. (#7188)Mathias Preiner
This refactor additionally removes the caching for urem/udiv cases when bit-blasting udiv/urem and eliminates the only rewrite() calls in the bit-blaster. Caching is not required since repeated calls to udiv/urem with the same arguments will produce the same circuit. Further, the rewrite() calls during bit-blasting would further complicate the recording of bit-blasting proofs and hence is removed.
2021-09-14proofs: Properly track pre- and post-rewrites in bbAtom(). (#7147)Mathias Preiner
This commit refactors the proof bit-blaster to properly track the pre- and post-rewrites in bbAtom(). The individual bit-blast steps are recorded in a term conversion proof generator. The overall bit-blast proof is stored in a BitblastProofGenerator, which tracks the pre- and post-rewrite and includes the bit-blast proof of the TCPG.
2021-09-13Remove context getters from `TheoryState` (#7174)Andres Noetzli
This removes TheoryState::getSatContext() and TheoryState::getUserContext().
2021-09-13Connect difficulty manager to TheoryEngine (#7161)Andrew Reynolds
This also introduces the produceDifficulty option which is analogous to produceUnsatCores. It requires another unsat cores mode PP_ONLY, indicating that we are only tracking proofs of preprocessing. This option should perhaps be renamed to proofMode instead of unsatCoresMode, since its use is more general than for unsat cores. This will be addressed in a future refactoring.
2021-09-13FP: Rename FpConverter to FpWordBlaster. (#7170)Aina Niemetz
2021-09-11Use StatisticsRegistry from Env (#7166)Gereon Kremer
This commit better integrates the StatisticsRegistry with the environment. It makes the registry an `EnvObj` itself and adds a getter to `EnvObj` to get the registry. It also refactors parts of cvc5 to use this new mechanism to obtain the registry instead of using the (global, static) `smtStatisticsRegistry()` function.
2021-09-11bv: Move IsPowerOfTwo rule to preprocessing pass and use EnvObj. (#7179)Mathias Preiner
IsPowerOfTwo rule is specific to the BvIntroPow2 preprocessing pass and should not be a general bit-vector rewrite rule.
2021-09-10FP: Enable caching in the theory inference manager. (#7168)Aina Niemetz
2021-09-10bv: Use EnvObj::rewrite() and EnvObj::options() in NodeBitblaster. (#7172)Mathias Preiner
This PR is based on #7171
2021-09-10FP: Use EnvObj::rewrite() and options() in theory_fp. (#7169)Aina Niemetz
2021-09-10FP: Do not send trivial lemmas. (#7167)Aina Niemetz
Fixes #7002.
2021-09-10Use C++17 attributes (#7154)Andres Noetzli
Currently, we are using non-standard attributes. With C++17, all the attributes that we use regularly are now standardized. This commit replaces the compiler-specific attributes with standard ones.
2021-09-10bv: Use EnvObj::rewrite() and EnvObj::options() in BvSolver. (#7171)Mathias Preiner
2021-09-09Remove `TheoryState::getEnv()` (#7163)Andres Noetzli
2021-09-09Add difficulty manager (#7151)Andrew Reynolds
Towards supporting a (get-difficulty) command. This tracks an estimate of the difficulty of preprocessed assertions during solving. It will be connected to TheoryEngine (via RelevanceManager) in a followup PR.
2021-09-09Disable shared selectors for quantified logics without SyGuS (#7156)Andrew Reynolds
The use of shared selectors may have fairly negative effects when combined with E-matching. The issue is that it allows too many things to match. When shared selectors are disabled, a selector trigger like s(x) will only match terms that access the field of the constructor associated with s. When we use shared selectors, s(x) is converted to e.g. shared_selector_D_Int_1(x), which in turn matches applications of selectors of the same type over any constructor. This PR disables shared selectors when quantifiers are present and SyGuS is not used. It also disables shared selectors in single invocation subcalls, thus fixes #3109. It further makes a minor fix to the datatypes rewriter to ensure that rewritten form does not depend on options.
2021-09-09Remove `TheoryState::options()` (#7148)Andres Noetzli
This commit removes TheoryState::options() by changing more classes to EnvObjs.
2021-09-08Remove deprecated SyGuS method evaluateWithUnfolding (#7155)Andrew Reynolds
This was a predecessor to the evaluator and TermDbSygus::rewriteNode that is no longer necessary. This refactors the code so that evaluateWithUnfolding is replaced by rewriteNode as necessary throughout the SyGuS solver. Note that in a few places, the extended rewriter was being used where TermDbSygus::rewriteNode (which also evaluates recursive function definitions) should have been used.
2021-09-08Improve pre-skolemization, move quantifiers preprocess to own file (#7153)Andrew Reynolds
This also heavily refactors the preskolemization method (now in QuantifiersPreprocess), in preparation for it being enabled by default. This method previously was doing a tree traversal, it now maintains a visited cache. It makes minor cleanup to the dependencies of this method.
2021-09-08Towards standard usage of ExtendedRewriter (#7145)Andrew Reynolds
This PR: Adds extendedRewrite to EnvObj and Rewriter. Eliminates static calls to Rewriter::rewrite from within the extended rewriter. Instead, the use of extended rewriter is always through Rewriter, which passes itself to the ExtendedRewriter. Make most uses of extended rewriter non-static. I've added a placeholder method Rewriter::callExtendedRewrite for places in the code that call the extended rewriter are currently difficult to eliminate.
2021-09-08Add option for using bound inference for relevant assertions (#7152)Andrew Reynolds
The method for discarding assertions based on bound inference is quite expensive (40% of runtime) for some benchmarks with quantified formulas from Facebook. This adds an option to disable this, which is done by default for quantified logics.
2021-09-08Use rewriteViaMethod instead of accessing builtin proof checker (#7146)Andrew Reynolds
2021-09-07Use `EnvObj` methods instead of `Theory` methods (#7144)Andres Noetzli
This removes the methods `getEnv()`, `options()`, `getSatContext()`, and `getUserContext()` from the `Theory` class because they are now part of `EnvObj`. Additionally, this commit converts the inference managers to `EnvObj` because of there were some calls to retrieve the contexts from `Theory` in those classes.
2021-09-07sygus: Eliminate calls to Rewriter::rewrite. (#7142)Aina Niemetz
This derives sygus unification utility objects from EnvObj where necessary. There's one remaining occurrence of Rewriter::rewrite in sygus_unif_rl.cpp, which is a bit tricky to address and thus subject to a future PR.
2021-09-03EnvObj: Add options(), context(), userContext(). (#7137)Aina Niemetz
This further renames EnvObj::getLogicInfo to EnvObj::logicInfo.
2021-09-03Avoiding duplicate search in maps (#7055)MikolasJanota
This commit identifies a couple of scenarios where an operation required 2 searches into a map/hashmap and replaces them with a single search. This also makes the code shorter. Signed-off-by: Mikolas Janota <mikolas.janota@gmail.com>
2021-09-03sygus: Make more classes derive from EnvObj. (#7140)Aina Niemetz
2021-09-03Standardize Rewriter::rewriteViaMethod call (#7119)Andrew Reynolds
This moves the standard method for rewrites in proofs from TheoryBuiltinProofRuleChecker to Rewriter. The motivation for this change is to make various kinds of rewrite methods (standard rewrite, extended rewrite, extended equality rewrite, evaluate) accessible throughout the code in a standard way. After this PR, it is possible to know variants of the REWRITE proof rule application by having access to the rewriter, instead of having to get the builtin proof rule checker. Note that TheoryBuiltinProofRuleChecker::applyRewrite *cannot* be static since access to the rewriter is not longer permitted to be static. It also removes some unused infrastructure from Rewriter. Followup PRs will remove applyRewrite for TheoryBuiltinProofRuleChecker in favor of calling the rewriter directly.
2021-09-03Make quantifier module classes derive from EnvObj (#7132)Andrew Reynolds
2021-09-03sygus: Make CeSingleInv derive from EnvObj. (#7136)Aina Niemetz
This further reorders the header according to the code style guidelines.
2021-09-03theory: Have more classes in theory with reference to Env derive from ↵Aina Niemetz
EnvObj. (#7130)
2021-09-03theory: Have Theory and TheoryArith* derive from EnvObj. (#7128)Aina Niemetz
Note: the diff in theory.h is only huge because of small changes that caused huge reformat. The effective change is only that it now derives from EnvObj, does not have a member d_env (because it inherits it) and does not need getLogicInfo (because that's in EnvObj).
2021-09-02Remove more instances of ufHo (#7087)Andrew Reynolds
Towards replacing that option with a logic check throughout.
2021-09-02Remove unused `Backtracker` (#7115)Andres Noetzli
backtrackable.h was defining a datastructure Backtracker, which was a member in ArrayInfo and Info but it was not doing anything.
2021-09-02[Unit Tests] Fix bags rewrite test (#7114)Andres Noetzli
PR #7103 did not quite fix the unit test: The types of the lambda and the expected bags were still off. This fixes the unit test.
2021-09-02rewriter: Make rewriteEqualityExt non-static. (#7110)Aina Niemetz
More work towards getting rid of SmtEngine::currentSmtEngine and closing #3468.
2021-09-01Clean up TheoryEngine header according to code style guidelines. (#7107)Aina Niemetz
2021-09-01rewriter: Make registerTheoryRewriter non-static. (#7101)Aina Niemetz
More work towards getting rid of SmtEngine::currentSmtEngine and closing #3468.
2021-09-01rewriter: Make clearCaches non-static. (#7100)Aina Niemetz
This works towards getting rid of SmtEngine::currentSmtEngine and closing #3468.
2021-09-01Lazy proof reconstruction for strings theory solver (#7096)Andrew Reynolds
This makes it so that we call the strings::InferProofCons::convert lazily, instead deferring to a temporary, trusted STRING_INFERENCE rule. This decreases our average proof overhead on commonly solved instances from 64% to 58% on QF_S + QF_SLIA. It also reduces timeouts significantly, from 2010 to 1460. (Note these numbers were with a slightly extended version of this branch that includes other pending PRs for proofs). Also fixes one subtle issue where proof reconstruction was misusing sequential substitutions (leading to warnings during proof post-processing).
2021-08-31bv: Remove dump=bv-rewrites. (#7099)Aina Niemetz
This is work towards eliminating calls to currentSmtEngine. This dump mode will become obsolete with the DSL, and is thus now removed.
2021-08-31bv-to-int-module: implementations and stubs for translating operators (#7086)yoni206
This PR introduces most of the code for the translation of terms with operators. Some methods are left as stubs for future PRs. A unit test is added with sanity checks for all implemented operators.
2021-08-31Fix normal forms context-dependent simplification for strings (#7090)Andrew Reynolds
This corrects an issue in our context-dependent simplification which limited the cases it was applied. Previously, we were using a best content heuristic when it was applicable to compute the substitution, even if we were in an effort where normal forms had been computed. The latter should always be used if possible, since normal forms always have at least as much or more concrete components.
2021-08-30Add kind BAG_MAP and its type rule to bags (#6503)mudathirmahgoub
This PR adds kind BAG_MAP to bags.
2021-08-30Fix proof equality engine for "no-explain" premises (#7079)Andrew Reynolds
There was an inconsistency between when the equality engine would explain a literal and when we would provide a proof for it. This led to rare cases where we over zealously provided a proof for a fact that should have been an assumption in the theory lemma proof. This corrects the issue by ensuring that no-explain premises are explicitly marked via a new helper proof generator "AssumptionProofGenerator" which always supplies (ASSUME f) as the proof for f. This corrects some proof checking errors on string benchmarks.
2021-08-30Fix quantifiers dynamic split module for parametric datatypes (#7085)Andrew Reynolds
Fixes #6838.
2021-08-27Expand definitions in sygus operators at the SMT level (#7077)Andrew Reynolds
Eliminates another call to currentSmtEngine. This PR ensures we remember the mapping between operators that are embedded in sygus datatypes during preprocessing, instead of computing this within the sygus datatypes utilities when solving.
2021-08-27Add missing methods to Solver API for models (#7052)Andrew Reynolds
This adds the last two remaining API methods required for implementing the text output of get-model on the API side. A followup PR will implement GetModelCommand on the API side and eliminate the (last remaining) call to getSmtEngine() from the command layer. This PR does some minor reorganization of the model cores code to account for the new interface. It also removes a deprecated interface from TheoryModel.
2021-08-26Eliminate currentSmtEngine for subsolver calls (#7068)Andrew Reynolds
This eliminates another occurrence of smt::currentSmtEngine by making it required to pass options + logic for all subsolver calls.
2021-08-26Make datatype selector expansion to its own accessible method (#7069)Andrew Reynolds
This eliminates another call to currentSmtEngine. After this, there are only two remaining calls (one for normalizing sygus grammars wrt user define-funs, and the other for Rewriter::rewrite).
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback