GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/theory/bv/proof_checker.cpp Lines: 13 23 56.5 %
Date: 2021-09-16 Branches: 10 156 6.4 %

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
 * Implementation of bit-vectors proof checker.
14
 */
15
16
#include "theory/bv/proof_checker.h"
17
18
namespace cvc5 {
19
namespace theory {
20
namespace bv {
21
22
3774
void BVProofRuleChecker::registerTo(ProofChecker* pc)
23
{
24
3774
  pc->registerChecker(PfRule::BV_BITBLAST, this);
25
3774
  pc->registerChecker(PfRule::BV_BITBLAST_STEP, this);
26
3774
  pc->registerChecker(PfRule::BV_EAGER_ATOM, this);
27
3774
}
28
29
7299
Node BVProofRuleChecker::checkInternal(PfRule id,
30
                                       const std::vector<Node>& children,
31
                                       const std::vector<Node>& args)
32
{
33
7299
  if (id == PfRule::BV_BITBLAST)
34
  {
35
    Assert(children.empty());
36
    Assert(args.size() == 1);
37
    Assert(args[0].getKind() == kind::EQUAL);
38
    return args[0];
39
  }
40
7299
  else if (id == PfRule::BV_BITBLAST_STEP)
41
  {
42
7299
    Assert(children.empty());
43
7299
    Assert(args.size() == 1);
44
7299
    Assert(args[0].getKind() == kind::EQUAL);
45
7299
    return args[0];
46
  }
47
  else if (id == PfRule::BV_EAGER_ATOM)
48
  {
49
    Assert(children.empty());
50
    Assert(args.size() == 1);
51
    Assert(args[0].getKind() == kind::BITVECTOR_EAGER_ATOM);
52
    return args[0].eqNode(args[0][0]);
53
  }
54
  // no rule
55
  return Node::null();
56
}
57
58
}  // namespace bv
59
}  // namespace theory
60
29577
}  // namespace cvc5