summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-04-15Protype e-solver implementationesolverPrototypeAndres Noetzli
2021-02-01Simplify alpha equivalence module (#5839)Andrew Reynolds
This class uses a discrimination tree which can compute subsumption as well as alpha-equivalence. This class was initially designed to also support subsumption. However, we were only using this class for alpha-equivalence and hence (canonized) Node comparison suffices and the class can be simplified. It also makes minor cosmetic updates to the module. If we plan to support subsumption checking later, we will write a new module, and use this class https://github.com/CVC4/CVC4/blob/master/src/expr/match_trie.h which is a more mature version of the class deleted by this PR. Note: I verified that the new and old implementation was equivalent using a temporary AlwaysAssert.
2021-02-01Avoid calling the printers while converting sexpr to string. (#5842)Abdalrhman Mohamed
This PR modifies sexprToString to use Term::getString to get string constants instead of Term::toString, which depends on the output language. The previous behavior caused CVC4 to crash when AST is picked as the output language.
2021-02-01Fix BagsRewriter::rewriteUnionDisjoint (#5840)mudathirmahgoub
This PR fixes the implementation of (union_disjoint (union_max A B) (intersection_min A B)) =(union_disjoint A B). It also skips processed bags during model building.
2021-01-30Fix unguarded call to get representative (#5838)Andrew Reynolds
Introduced in 3234db4. Fixes #5837, that benchmark is now unknown. Adds an SMT-LIB benchmark that also crashes.
2021-01-29[proof-new] Connecting new unsat cores (#5834)Haniel Barbosa
Allows one to generate unsat cores from the new proof infrastructure. For new this is controlled by a new option, --check-unsat-cores-new.
2021-01-29Add bag inferences for operators: intersection, duplicate_removal, and empty ↵mudathirmahgoub
bags (#5832) This PR adds inferences for operators: intersection, duplicate_removal, and empty bags during post check. It also fixes a bug in SolverState::getElements
2021-01-29(proof-new) Distinguish pre vs post rewrites in term conversion proof ↵Andrew Reynolds
generator (#5833) This is work towards resolving two kinds of failures on proof-new: (1) Functional issues with proofs from the rewriter, in particular when a term pre-rewrites and post-rewrites to different things, (2) Conversion issues in theory-preprocessing, where all steps are assumed to be post-rewrites but some are in fact pre-rewrites. This leads to the term conversion proof generator proving something different than what is expected. A followup PR will simplify and fix proofs for theory-preprocessing.
2021-01-28Reorganize calls to quantifiers engine from SmtEngine layer (#5828)Andrew Reynolds
This reorganizes calls to QuantifiersEngine from SmtEngine. Our policy has changed recently that the SmtEngine layer is allowed to make calls directly to QuantifiersEngine, which eliminates the need for TheoryEngine to have forwarding calls. This PR makes this policy more consistent. This also makes quantifier-specific calls more safe by throwing modal exceptions in the cases where quantifiers are present. Marking "major" since we currently segfault when e.g. dumping instantiations in non-quantified logics. This PR makes it so that we throw a modal exception.
2021-01-28Remove regex header from cvc4cpp.cpp (#5826)mudathirmahgoub
This PR replaces the heavy hammer std::regex_match for checking numbers with string operations
2021-01-28Simplify lemma interface (#5819)Andrew Reynolds
This makes it so that TheoryEngine::lemma returns void not LemmaStatus. Currently, there was only one use of LemmaStatus by theory solvers, which was CEGQI using it as a way of getting the preprocessed form of a lemma. This makes it so that there is an explicit method in Valuation for getting the preprocessed form of a term + its skolems and their definition assertions. It also simplifies a few things, e.g. Valuation calls are forwarded to PropEngine instead of going through TheoryEngine. It fixes a few issues in TermFormulaRemoval related to getSkolems.
2021-01-28Use standard equality engine information in quantifiers state (#5824)Andrew Reynolds
This refactors quantifiers so that it uses the standard interfaces for setting up an equality engine and using it via TheoryState. This eliminates the need for several special interfaces including getMasterEqualityEngine, CombinationEngine::getCoreEqualityEngine, and most uses of EqualityQuery.
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-27Add option for whether to filter candidate rewrite pairs (#5825)Andrew Reynolds
This option should be disabled for the new sygus reconstruction algorithm on #5779.
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-27(proof-new) Improvements to quantifiers engine and instantiate interfaces ↵Andrew Reynolds
(#5814) This makes printing instantiations done at the SmtEngine level instead of deeply embedded within the Instantiate module. This provides much better flexibility for future uses of instantiations (e.g. how they are minimized in the new proof infrastructure). Note this PR breaks the functionality that instantiations are minimized based on the old unsat cores infrastructure (see the disabled regression). This will be fixed once proof-new is fully merged.
2021-01-26Thread proofs through arith channels & similar (#5818)Alex Ozdemir
Thread proofs through conflict/lemma storages & channels in TheoryArithPrivate d_acTmp d_approxCuts lemma output channel conflict output channel
2021-01-26Use term canonizer utility locally in quantifiers (#5823)Andrew Reynolds
Term canonization was used in two places, which are unrelated and don't need to share the instance. Also removes a few unnecessary methods from QuantifiersEngine.
2021-01-26Use standard conflict mechanism in quantifiers state (#5822)Andrew Reynolds
Work towards eliminating dependencies on quantifiers engine, this updates quantifiers module to use the standard SAT-context dependent flag in quantifiers state instead of the one in QuantifiersEngine. It also eliminates the use of a custom call to theoryEngineNeedsCheck.
2021-01-26Introduce quantifiers inference manager (#5821)Andrew Reynolds
This is the second prerequisite for eliminating dependencies on quantifiers engine. This PR threads a quantifiers inference manager through all modules in quantifiers that add lemmas. The code for adding lemmas in quantifiers engine will be migrated to this class.
2021-01-26Remove deprecated quantifiers modules (#5820)Andrew Reynolds
2021-01-26Refactor quantifiers engine initialization (#5813)Andrew Reynolds
This is a step towards breaking up the quantifiers engine. The key change is that QuantifiersEngine will not be passed as a pointer to the modules it contains. This PR makes it so that necessary modules take a QuantifiersState, which will eventually be extended as needed with additional query methods. For now, modules will take both until the dependencies on QuantifersEngine are removed. This required that QuantifiersEngine now lives in TheoryQuantifiers, instead of in TheoryEngine, since the QuantifiersEngine must be initialized with QuantifiersState, which is a member of TheoryQuantifiers. Now, TheoryEngine retrieves the QuantifiersEngine from TheoryQuantifiers prior to finishing initialization on theories.
2021-01-26Reestablishing support for define-sort (#5810)Haniel Barbosa
Presumable broken since 3ed42d7ab. This extends the API to have a substitute method for Sort that in needed for doing the Sort substitution in the case of define-sort. This fixes issue #5809.
2021-01-25Add proofs to TheoryArithPrivate::propagate (#5812)Alex Ozdemir
Specifically, add proofs to conflicts between (a) a propagation from the congruence manager and (b) a constraint from the main solver.
2021-01-25Refactor bags::SolverState (#5783)mudathirmahgoub
Couple of changes: SolverState now keep tracks of elements per bag instead of per type. bags::InferInfo now stores multiple conclusions (conjuncts). BagSolver applies upward/downward closures for bag elements
2021-01-25Ensure uses of ground terms in triggers are preprocessed and registered (#5808)Andrew Reynolds
This ensures ground terms in triggers are preprocessed and registered in the master equality engine. This avoids cases where our E-matching algorithm is incomplete where it should not be. Positive impact (+222-69) on SMT-LIB, 30 second timeout
2021-01-25Split inst match generator into multiple files (#5805)Andrew Reynolds
No code changes on this PR, only move + format.
2021-01-25Split E-matching strategies to own files (#5807)Andrew Reynolds
Code move + format only
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
2021-01-24 Initial cleaning of e-matching instantiation strategy (#5796)Andrew Reynolds
In preparation for splitting this into multiple files. No behavior changes in this PR.
2021-01-24Initial cleaning of triggers (#5795)Andrew Reynolds
In preparation for splitting trigger.h/cpp into multiple files. This updates the code to conform to guidelines. No major changes, apart from a heuristic related to "pure theory triggers" is deleted and simplified.
2021-01-24Initial cleaning of inst match generator (#5794)Andrew Reynolds
In preparation towards breaking this file up into multiple files. No code changes, only updates to conform to new guidelines.
2021-01-24(proof-new) Instantiation list utility (#5768)Andrew Reynolds
This is in preparation for refactoring the printing of instantiations. We will migrate the printing of instantiations (currently done in the Instantiate module within quantifiers engine) to somewhere more high level e.g. the SmtEngine or in the command layer. This will make the infrastructure for dumping instantiations much more flexible, as implemented on proof-new.
2021-01-24Add interface for getting preprocessed term (#5798)Andrew Reynolds
Several places, e.g. in quantifiers, requiring knowing what the theory-preprocessed form of a node is. This is required for an improvement to our E-matching algorithm, which requires knowing what the preprocessed form of ground subterms of triggers are. Note that I'm not 100% happy with adding a new interface to Valuation, but at the moment I don't see a better way of doing this. On the positive side, this interface will make a few other things (e.g. the return value of OutputChannel::lemma) obsolete.
2021-01-22[proof-new] Expanding MACRO_RESOLUTION in post-processing (#5755)Haniel Barbosa
Breaks down resolution, factoring and reordering. The hardest part of this process is making getting rid of the so-called "crowding literals", i.e., duplicate literals introduced during the series of resolutions and removed implicitly by the SAT solver. A naive removal via addition of premises to the chain resolution can lead to exponential behavior, so instead the removal is done by breaking the resolution and applying a factoring step midway through. This guarantees non-exponential behavior.
2021-01-21Add div, mod, abs in non-strict parsing mode (#5793)Andrew Reynolds
The recent change to the parser currently breaks our performance on several critical applications, including the use of CVC4 in Facebook. We should only throw a parse error for div in linear logics when strict mode is enabled.
2021-01-20arith: Proofs for Diophantine cuts (#5792)Alex Ozdemir
Thread proofs through the diophantine "cutting" lemma generator.
2021-01-20Refactoring the single invocation solver (#5706)Andrew Reynolds
This does an intermediate refactoring of the single invocation solver to make a few things clearer and to add preliminary support for functions that have been marked as solved by external techniques. This is in preparation for generalizing the CAV 2015 single invocation techniques.
2021-01-20Fix type issues with relevant domain computation (#5788)Andrew Reynolds
This fixes 2 issues with relevant domain type computation, the first involving arithmetic INST_CONSTANT that do not belong to the current quantified formula being solved for in a monomial sum, the second involving parametric datatype selectors. Fixes #5635. Both benchmarks on that issue are unsolved (one timeout, one unknown) but throw no assertion failure.
2021-01-20Fix corner case of wrongly applied selector as trigger (#5786)Andrew Reynolds
Fixes #5766.
2021-01-20Do not track processed in remove term formulas loop (#5791)Andrew Reynolds
The assertion/tracking was spurious, since an eliminated term may occur in multiple contexts. Fixes #5728 (which I could not reproduce currently). Adds a regression from a duplicate of that issue.
2021-01-20SMT2 parser: Do not add non-linear symbols for linear Int arith logics. (#5787)Aina Niemetz
This enables more strict handling of operators div, mod and abs for Integer arithmetic logics. More strict handling for '/' for Real arithmetic logics is more involved and should be done in the parser -- instead at solving time, like is currently done for checking that the application * is in the linear fragment. The latter should be checked in the parser, too. This is postponed to a later PR.
2021-01-19Use arbitrary ground term assignment for sorts where isInterpretedFinite is ↵Andrew Reynolds
true (#5790) This makes a small change to our model construction to assign arbitrary values to eqc for types that are "interpreted finite", that is, have finite cardinality under the assumption that uninterpreted sorts are finite/infinite (when finite model finding is on/off). Uninterpreted sorts themselves always use the type enumerator to assign distinct values. This fixes #5738. This change is necessary since there was previously a mismatch between types where isFinite != isInterpretedFinite, in particular a datatype with a single constructor with a unintepreted type field as in that issue.
2021-01-19Implement proofs for arith BRAB lemmas (#5784)Alex Ozdemir
All changes: Add a Pf type alias for std::shared_ptr to expr/proof_rule.h Add an eager proof generator to TheoryArith for preprocessing rewrites. Right now those are proven with INT_TRUST. Will eventually fix. Generate proved lemmas in TheoryArithPrivate::branchIntegerVariable. Same for TheoryArithPrivate::roundRobinBranch Add EagerProofGenerator::mkTrustedRewrite. Add some proofsEnabled methods.
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-13Split eager solver from strings solver state (#5775)Andrew Reynolds
This splits the eager solver from solver state. The solver state contains the EqcInfo data, while the eager solver is responsible for populating it. This is in preparation for adding new techniques to the eager solver. No behavior changes in this PR, only reorganization.
2021-01-13Add unit test for api getInterpolant() -- issue #5593 (#5772)Ying Sheng
The pull request addressed issue #5593 for adding an unit test.
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-12google test: expr: Migrate node_black. (#5764)Aina Niemetz
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback