ClausalBitvectorProof (#2786)
authorAlex Ozdemir <aozdemir@hmc.edu>
Mon, 14 Jan 2019 18:53:31 +0000 (10:53 -0800)
committerGitHub <noreply@github.com>
Mon, 14 Jan 2019 18:53:31 +0000 (10:53 -0800)
commit23374b9d7fe9363165c99fbbddfd7591302a3431
treeb86973ea904e9d6628b4c8a6da0a4619f8b45d51
parent300560dda47178cae18f5f4ad2edb381eabddb30
ClausalBitvectorProof (#2786)

* [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
28 files changed:
src/CMakeLists.txt
src/proof/bitvector_proof.cpp
src/proof/bitvector_proof.h
src/proof/clausal_bitvector_proof.cpp [new file with mode: 0644]
src/proof/clausal_bitvector_proof.h [new file with mode: 0644]
src/proof/cnf_proof.cpp
src/proof/cnf_proof.h
src/proof/resolution_bitvector_proof.cpp
src/proof/resolution_bitvector_proof.h
src/proof/theory_proof.cpp
src/prop/bvminisat/bvminisat.cpp
src/prop/bvminisat/bvminisat.h
src/prop/cnf_stream.cpp
src/prop/cryptominisat.cpp
src/prop/cryptominisat.h
src/prop/sat_solver.h
src/theory/bv/bitblast/bitblaster.h
src/theory/bv/bitblast/eager_bitblaster.cpp
src/theory/bv/bitblast/eager_bitblaster.h
src/theory/bv/bitblast/lazy_bitblaster.cpp
src/theory/bv/bitblast/lazy_bitblaster.h
src/theory/bv/bv_eager_solver.cpp
src/theory/bv/bv_eager_solver.h
src/theory/bv/bv_subtheory.h
src/theory/bv/bv_subtheory_bitblast.cpp
src/theory/bv/bv_subtheory_bitblast.h
src/theory/bv/theory_bv.cpp
src/theory/bv/theory_bv.h