summaryrefslogtreecommitdiff
path: root/src/prop
AgeCommit message (Collapse)Author
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-26Some formatting and better tracing in prop engine (#6022)Haniel Barbosa
Miscellaneous changes from proof-new.
2021-02-23[proof-new] Fix dangling pointer in SAT proof generation (#5963)Haniel Barbosa
When a clause is being explained, the negation of each of its literals, other than the one it propagates, needs to be explained. This process may lead to the creation of new clauses in the SAT solver (because if a literal being explained was propagated and an explanation was not yet given, it will then be computed and added). This may lead to changes in the memory where clauses are, which may break the reference to the original clause being explained. To avoid this issue we store the literals in the reason before we start explaining their negations. We then iterate over them rather than over the clause, as before.
2021-02-23[proof-new] Fix handling of removable clauses in proof cnf stream (#5961)Haniel Barbosa
Previously the removable information was not being communicated from the proof cnf stream to the cnf stream, which is the one that actually uses this when asserting clauses into the SAT solver. This commit fixes this by having the proof cnf stream directly use the cnf stream d_removable attribute.
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-16Add bit-level propagation support to BV bitblast solver. (#5906)Mathias Preiner
This commit adds support for bit-level propagation for the BV bitblast solver to quickly detect conflicts on effort levels != FULL. Bit-level propagation for the bitblast solver is by default disabled for now. Further, bit-blasting of facts is now handled more lazily with a bit-blast queue.
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-11[proof-new] Adding a proof-producing ensure literal method (#5889)Haniel Barbosa
The ensureLiteral method in CnfStream may apply CNF conversion to the given literal (for example if it's an IFF), which needs to be recorded in the proof. This commit adds a proof-producing ensureLiteral to ProofCnfStream, which is called by the prop engine if proofs are enabled. This commit also simplifies the interfaces on ensureLit and convertAtom by removing the preRegistration flag, which was never used.
2021-02-04[proof-new] Catch trivial cycles in SAT proof generation (#5853)Haniel Barbosa
Evaluating the proof infrastructure in SMT-LIB has uncovered a rare case (i.e., not previously in our regressions!!) in which we generate a trivial cycle during SAT proof generation, which can lead to problematic cycles when expanding MACRO_RESOLUTION steps. For example, we can go from l1 v l2 ~l1 v l3 ~l2 v l3 (ok) ------------------------------ l3 in which l3 = l1 v l2, to l1 v l2 ~l1 v l3 ~l2 v l3 (bad) ------------------------------ l3 v l3 --------- l3 This commit now catches the trivial cycle before it's generated.
2021-02-03Add BV solver bitblast. (#5851)Mathias Preiner
This PR adds a new bit-blasting BV solver, which can be enabled via --bv-solver=bitblast. The new bit-blast solver can be used instead of the lazy BV solver and currently supports CaDiCaL and CryptoMiniSat as SAT back end.
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-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-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-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-11Merge theory registrar and theory proxy (#5758)Andrew Reynolds
The motivation of this PR is to make TheoryProxy the single point of contact to TheoryEngine from PropEngine. This merges the helper class TheoryRegistrar into TheoryProxy.
2021-01-05Add new interfaces to term formula removal and theory preprocess (#5717)Andrew Reynolds
This is in preparation for lazy lemmas for term formula removal.
2021-01-05Remove a few miscellaneous references to the expr layer (#5661)Andrew Reynolds
Leftover from a development branch.
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-23Add option to track and notify from CNF stream (#5708)Andrew Reynolds
This adds functionality to CNF stream to allow e.g. TheoryProxy to be notified when a formula is asserted (not just literals). This will be required for SAT relevancy. No behavior changes in this PR.
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-16[proof-new] Only use old proof code for unsat cores if new proofs are off ↵Haniel Barbosa
(#5688) This is so that eventually we can compare the performance of the old unsat cores vs the new ones.
2020-12-14[proof-new] Making the CDCL(T) Minisat proof producing (#5669)Haniel Barbosa
This closely follows the old proof code in terms of where Minisat is hooked to the SatProofManager, other than a few places like registering removed clauses and removal of redundant literals. Note that this together with the thorough handling from SatProofManager makes the new SAT proofs perceptibly more robust than the old ones. This PR also adds some traces to better track what Minisat does.
2020-12-14[proof-new] Make prop engine proof producing (#5667)Haniel Barbosa
2020-12-14[proof-new] Updating interfaces between prop engine and minisat (#5664)Haniel Barbosa
This is in preparation to make the prop engine proof producing. This PR also renames "DPLLSatSolverInterface" to the more appropriate name "CDCLTSatSolverInterface". Note that most of the diff is due to formatting of the previously super ad-hoc formatting of the minisat code.
2020-12-11 [proof-new] Updating theory proxy to new proof infrastructure (#5653)Haniel Barbosa
2020-12-09Fixed a bunch of clang warnings. (#5637)Gereon Kremer
2020-12-09Make decision engine independent of AssertionsPipeline (#5626)Andrew Reynolds
This PR makes decision engine independent of AssertionsPipeline, which consequently allows some of the key PropEngine interfaces to be consolidated. It also modifies PropEngine to take TrustNode for assertLemma, which is the first step for making PropEngine manage proofs from TheoryEngine. This is in preparation for modifying the interplay between PropEngine, TheoryEngine, TheoryPreprocessor, and new proposed SAT relevancy heuristic. There are no intended behavior changes in this PR. Marking "major" since this impacts several current directions (including proof-new integration, lazy theory preprocessing, SAT relevancy).
2020-12-08[proof-new] Updating SAT proof to use MACRO_RESOLUTION (#5613)Haniel Barbosa
2020-12-07 (proof-new) Split proof ensure closed checks to own file (#5522)Andrew Reynolds
Split proof ensure closed checks to own file
2020-12-03(proof-new) Updates to SMT proof manager and SmtEngine (#5446)Andrew Reynolds
This PR adds infrastructure in SmtEngine and ProofManager for checking and printing proofs. It updates a previous interface that used ProofGenerator in favor of ProofNode. This makes it so that it only remains to make PropEngine to be proof producing.
2020-12-02Update copyright headers.Aina Niemetz
2020-11-19Include stddef.h (needed for size_t) in cvc4_public.h (#5476)Aina Niemetz
This further removes obsolete explicit includes of stdint.h.
2020-11-16Improve accuracy of resource limitation (#4763)Gereon Kremer
The main goal of the resource limitation mechanism (via `--rlimit`) is to have a deterministic limitation on runtime. The ultimate goal would be that the actual runtime grows linearly with the spent resources. To achieve this, this PR does the following: - introduce new resources spent in places that are not yet covered - find resource weights that best approximate the runtime It provides a contrib script `learn_resource_weights.py` that uses statistics from a given benchmark run and uses linear regression to find good resource weights. The script also evaluates this estimate and identifies outliers, benchmarks for which this approximation is particularly bad. This probably indicates that on such a benchmark, some part of the code takes a significant amount of time but is not yet represented by a resource. Eventually, we should use the resulting resource weights as defaults for the options like `--rewrite-step`, `--theory-check-step`, etc.
2020-11-09Properly clear interrupt for solve() as well. (#5403)Gereon Kremer
The minisat solver stores whether it has been interrupted in asynch_interrupt and expects it to be reset before another call to solve(). MinisatSatSolver::solve() failed to do this, leading to incorrect unknown results as observed in CVC4/cvc4-projects#106. The alternative MinisatSatSolver::solve(unsigned long& resource) already did the correct thing. Fixes CVC4/cvc4-projects#106.
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).
2020-10-19[proof-new] Fixing resolution proof checker (#5262)Haniel Barbosa
Previously the binary resolution checker was: - Checking applications in which for a pivot (not l) the literal (not l) would be eliminated from the first clause and l from the second because double negation was handled implicitly. Now whether the binary resolution is such that the pivot is removed as is from the first clause and negated from the second, or the other way around, is marked via an argument. - Not producing false the remaining set of literals after resolution was empty. This commit also updates the informal description of the rule accordingly, as well as to clarify the behavior when the pivot does not occur properly in the clauses (in which case the rule application corresponds to weakening). Co-authored-by: Gereon Kremer <gereon.kremer@cs.rwth-aachen.de>
2020-10-13using NOT_NOT_ELIM rather than macros to do double-neg elimination (#5261)Haniel Barbosa
2020-09-29[proof-new] Adds a proof manager for prop engine (#5162)Haniel Barbosa
Also fixes some weird orderings in src/CMakeLists.txt
2020-09-29[proof-new] Adds a proof post processor for the Prop Engine (#5161)Haniel Barbosa
The post processor connects the two proofs in the prop engine: the refutation proof in the SAT solver and the CNF transformation proof in the CNF stream. The proof generators from theory engine in the latter are also expanded during the connection.
2020-09-29[proof-new] Adds a proof-producing CNF converter (#5137)Haniel Barbosa
A proof generator that wraps the original CNF stream, to be used when the prop engine is proof producing. It tracks in a lazy cdproof both the concrete clausification steps and the proof generators of the formulas being clausified (in particular, theory lemmas).
2020-09-28[proof-new] Removing spurious forward declaration in CnfStream (#5155)Haniel Barbosa
2020-09-28[proof-new] Adds a proof manager for the SAT solver (#5140)Haniel Barbosa
Tracks the refutation proof built by Minisat. See the header for extensive explanations. This commit also adds a few dependencies for the SAT proof manager to work (making it a friend of the SAT solver, getting the cnf stream from theory proxy, having lazy cdproof chain give all the links).
2020-09-25Cleaning and documenting cnf stream (#5134)Haniel Barbosa
Moreover changes assertClause to return a bool, which is gonna be used by the proof cnf stream.
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-09-16Dump commands in internal code using command printing functions. (#5040)Abdalrhman Mohamed
This is work towards migrating commands to the new API. Internal code that creates command objects just for dumping is replaced with direct calls to functions that print the those commands.
2020-09-11(proof-new) Update TheoryEngine lemma and conflict to TrustNode (#5056)Andrew Reynolds
This updates the theory engine interfaces for conflicts and lemmas to be in terms of TrustNode not Node. This also updates the return value of getExplanation methods in TheoryEngine to TrustNode, but it does not yet add the proof generation code to that method yet, which will come in a separate PR.
2020-09-02Fix CryptoMiniSat build, regression (#5006)Andres Noetzli
This commit fixes builds that include CryptoMiniSat after commit 8ad308b removed them. It also fixes one of the regressions that requires unsat cores but was run when the build was configured without them.
2020-09-01Removes old proof code (#4964)Haniel Barbosa
This deletes much of the old proof code. Basically everything but the minimal necessary infra-structure for producing unsat cores. That includes dependency tracking in preprocessing, the prop engine proof and the unsat core computation code in the old proof manager. These should also go once we fully integrate into master the new proof infrastructure. It also cleans interfaces that were using old-proof-code-specific constructs (such as LemmaProofRecipe). When possible or when it made sense standalone local proof production code was kept, but deactivated (such is in the equality engine and in the arithmetic solver).
2020-08-31Fix spelling errors (#4977)FabianWolff
Signed-off-by: Fabian Wolff <fabi.wolff@arcor.de>
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback