1 /******************************************************************************
2 * Top contributors (to current version):
3 * Aina Niemetz, Mathias Preiner
5 * This file is part of the cvc5 project.
7 * Copyright (c) 2009-2021 by the authors listed in the file AUTHORS
8 * in the top-level source directory and their institutional affiliations.
9 * All rights reserved. See the file COPYING in the top-level source
10 * directory for licensing information.
11 * ****************************************************************************
13 * A bit-blaster wrapper around NodeBitblaster for proof logging.
15 #include "cvc5_private.h"
17 #ifndef CVC5__THEORY__BV__BITBLAST__PROOF_BITBLASTER_H
18 #define CVC5__THEORY__BV__BITBLAST__PROOF_BITBLASTER_H
20 #include "expr/term_context.h"
21 #include "theory/bv/bitblast/node_bitblaster.h"
25 class TConvProofGenerator
;
32 using Bits
= std::vector
<Node
>;
35 BBProof(TheoryState
* state
, ProofNodeManager
* pnm
, bool fineGrained
);
38 /** Bit-blast atom 'node'. */
39 void bbAtom(TNode node
);
40 /** Check if atom was already bit-blasted. */
41 bool hasBBAtom(TNode atom
) const;
42 /** Check if term was already bit-blasted. */
43 bool hasBBTerm(TNode node
) const;
44 /** Get bit-blasted node stored for atom. */
45 Node
getStoredBBAtom(TNode node
);
46 /** Get bit-blasted bits stored for node. */
47 void getBBTerm(TNode node
, Bits
& bits
) const;
48 /** Collect model values for all relevant terms given in 'relevantTerms'. */
49 bool collectModelValues(TheoryModel
* m
, const std::set
<Node
>& relevantTerms
);
51 TConvProofGenerator
* getProofGenerator();
54 /** Return true if proofs are enabled. */
55 bool isProofsEnabled() const;
57 /** The associated simple bit-blaster. */
58 std::unique_ptr
<NodeBitblaster
> d_bb
;
59 /** The associated proof node manager. */
60 ProofNodeManager
* d_pnm
;
61 /** Term context for d_tcpg to not rewrite below BV leafs. */
62 std::unique_ptr
<TermContext
> d_tcontext
;
63 /** The associated term conversion proof generator. */
64 std::unique_ptr
<TConvProofGenerator
> d_tcpg
;
65 /** Map bit-vector nodes to bit-blasted nodes. */
66 std::unordered_map
<Node
, Node
> d_bbMap
;
68 bool d_recordFineGrainedProofs
;