summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2019-01-18Merge branch 'master' into createCheckEntailContainscreateCheckEntailContainsAndrew Reynolds
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-17Strings: Introduce checkEntailContains()Andres Noetzli
This commit introduces a helper function `TheoryStringsRewriter::checkEntailContains()` in the string rewriter that abstracts away the entailment check whether a string term must/must not contain another strings term.
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
2018-12-19Fix issues with REWRITE_DONE in floating point rewriter (#2762)Andrew Reynolds
2018-12-17Remove noop. (#2763)Aina Niemetz
2018-12-17 Configured for linking against drat2er (#2754)Alex Ozdemir
drat2er is a C/C++ project which includes support for * Checking DRAT proofs * Converting DRAT proofs to LRAT proofs * Converting DRAT proofs to ER proofs It does the first 2 by using drat-trim under the hood. I've modified our CMake configuration to allow drat2er to be linked into CVC4, and I added a contrib script.
2018-12-17New C++ API: Add tests for term object. (#2755)Aina Niemetz
2018-12-15Revert "Move ss-combine rewrite to extended rewriter (#2703)" (#2759)Andres Noetzli
2018-12-14 [LRA Proof] Storage for LRA proofs (#2747)Alex Ozdemir
* [LRA Proof] Storage for LRA proofs During LRA solving the `ConstraintDatabase` contains the reasoning behind different constraints. Combinations of constraints are periodically used to justify lemmas (conflict clauses, propegations, ... ?). `ConstraintDatabase` is SAT context-dependent. ArithProofRecorder will be used to store concise representations of the proof for each lemma raised by the (LR)A theory. The (LR)A theory will write to it, and the ArithProof class will read from it to produce LFSC proofs. Right now, it's pretty simplistic -- it allows for only Farkas proofs. In future PRs I'll: 1. add logic that stores proofs therein 2. add logic that retrieves and prints proofs 3. enable LRA proof production, checking, and testing * Document ArithProofRecorder use-sites * Update src/proof/arith_proof_recorder.cpp Co-Authored-By: alex-ozdemir <aozdemir@hmc.edu> * Yoni's review * clang-format * Response to Mathias' review.
2018-12-14Fixed typos.Aina Niemetz
2018-12-14New C++ API: Add tests for opterm object. (#2756)Aina Niemetz
2018-12-14 Fix extended rewriter for binary associative operators. (#2751)Andrew Reynolds
This was causing assertion failures when using Sets + Sygus.
2018-12-14Make single invocation and invariant pre/post condition templates ↵Andrew Reynolds
independent (#2749) --cegqi-si=none previously disabled pre/post-condition templates for invariant synthesis. This PR eliminates this dependency. There are no major code changes in this PR, unfortunately a large block of code changed indentation so I refactored it to be more up to date with the coding guidelines.
2018-12-13New C++ API: Add tests for sort functions of solver object. (#2752)Aina Niemetz
2018-12-13Remove spurious map (#2750)Andrew Reynolds
2018-12-12Fix compiler warnings. (#2748)Aina Niemetz
2018-12-11Remove alternate versions of mbqi (#2742)Andrew Reynolds
2018-12-10BoolToBV modes (off, ite, all) (#2530)makaimann
2018-12-07Strings: Make EXTF_d inference more conservative (#2740)Andres Noetzli
2018-12-06Arith Constraint Proof Loggin (#2732)Alex Ozdemir
* Arith Constraint Proof Logging Also a tiny documentation update. * Debug.isOn check around iterated output * reference iteratees
2018-12-06Enable BV proofs when using an eager bitblaster (#2733)Alex Ozdemir
* Enable BV proofs when using and eager bitblaster Specifically: * Removed assertions that blocked them. * Made sure that only bitvectors were stored in the BV const let-map * Prevented true/false from being bit-blasted by the eager bitblaster Also: * uncommented "no-check-proofs" from relevant tests * Option handler logic for BV proofs BV eager proofs only work when minisat is the sat solver being used by the BV theory. Added logic to the --proof hanlder to verify this or throw an option exception. * Bugfix for proof options handler I forgot that proofEnabledBuild runs even if the --proof option is negated. In my handler I now check that proofs are enabled. * Clang-format
2018-12-06Fix use-after-free due to destruction order (#2739)Andres Noetzli
A test for PR #2737 was failing even though the PR only added dead code. This PR fixes the issue by fixing two use-after-free bugs: - `ResolutionBitVectorProof` has a `Context` and a `std::unique_ptr<BVSatProof>` member. The `BVSatProof` depends on the `Context` and tries to access it (indirectly) in its constructor but because the context was declared after the proof, the context was destroyed before the proof, leading to a use-after-free in a method called from the proof's destructor. This commit reorders the two members. - `TLazyBitblaster` was destroyed before the `LFSCCnfProof` in `BitVectorProof` because `SmtEngine`'s destructor first destroyed the theory engine and then the proof manager. This lead to a use-after-free because `LFSCCnfProof` was using the `d_nullContext` of `TLazyBitblaster`, which got indirectly accessed in `LFSCCnfProof`'s destructor. This commit moves the destruction of `ProofManager` above the destruction of the theory engine. The issues were likely introduced by #2599. They went undetected because our nightlies' ASAN check does not use proofs due to known memory leaks in the proof module of CVC4. I have tested this PR up to regression level 2 with ASAN with leak detection disabled.
2018-12-06 Take into account minimality and types for cached PBE solutions (#2738)Andrew Reynolds
2018-12-04Apply extended rewriting on PBE static symmetry breaking. (#2735)Andrew Reynolds
2018-12-04Enable regular expression elimination by default. (#2736)Andrew Reynolds
Seems to have no impact on Norn, and is helpful for a number of applications.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback