diff options
author | Andres Noetzli <andres.noetzli@gmail.com> | 2019-01-18 00:43:53 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-18 00:43:53 -0800 |
commit | e9bfbb2f666c8cb4cf783d8ebd398fa9304bb5b7 (patch) | |
tree | 7280fa55e2a4c6331b71c3c0c5454b1b0b40aad6 | |
parent | 78d7485639cdf0769c13606b8ad3f5e9455153f1 (diff) |
Fix ABC build (#2808)
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).
-rw-r--r-- | src/smt/smt_engine.cpp | 6 | ||||
-rw-r--r-- | src/theory/bv/bitblast/aig_bitblaster.cpp | 1 | ||||
-rw-r--r-- | src/theory/bv/bitblast/aig_bitblaster.h | 8 | ||||
-rw-r--r-- | src/theory/bv/bitblast/bitblaster.h | 2 |
4 files changed, 16 insertions, 1 deletions
diff --git a/src/smt/smt_engine.cpp b/src/smt/smt_engine.cpp index 747fc3ac8..68b7e2251 100644 --- a/src/smt/smt_engine.cpp +++ b/src/smt/smt_engine.cpp @@ -1431,6 +1431,12 @@ void SmtEngine::setDefaults() { << endl; setOption("global-negate", false); } + + if (options::bitvectorAig()) + { + throw OptionException( + "bitblast-aig not supported with unsat cores/proofs"); + } } else { diff --git a/src/theory/bv/bitblast/aig_bitblaster.cpp b/src/theory/bv/bitblast/aig_bitblaster.cpp index b06062cf4..b69704dfb 100644 --- a/src/theory/bv/bitblast/aig_bitblaster.cpp +++ b/src/theory/bv/bitblast/aig_bitblaster.cpp @@ -28,6 +28,7 @@ extern "C" { #include "base/abc/abc.h" #include "base/main/main.h" +#include "prop/cnf_stream.h" #include "sat/cnf/cnf.h" extern Aig_Man_t* Abc_NtkToDar(Abc_Ntk_t* pNtk, int fExors, int fRegisters); diff --git a/src/theory/bv/bitblast/aig_bitblaster.h b/src/theory/bv/bitblast/aig_bitblaster.h index 62e70d73d..3b48928ca 100644 --- a/src/theory/bv/bitblast/aig_bitblaster.h +++ b/src/theory/bv/bitblast/aig_bitblaster.h @@ -85,6 +85,14 @@ class AigBitblaster : public TBitblaster<Abc_Obj_t*> Unreachable(); } + prop::SatSolver* getSatSolver() override { return d_satSolver.get(); } + + void setProofLog(proof::BitVectorProof* bvp) override + { + // Proofs are currently not supported with ABC + Unimplemented(); + } + class Statistics { public: diff --git a/src/theory/bv/bitblast/bitblaster.h b/src/theory/bv/bitblast/bitblaster.h index b1fc084ed..b28ff3e2a 100644 --- a/src/theory/bv/bitblast/bitblaster.h +++ b/src/theory/bv/bitblast/bitblaster.h @@ -91,7 +91,7 @@ class TBitblaster bool hasBBTerm(TNode node) const; void getBBTerm(TNode node, Bits& bits) const; virtual void storeBBTerm(TNode term, const Bits& bits); - void setProofLog(proof::BitVectorProof* bvp); + virtual void setProofLog(proof::BitVectorProof* bvp); /** * Return a constant representing the value of a in the model. |