GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/theory/arith/nl/cad/proof_checker.cpp Lines: 15 16 93.8 %
Date: 2021-05-22 Branches: 21 64 32.8 %

Line Exec Source
1
/******************************************************************************
2
 * Top contributors (to current version):
3
 *   Gereon Kremer, Aina Niemetz
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 CAD proof checker.
14
 */
15
16
#include "theory/arith/nl/cad/proof_checker.h"
17
18
#include "expr/sequence.h"
19
#include "theory/rewriter.h"
20
21
using namespace cvc5::kind;
22
23
namespace cvc5 {
24
namespace theory {
25
namespace arith {
26
namespace nl {
27
namespace cad {
28
29
543
void CADProofRuleChecker::registerTo(ProofChecker* pc)
30
{
31
  // trusted rules
32
543
  pc->registerTrustedChecker(PfRule::ARITH_NL_CAD_DIRECT, this, 2);
33
543
  pc->registerTrustedChecker(PfRule::ARITH_NL_CAD_RECURSIVE, this, 2);
34
543
}
35
36
5
Node CADProofRuleChecker::checkInternal(PfRule id,
37
                                        const std::vector<Node>& children,
38
                                        const std::vector<Node>& args)
39
{
40
5
  Trace("nl-cad-checker") << "Checking " << id << std::endl;
41
18
  for (const auto& c : children)
42
  {
43
13
    Trace("nl-cad-checker") << "\t" << c << std::endl;
44
  }
45
5
  if (id == PfRule::ARITH_NL_CAD_DIRECT)
46
  {
47
3
    Assert(args.size() == 1);
48
3
    return args[0];
49
  }
50
2
  if (id == PfRule::ARITH_NL_CAD_RECURSIVE)
51
  {
52
2
    Assert(args.size() == 1);
53
2
    return args[0];
54
  }
55
  return Node::null();
56
}
57
58
}  // namespace cad
59
}  // namespace nl
60
}  // namespace arith
61
}  // namespace theory
62
28191
}  // namespace cvc5