summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2019-03-03Always assert that drat-trim exits successfully.Alex Ozdemir
Also, removed unneeded (and sometimes violated) assertions.
2019-03-03Bugfix: `clear` does not empty ostream.Alex Ozdemir
std::ostream::clear actually modifiers the error bits...
2019-03-03Enable DRAT optimization for all pipelines.Alex Ozdemir
* Required some changes to our C++ API for drat2er.
2019-03-03Responded to Andres' reviewAlex Ozdemir
* Using the `Maybe` class for the return of `detectTrivialTautology`. * Removing a spurious `= 0`.
2019-03-02Enable CryptoMiniSat-backed BV proofsAlex Ozdemir
* Connect the plumbing so that BV proofs are enabled when using CryptoMiniSat * Also fixed a bug in CNF-proof generation * Specifically, CNF proofs broke when proving tautological clauses. Now they don't.
2019-02-28ErProof class with LFSC output (#2812)Alex Ozdemir
* ErProof class with LFSC output * Created a TraceCheckProof class * parsable from text * Created an ErProof class * constructible from a TraceCheckProof * writable as LFSC * A bunch of unit tests * Reponded to Mathias's first set of comments. Credits to Mathias for many of the fixes! * Responed to Andres's first set, fixed tests I accidentally deleted a "!" last time, causing stuff to fail. * Use Configuration::isAssertionBuild * Clarified comment * Responded to Andres's 2nd review * Gaurding against a memory error. * Renaming a file. * Aggressively unlinking temporary files.
2019-02-27Use string stream for proofs instead of tmp files (#2841)Andres Noetzli
This commit changes CVC4 to use a string stream instead of a temporary files for proof checking. Note: This change requires a version of LFSC that supports checking streams (see https://github.com/CVC4/LFSC/pull/14). Tested: `make check` passed, changing `holds` to `xholds` in the proof produced by proof_manager.cpp makes the proofs fail.
2019-02-13New C++ API: Remove redundant declareFun function. (#2837)Aina Niemetz
2019-02-13Rewrite simple regexp pattern to str.contains (#2827)Andres Noetzli
2019-02-12New C++ API: Remove redundant mkTerm function. (#2836)Aina Niemetz
2019-02-12Delete temporary proof files when aborting CVC4 (#2834)Andres Noetzli
CVC4 was not deleting temporary proof files when crashing or being terminated externally. This commit uses an early `unlink()` to remove the files as soon as CVC4 terminates.
2019-02-11New C++ API: Unit tests for declare* functions. (#2831)Aina Niemetz
2019-02-05Make stripConstantEndpoints() less aggressive (#2830)Andres Noetzli
2019-02-03Add rewrite for contains + const strings replace (#2828)Andres Noetzli
2019-02-02Fix corner case in stripConstantEndpoints (#2824)Andres Noetzli
`stripConstantEndpoints()` was returning `true` when the first argument was a list only containing an empty string, which could lead to rewrite loops. This commit checks for that case and adds a unit test for it.
2019-01-29New C++ API: Fix checks for mkTerm. (#2820)Aina Niemetz
This required fixing the OpTerm handling for mkTerm functions in the API.
2019-01-29Strings: Remove redundant replace rewrite (#2822)Andres Noetzli
Pulling the first constant string from a replace if there is no overlap with the search term is subsumed by the rewrite using `stripConstantEndpoints()`.
2019-01-23Avoid using ProofManager in non-proof CMS build (#2814)Andres Noetzli
PR #2786 changed `CryptoMinisatSolver::addClause()` to register clauses with the bit-vector proof if proofs are turned on. The new code requested the `ProofManager` even when proofs were turned off, which made the `eager-inc-cryptominisat.smt2` regression and our nightlies fail. This commit guards the access to the `ProofManager`, restoring the semantics of the original code when proofs are turned off.
2019-01-22Strings: Strengthen multiset reasoning (#2817)Andres Noetzli
This commit introduces three helper methods for performing multiset reasoning: an entailment check whether a term is always a strict subset of another term in the multiset domain (`checkEntailMultisetSubset()`), a check whether a string term is always homogeneous (`checkEntailHomogeneousString()`), and an overapproximation for the multiset domain (`getMultisetApproximation()`). It also adds unit tests related to multiset reasoning.
2019-01-22 Fix tuple and record CVC printing (#2818)Andrew Reynolds
2019-01-22 Fix parsing of overloaded parametric datatype selectors (#2819)Andrew Reynolds
2019-01-19Fix missing-override warning (#2811)Andres Noetzli
`TLazyBitblaster::setProofLog()` was defined even though the method was not virtual before PR #2808 and `TBitblaster` was implementing the same method. After that PR, which made the method virtual, GCC complained about a missing `override` keyword for `setProofLog()`. However, the method should have been removed (see [comment](https://github.com/CVC4/CVC4/pull/2786#discussion_r247299617)). This commit removes the function definition.
2019-01-18Extract DIMACS Printing (#2800)Alex Ozdemir
Creating LRAT proofs reuqires writing SAT problems in the DIMACS format. Before this code was in the LRAT class. However, since creating ER proofs will also require writing DIMACS, I decided to extract it. At the same time I realized that my prior representation of used clauses was unnecessarily poor. I had chosen it to align with `CnfProof::collectAtomsForClauses`, but the format is really bad (it requires extra allocations & manual memory management), and I discovered that the aforementioned method is super simple, so I'm moving to a better format.
2019-01-18Strings: Introduce checkEntailContains() (#2809)Andres Noetzli
2019-01-18 Fix ABC build (#2808)Andres Noetzli
PR #2786 introduced a pure virtual method `TBitblaster::getSatSolver()`. `AigBitblaster` was missing the implementation of that method. This commit adds an implementation that simply returns the underlying SAT solver. Note: The method is currently only used for proofs and CVC4 does not support proofs in combination with ABC. To make this explicit, the commit also adds a check in `SmtEngine::setDefaults()` that makes sure that we are not trying to produce proofs with `--bitblast-aig` (before the commit, we just crashed with an assertion failure/null pointer dereference).
2019-01-16Add option to print BV constants in binary (#2805)Andres Noetzli
This commit adds the option `--bv-print-consts-in-binary` to print bit-vector constants in binary, e.g. `#b0001`, instead of decimal, e.g. `(_ bv1 4)`). The option is on by default to match the behavior of Z3 and Boolector.
2019-01-15Fix constant contains ITOS rewrite (#2799)Andrew Reynolds
2019-01-15Strings: Add option to change loop process mode (#2794)Andres Noetzli
This commit adds an option `--strings-process-loop-mode` that allows finer-grained control over CVC4 processes looping word equation. In particular, performing normal loop breaking sometimes leads to worse performance. The "simple" mode disables that inference.
2019-01-15 Fix unsound double abs rewrite rule for FP (#2792)Andrew Reynolds
2019-01-14 Only check disequal terms with sygus-rr-verify (#2793)Andrew Reynolds
2019-01-14ClausalBitvectorProof (#2786)Alex Ozdemir
* [DRAT] ClausalBitvectorProof Created a class, `ClausalBitvectorProof`, which represents a bitvector proof of UNSAT using an underlying clausal technique (DRAT, LRAT, etc) It fits into the `BitvectorProof` class hierarchy like this: ``` BitvectorProof / \ / \ ClausalBitvectorProof ResolutionBitvectorProof ``` This change is a painful one because all of the following BV subsystems referenced ResolutionBitvectorProof (subsequently RBVP) or BitvectorProof (subsequently BVP): * CnfStream * SatSolver (specifically the BvSatSolver) * CnfProof * TheoryProof * TheoryBV * Both bitblasters And in particular, ResolutionBitvectorProof, the CnfStream, and the SatSolvers were tightly coupled. This means that references to and interactions with (R)BVP were pervasive. Nevertheless, an SMT developer must persist. The change summary: * Create a subclass of BVP, called ClausalBitvectorProof, which has most methods stubbed out. * Make a some modifications to BVP and ResolutionBitvectorProof as the natural division of labor between the different classes becomes clear. * Go through all the components in the first list and try to figure out which kind of BVP they should **actually** be interacting with, and how. Make tweaks accordingly. * Add a hook from CryptoMinisat which pipes the produced DRAT proof into the new ClausalBitvectorProof. * Add a debug statement to ClausalBitvectorProof which parses and prints that DRAT proof, for testing purposes. Test: * `make check` to verify that we didn't break any old stuff, including lazy BB, and eager BB when using bvminisat. * `cvc4 --dump-proofs --bv-sat-solver=cryptominisat --bitblast=eager -d bv::clausal test/regress/regress0/bv/ackermann2.smt2`, and see that 1. It crashed with "Unimplemented" 2. Right before that it prints out the (textual) DRAT proof. * Remove 2 unneeded methods * Missed a rename * Typos Thanks Andres! Co-Authored-By: alex-ozdemir <aozdemir@hmc.edu> * Address Andres comments * Reorder members of TBitblaster
2019-01-13LFSC LRAT Output (#2787)Alex Ozdemir
* LFSC ouput & unit test * Renamed lrat unit test file * s/DRAT/LRAT/ Thanks Andres! Co-Authored-By: alex-ozdemir <aozdemir@hmc.edu> * Addressed Andres' comments 1. Extracted a filter whitespace function. 2. Added @param annotations. * Addressing Yoni's comments Tweaked the test method name for LRAT output as LFSC Added assertions for verifying that clause index lists are sorted during LFSC LRAT output.
2019-01-11LratInstruction inheritance (#2784)Alex Ozdemir
While implementing and testing LRAT proof output as LFSC, I discovered that my implementation of LratInstruction as a tagged union was subtly broken for reasons related to move/copy assignment/constructors. While I could have figured out how to fix it, I decided to stop fighting the system and use inheritance. This PR will be followed by one using the inheritance-based LratInstruction to implement output to LFSC.
2019-01-11Fixed linking against drat2er, and use drat2er (#2785)Alex Ozdemir
* Fixed linking against drat2er/drat-trim We have machinery for linking against drat2er. However, this machinery didn't quite work because libdrat2er.a contains an (undefined) reference to `run_drat_trim` from libdrat-trim.a. Thus, when linking against libdrat2er.a, we also need to link against libdrat-trim.a. I made this change, and then tested it by actually calling a function from the drat2er library (CheckAndConvertToLRAT) which relies on `run_drat_trim`. Since this invocation compiles, we know that the linking is working properly now. * Combined the two libs, per Mathias * drat2er configured gaurds
2019-01-11New C++ API: Add unit tests for setInfo, setLogic, setOption. (#2782)Aina Niemetz
2019-01-10New C++ API: Get rid of mkConst functions (simplify API). (#2783)Aina Niemetz
2019-01-09Do not rewrite 1-constructor sygus testers to true (#2780)Andrew Reynolds
2019-01-09[BV Proofs] Option for proof format (#2777)Alex Ozdemir
We're building out a system whereby (eager) BV proofs can be emitted in one of three formats. Let's add an option for specifying which! My testing mechanism was not very thorough: I verified that I could specify each of the following option values: * `er` * `lrat` * `drat` * `help` and that I could not provide random other option values.
2019-01-09Clause proof printing (#2779)Alex Ozdemir
* Print LFSC proofs of CNF formulas * Unit Test for clause printing * Added SAT input proof printing unit test * Fixed cnf_holds reference. Proofs of CMap_holds There were references to clauses_hold, which should have been references to cnf_holds. Also added a function for printing a value of type CMap_holds, and a test for this function.
2019-01-09LFSC drat output (#2776)Alex Ozdemir
* LFSC drat output * Addressed Mathias' review Addressing Mathias' review with the following changes: * Added a few blank lines * Added a unit test for LRAT output as LFSC
2019-01-07New C++ API: Add missing getType() calls to kick off type checking. (#2773)Aina Niemetz
2019-01-06[DRAT] DRAT data structure (#2767)Alex Ozdemir
* Copied old DRAT data-structure files. Next step: clean up the code, and adapt them to our current usage plans. * Polished the DRAT class. Notably, removed the idea of lazy-parsing, this is now just a DRAT wrapper class. More explicit about whether methods handle binary or text. Better constructor patterns * Added implementation of textual DRAT output * reordered the DratInstruction structure. * removed the public modifier from the above struct * removed the operator << implementation for DratInstruction * use emplace_back * Addressing Yoni's first review * Extracted "write literal in DIMACS format" idea as a function * Replaced some spurious Debug streams with `os`. (they were left over from an earlier refactor) * Improved some documentation * Removed aside about std::string * Addressed Mathias' comments Specifically * SCREAMING_SNAKE_CASED enum variants. * Extracted some common logic from two branches of a conditional. * Cleaned out some undefined behavior from bit manipulation. * Unit tests for binary DRAT parsing * Added text output test * s/white/black/ derp
2019-01-04[LRAT] A C++ data structure for LRAT. (#2737)Alex Ozdemir
* [LRAT] A C++ data structure for LRAT. Added a data structure for storing (abstract) LRAT proofs. The constructor will take a drat binary proof and convert it to LRAT using drat-trim. However, this is unimplemented in this PR. Subsequent PRs will add: * LFSC representation of LRAT * Bitvector Proofs based on LRAT * Enabled tests for those proofs * Documenting LRAT constructors * Apply suggestions from code review Co-Authored-By: alex-ozdemir <aozdemir@hmc.edu> * Responding to Andres' review Consisting of * Naming nits * Closed fds * Better implementation of disjoint union for LratInstruction * DRAT -> LRAT conversion is no longer an LratProof constructor * include reorder * Update src/proof/lrat/lrat_proof.h Co-Authored-By: alex-ozdemir <aozdemir@hmc.edu> * Addressed Andres' comments * ANonymous namespaces and name resolution? * Remove inlines, fix i negation Thanks Andres! * Use `std::abs` Credit to Andres Co-Authored-By: alex-ozdemir <aozdemir@hmc.edu> * Remove uneeded public
2019-01-03New C++ API: Add missing catch blocks for std::invalid_argument. (#2772)Aina Niemetz
2019-01-03API/Smt2 parser: refactor termAtomic (#2674)Andres Noetzli
2019-01-03C++ API: Reintroduce zero-value mkBitVector method (#2770)Andres Noetzli
PR #2764 removed `Solver::mkBitVector(uint32_t)` (returns a bit-vector of a given size with value zero), which made the build fail when SymFPU was enabled because solver_black used it for SymFPU-enabled builds. This commit simply adds a zero default argument to `mkBitVector(uint32_t, uint64_t)` to allow users to create zero-valued bit-vectors without explicitly specifying the value again. Additionally, the commit replaces the use of the `CVC4_USE_SYMFPU` macro by a call to `Configuration::isBuiltWithSymFPU()`, making sure that we can catch compile-time errors regardless of configuration. Finally, `Solver::mkConst(Kind, uint32_t, uint32_t, Term)` now checks whether CVC4 has been compiled with SymFPU when creating a `CONST_FLOATINGPOINT` and throws an exception otherwise (solver_black has been updated correspondingly).
2019-01-03[LRA proof] Recording & Printing LRA Proofs (#2758)Alex Ozdemir
* [LRA proof] Recording & Printing LRA Proofs Now we use the ArithProofRecorder to record and later print arithmetic proofs. If an LRA lemma can be proven by a single farkas proof, then that is done. Otherwise, we `trust` the lemma. I haven't **really** enabled LRA proofs yet, so `--check-proofs` still is a no-op for LRA. To test, do ``` lfsccvc4 <(./bin/cvc4 --dump-proofs ../test/regress/regress0/lemmas/mode_cntrl.induction.smt | tail -n +2) ``` where `lfsccvc4` is an alias invoking `lfscc` with all the necessary signatures. On my machine that is: ``` alias lfsccvc4="/home/aozdemir/repos/LFSC/build/src/lfscc \ /home/aozdemir/repos/CVC4/proofs/signatures/sat.plf \ /home/aozdemir/repos/CVC4/proofs/signatures/smt.plf \ /home/aozdemir/repos/CVC4/proofs/signatures/lrat.plf \ /home/aozdemir/repos/CVC4/proofs/signatures/th_base.plf \ /home/aozdemir/repos/CVC4/proofs/signatures/th_bv.plf \ /home/aozdemir/repos/CVC4/proofs/signatures/th_bv_bitblast.plf \ /home/aozdemir/repos/CVC4/proofs/signatures/th_arrays.plf \ /home/aozdemir/repos/CVC4/proofs/signatures/th_int.plf \ /home/aozdemir/repos/CVC4/proofs/signatures/th_quant.plf \ /home/aozdemir/repos/CVC4/proofs/signatures/th_real.plf \ /home/aozdemir/repos/CVC4/proofs/signatures/th_real.plf" ``` * Added guards to proof recording Also reverted some small, unintentional changes. Also had to add printing for STRING_SUBSTR?? * Responding to Yoni's review * SimpleFarkasProof examples * Respond to Aina's comments * Reorder Constraint declarations * fix build * Moved friend declaration in Constraint * Trichotomy example * Lift getNumChildren invocation in PLUS case Credits to aina for spotting it. * Clang-format
2019-01-02New C++ API: Add tests for mk-functions in solver object. (#2764)Aina Niemetz
2018-12-20Clean up BV kinds and type rules. (#2766)Aina Niemetz
2018-12-20Add missing type rules for parameterized operator kinds. (#2766)Aina Niemetz
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback