summaryrefslogtreecommitdiff
path: root/src/preprocessing
AgeCommit message (Collapse)Author
2021-04-02Remove template argument from `NodeBuilder`an/refactor/NodeBuilderAndres 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
2021-04-01Rename namespace CVC5 to cvc5. (#6258)Aina Niemetz
2021-03-31Rename namespace CVC4 to CVC5. (#6249)Aina Niemetz
2021-03-25Add missing includes. (#6207)Gereon Kremer
This PR adds includes that are missing from source files, but currently provided by other includes. This mostly concerns <sstream> which is currently included by the statistics, which will change in the future.
2021-03-16[proof-new] Renaming proof option to be in sync with SMT-LIB (#6154)Haniel Barbosa
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-09Remove logic request (#6089)Andrew Reynolds
This removes use of the logic request utility. It generally bad practice to change the logic dynamically, e.g. during preprocessing, since it makes it so that CVC4 does not properly initialize. We now insist that logic is changed upfront in set_defaults. This is in preparation for the smt::Env class, which will change the ownership of logic.
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-05Remove partial UDIV/UREM operators. (#6069)Mathias Preiner
This commit removes the partial UDIV/UREM operator handling. BITVECTOR_UDIV and BITVECTOR_UREM are now total.
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-02Remove non-ASCII characters from source files. (#6039)Mathias Preiner
Make collect_tags.py more robust for non-ASCII characters.
2021-03-02Fix nightly errors. (#6034)Mathias Preiner
Fixes warnings with CVC4_FALLTHROUGH and -Werror for debug/production with gcc/clang. Clang detects that a CVC4_FALLTHROUGH after an Assert(false); is unreachable and issues a warning, while gcc issues a warning about an implicit fall-through if CVC4_FALLTHROUGH is not present.
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-26Move (optional) rewrite from TrustSubstitutionMap to SubstitutionMap. (#5992)Gereon Kremer
This PR adds optional rewriting to the SubstitutionMap class. Before, only the new TrustSubstitutionMap added optional rewriting, leading to unexpected inconsistencies between the two. In particular, cases exist where the substitution and the rewriting cancel each other (see #5943). This PR moves the optional rewriting from TrustSubstitutionMap into SubstitutionMap. While the former enables it by default, it is disabled by default for the latter and thus does not change current behavior. We now use this new option in an assertion in the non-clausal simplification. Fixes #5943.
2021-02-24Enable -Werror. (#5969)Mathias Preiner
2021-02-24Ensure static-learning adds rewritten assertions. (#5982)Gereon Kremer
The static-learning preprocessing sometimes added non-rewritten assertions, despite being used in a part of the preprocessor that assumes all assertions to be rewritten. This may then break other passes further down, in the case of #5729 the non-clausal simplification which explicitly asserts that assertions are rewritten. This PR rewrites the respective assertion properly in the static-learning pass. Fixes #5729.
2021-02-23Add interface to TheoryState for sort inference and facts (#5967)Andrew Reynolds
This eliminates the need for direct references to TheoryEngine from quantifiers and UF+cardinality. This PR also eliminates an unnecessary reference to TheoryEngine in TheoryModelBuilder and breaks a few more dependencies in quantifiers modules.
2021-02-22(proof-new) Change proof-new option to proof (#5955)Andrew Reynolds
Also moves several proof-specific options to proof_options.
2021-02-17Move methods from term util to quantifiers registry (#5916)Andrew Reynolds
Towards eliminating dependencies on quantifiers engine, and eliminating the TermUtil class. Note that QuantifiersModule had to be moved to its own file to avoid circular include dependencies.
2021-02-12Simplify and fix decision engine's handling of skolem definitions (#5888)Andrew Reynolds
This PR changes the front end of prop engine to distinguish input formulas from skolem definitions, which is required by the decision engine. This PR breaks the dependency of PropEngine on the AssertionsPipeline, as now the determining of whether an input formula is a skolem definition is handled externally, in SmtSolver. With this PR, we should not be required to satisfy skolem definitions that are not relevant based on the techniques already implemented in the decision engine. Currently, we are not distinguishing input formulas from skolem definitions properly, meaning we assert more literals than we need to. This also simplifies related interfaces within decision engine. We should test this PR with --decision=justification on SMT-LIB.
2021-02-02Cleanup some includes (#5847)Andrew Reynolds
In particular, theory_engine.h is included many places spuriously. A few blocks of code changed indentation, updated to guidelines.
2021-01-28Always theory-preprocess lemmas (#5817)Andrew Reynolds
This PR makes it so that theory-preprocessing is always called on lemmas. It simplifies the proof production in the theory preprocessor accordingly. Additionally, it ensures that our theory-preprocessor is run on lemmas that are generated from term formula removal. Previously, this was not the case and in fact certain lemmas (e.g. literals within witness terms that are not in preprocessed form) would escape and be asserted to TheoryEngine. This was uncovered by a unit test failure, the corresponding regression is added in this PR. It adds a new interface removeItes to PropEngine which is required for the (deprecated) preprocessing pass removeItes. This PR now makes the lemma propery PREPROCESS obsolete. Further simplification is possible after this PR in non-linear arithmetic and quantifiers, where it is not necessary to distinguish 2 caches for preprocessed vs. non-preprocessed lemmas.
2021-01-27Split pattern term selector from trigger (#5811)Andrew Reynolds
This separates the utilities for selecting pattern terms from the Trigger class itself. This includes a PatternTermSelector, which implements the techniques for selecting the pool of pattern terms, and TriggerTermInfo which contains basic information about pattern terms. It makes minor refactoring to make the PatternTermSelector class more than just static methods, e.g. it is now a configurable object that selects pattern terms. This makes some of the methods take fewer arguments. More refactoring is possible, to be addressed on future PRs.
2021-01-15Implement --no-strings-lazy-pp as a preprocessing pass (#5777)Andrew Reynolds
This option eliminates extended functions in strings eagerly. This was incorrectly done at ppRewrite previously, which should not add lemmas. Instead, this makes this technique into a preprocessing pass. To do this, the interface for the strings preprocessor was cleaned to have fewer dependencies, and made to track a cache internally. Fixes #5608, fixes #5745, fixes #5767, fixes #5771, fixes #5406.
2021-01-14Updates to theory preprocess equality (#5776)Andrew Reynolds
This makes 3 changes related to arithmetic preprocessing of equalities which revert to the original behavior of master before a129c57. For background, the commit a129c57 unintentionally changed the default behavior slightly in 3 ways (each corrected in this PR), which led a performance regression on QF_LIA in current master. The 3 fixes are: (1) Rewrite equalities should be applied as a post-rewrite, not a pre-rewrite in the theory-rewrite-eq preprocessing pass. This is particularly important for equalities between ITE terms that contain other equalities recursively. (2) theory-rewrite-eq should apply after rewriting and just before the normal theory preprocessing. (3) The arith-brab test should call ppRewrite on the arithmetic equality it introduces, as it has a choice of whether to eliminate the equality before the lemma is sent out.
2021-01-13Do not call ppRewrite on Boolean equalities (#5762)Andrew Reynolds
Was causing arithmetic to process a Boolean equality when --arith-rewrite-equalities is true. Fixes #5761.
2021-01-11Further simplifications in preparation for removing Expr layer (#5756)Andrew Reynolds
This deletes variable flags from NodeManager::mkVar and moves ExprManager sort flags to NodeManager. These flags are used for determining when a variable or sort should be printed via the old dump infrastructure. The old dump infrastructure is simplified in this PR accordingly. This PR should preserve behavior of the previous dumping with a minor exception that the internal trace "declarations" will also included symbols introduced from define-fun. This will be further refactored later. This is in preparation for removing the includes expr.h/expr_manager.h from node_manager.h.
2021-01-09Strings arith checks preprocessing pass: step 2 (#5750)yoni206
We are adding a preprocessing pass that simplifies arithmetic constraints related to strings. For example, len(s) >= 0 would be replaced by true. This will make use of CVC4::theory::strings::ArithEntail::check. This PR is the second step. It includes the implementation of the main function, as well as unit tests for it. A subsequent PR will add a user-level option that will turn on this preprocessing pass, as well as regression tests.
2021-01-08bv-to-int: avoid binarizing nodes twice (#5749)yoni206
In bv-to-int, we first binarize the applications of associative-commutative operators (like bvadd etc.). With this PR, we first check whether we already binarized a node, and only if we didn't, we perform binarization.
2021-01-06strings arith checks preprocessing pass: step 1 (#5747)yoni206
We are adding a preprocessing pass that simplifies arithmetic constraints related to strings. For example, len(s) >= 0 would be replaced by true. This will make use of CVC4::theory::strings::ArithEntail::check. This PR is the first step. It only includes the preprocessing pass infrastructure, with an empty implementation of the main function StrLenSimplify::simplify. It also adds the pass to the registry. The implementation of this function is not complicated, but is left for a future PR in order to keep the PR short. Future PRs will include an implementation of the main function, tests, and a command line option to turn on the pass.
2020-12-24[proof-new] Only use old proofs for unsat cores if no proof new (#5725)Haniel Barbosa
Now the old proofs are used for unsat cores only if proofNew is disabled. Later commits will generate unsat cores from the new proofs when requested. Eventually we will compare them and when we confirm the new unsat core generation is better we will delete the old one. This also does some minor refactoring in some preprocessing. No behavior is changed.
2020-12-22Make theory preprocess rewrite equalities a preprocessing pass (#5711)Andrew Reynolds
Some theories rewrite equalities during ppRewrite. An example is arithmetic with the option arith-rewrite-eq, which rewrites (= x y) to (and (>= x y) (<= x y)) during theory preprocessing. This PR makes it so that ppRewrite is only called on equalities in preprocessing, during a new preprocessing pass "TheoryRewriteEq". On the other hand, ppRewrite is never called on new equalities generated in lemmas from TheoryEngine. In detail, the motivation for this change: (1) Rewriting equalities during ppRewrite is dangerous since it may break invariants wrt theory combination. In particular, equalities in splitting lemmas originating from theory combination must not be theory-preprocessed, or else we may be non-terminating or solution unsound. This can happen if a theory requests a split on (= x y) but is not notified of this atom when another theory rewrites (= x y) during ppRewrite. (2) After this PR, we can simplify our policy for all lemmas generated, in particular, we can say that all lemmas must be theory preprocessed before their literals are asserted to TheoryEngine. This is now possible as the invariant cannot be broken (theoryRewriteEq is relegated to the preprocessor, which is only applied once). This will make LemmaProperty::PREPROCESS obsolete, which in turn will simplify several lemma caches for nonlinear and quantifiers. It will also significantly simplify proof production for the theory preprocessor (which maintains two stacks of utilities for preprocessed vs non-preprocessed lemmas). (3) Simplifications to the above policy will make it significantly easier to implement theory-preprocessing apply when literals are asserted. It is currently not possible to implement this in a coherent way without tracking which literals were a part of lemmas marked as "do not theory-preprocess".
2020-12-21Move ownership of theory preprocessor to TheoryProxy (#5690)Andrew Reynolds
With this PR, TheoryEngine is independent of theory preprocessing. All theory preprocessing is handled at the level of PropEngine. No significant behavior changes in this PR. The next step will make theory preprocessing not mandatory in preprocessing, and optionally done instead at the time when literals are asserted to TheoryEngine.
2020-12-16Simplify preprocessing (#5647)Andrew Reynolds
This simplifies preprocessing so that the only call to theory-preprocess and ite-removal is at the very end. (One exception is early-theory-pp which is used by default in combination with ite-simp to maintain the performance on QF_LIA/nec). This is in preparation for making theory preprocessing happen lazily, post-CNF conversion. @HanielB has done SMT-LIB performance runs, see below.
2020-12-16Move ownership of term formula removal to theory preprocessor (#5670)Andrew Reynolds
This is work towards refactoring ITE removal (more generally, term formula removal) so that it happens at a configurable time, preferably post-CNF conversion. This moves the TermFormulaRemover to the TheoryPreprocessor and changes several interfaces as a consequence of this move. The next step will move the TheoryPreprocessor inside prop::TheoryProxy. There are no behavior changes to solving in this PR. One aspect of CheckModels is simplified.
2020-12-15Consolidate basic sygus utilities regarding sygus conjectures (#5421)Andrew Reynolds
This is required for new work on generalizing CAV 2015 single invocation techniques. It adds a new system of marking solutions for synthesis conjectures as attributes, which will be used as a way of eliminating functions from a conjecture while still preserving their solution in a response to check-synth.
2020-12-08ite_utilities: Fix infinite loop in compressTerm. (#5629)Aina Niemetz
Fixes #4610.
2020-12-08bv-to-int: Expand definitions of bvudiv and bvurem during bv-to-int ↵yoni206
preprocessing pass (#5620) #5544 enforces expandDefinition not to run before preprocessing. The bv-to-int preprocessing pass used to rely on expandDefinition to replace BITVECTOR_UDIV and BITVECTOR_UREM with their _TOTAL versions. This PR performs the replacement in the preprocessing pass itself. A regression that timed out is now fixed and is brought back to the regressions.
2020-12-07Add bitwise refinement mode for IAND (#5328)makaimann
Adds an option to do "bitwise" comparisons in the lazy IAND solver. Instead of creating an exact match for the value of a term using a sum, this would lazily fix groups of bits using integer extracts (divs and mods) when the abstract and concrete values differ at those bits. For example, with a 1-bit granularity, you might learn a lemma like: ((_ iand 4) x y), value = 1 actual (2, 3) = 2 bv-value = #b0001 bv-actual (#b0010, #b0011) = #b0010 IAndSolver::Lemma: (let ((_let_1 ((_ iand 4) x y))) (and (and true (= (mod _let_1 2) (ite (and (= (mod x 2) 1) (= (mod y 2) 1)) 1 0))) (= (mod (div _let_1 2) 2) (ite (and (= (mod (div x 2) 2) 1) (= (mod (div y 2) 2) 1)) 1 0)))) ; BITWISE_REFINE which is just forcing the bottom two bits of the iand operator result to implement bitwise-AND semantics.
2020-12-04Use NodeDfsIterable for makeBinary (#5595)Alex Ozdemir
Replaces the manual dag traversal in BVToInt::makeBinarywith NodeDfsIterable. This is a subset of the changes in #4176, updated to apply to master.
2020-12-02Update copyright headers.Aina Niemetz
2020-12-02Rename macro Message to CVC4Message. (#5576)Aina Niemetz
2020-11-18Minor cleanup of SmtEngine (#5450)Andrew Reynolds
2020-11-14(proof-new) Proofs for non-clausal simplification (#5409)Andrew Reynolds
Adds proof support in non-clausal simplification, connecting the proofs from circuit propagator.
2020-10-21(proof-new) Make theory preprocessor user-context dependent (#5296)Andrew Reynolds
Previously, theory preprocessing cache was manually cleared whenever the theory preprocess pass was run. However, proofs for theory preprocessing required to be alive for the remainder of the user context. This PR changes theory preprocessing so that both the cache and proofs in theory preprocessing are user-context dependent. This PR also makes the theory preprocess pass proof producing.
2020-10-21(proof-new) Make circuit propagator proof producing (#5318)Gereon Kremer
This PR uses the proofs from #5301 to actually produce proofs from the circuit propagator.
2020-10-20(proof-new) Update add lazy step interface in LazyCDProof (#5299)Andrew Reynolds
Ensuring closed proofs should not be enabled by default, it is actually not used very often as a whole. Moreover, the "trust id" argument is the most useful argument and hence should come as the 3rd argument. This updates all uses of addLazyStep for the change in interface, also changes term conversion generator which had a similar issue with default arguments. Notice that some calls to addLazyStep were checking closed but without providing a debug string, these I've left alone (they no longer check closed).
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback