GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/theory/bv/bitblast/bitblast_proof_generator.h Lines: 2 2 100.0 %
Date: 2021-09-17 Branches: 1 2 50.0 %

Line Exec Source
1
/******************************************************************************
2
 * Top contributors (to current version):
3
 *   Mathias Preiner
4
 *
5
 * This file is part of the cvc5 project.
6
 *
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
 * ****************************************************************************
12
 *
13
 * Bitblast proof generator for generating bit-blast proof steps.
14
 */
15
#include "cvc5_private.h"
16
17
#ifndef CVC5__THEORY__BV__BITBLAST__BITBLAST_PROOF_GENERATOR_H
18
#define CVC5__THEORY__BV__BITBLAST__BITBLAST_PROOF_GENERATOR_H
19
20
#include "proof/proof_generator.h"
21
#include "proof/proof_node_manager.h"
22
23
namespace cvc5 {
24
25
class TConvProofGenerator;
26
27
namespace theory {
28
namespace bv {
29
30
/** Proof generator fot bit-blast proofs. */
31
class BitblastProofGenerator : public ProofGenerator
32
{
33
 public:
34
  BitblastProofGenerator(ProofNodeManager* pnm, TConvProofGenerator* tcpg);
35
5588
  ~BitblastProofGenerator(){};
36
37
  /**
38
   * Get proof for, which expects an equality of the form t = bb(t).
39
   * This returns a proof based on the term conversion proof generator utility.
40
   */
41
  std::shared_ptr<ProofNode> getProofFor(Node eq) override;
42
43
9203
  std::string identify() const override { return "BitblastStepProofGenerator"; }
44
45
  /**
46
   * Record bit-blast step for bit-vector atom t.
47
   *
48
   * @param t Bit-vector atom
49
   * @param bbt The bit-blasted term obtained from bit-blasting t without
50
   *            applying any rewriting.
51
   * @param eq The equality that needs to be justified,
52
   *           i.e.,t = rewrite(bb(rewrite(t)))
53
   */
54
  void addBitblastStep(TNode t, TNode bbt, TNode eq);
55
56
 private:
57
  /** The associated proof node manager. */
58
  ProofNodeManager* d_pnm;
59
  /**
60
   * The associated term conversion proof generator, which tracks the
61
   * individual bit-blast steps.
62
   */
63
  TConvProofGenerator* d_tcpg;
64
65
  /**
66
   * Cache that maps equalities to information required to reconstruct the
67
   * proof for given equality.
68
   */
69
  std::unordered_map<Node, std::tuple<Node, Node>> d_cache;
70
};
71
72
}  // namespace bv
73
}  // namespace theory
74
}  // namespace cvc5
75
#endif