GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/theory/bv/bitblast/bitblast_proof_generator.h Lines: 2 2 100.0 %
Date: 2021-11-07 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
#include "smt/env_obj.h"
23
24
namespace cvc5 {
25
26
class TConvProofGenerator;
27
28
namespace theory {
29
namespace bv {
30
31
/** Proof generator fot bit-blast proofs. */
32
class BitblastProofGenerator : public ProofGenerator, protected EnvObj
33
{
34
 public:
35
  BitblastProofGenerator(Env& env,
36
                         ProofNodeManager* pnm,
37
                         TConvProofGenerator* tcpg);
38
13868
  ~BitblastProofGenerator(){};
39
40
  /**
41
   * Get proof for, which expects an equality of the form t = bb(t).
42
   * This returns a proof based on the term conversion proof generator utility.
43
   */
44
  std::shared_ptr<ProofNode> getProofFor(Node eq) override;
45
46
9226
  std::string identify() const override { return "BitblastStepProofGenerator"; }
47
48
  /**
49
   * Record bit-blast step for bit-vector atom t.
50
   *
51
   * @param t Bit-vector atom
52
   * @param bbt The bit-blasted term obtained from bit-blasting t without
53
   *            applying any rewriting.
54
   * @param eq The equality that needs to be justified,
55
   *           i.e.,t = rewrite(bb(rewrite(t)))
56
   */
57
  void addBitblastStep(TNode t, TNode bbt, TNode eq);
58
59
 private:
60
  /** The associated proof node manager. */
61
  ProofNodeManager* d_pnm;
62
  /**
63
   * The associated term conversion proof generator, which tracks the
64
   * individual bit-blast steps.
65
   */
66
  TConvProofGenerator* d_tcpg;
67
68
  /**
69
   * Cache that maps equalities to information required to reconstruct the
70
   * proof for given equality.
71
   */
72
  std::unordered_map<Node, std::tuple<Node, Node>> d_cache;
73
};
74
75
}  // namespace bv
76
}  // namespace theory
77
}  // namespace cvc5
78
#endif