GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/proof/unsat_core.cpp Lines: 19 23 82.6 %
Date: 2021-08-16 Branches: 17 34 50.0 %

Line Exec Source
1
/******************************************************************************
2
 * Top contributors (to current version):
3
 *   Morgan Deters, Andrew Reynolds, Clark Barrett
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
 * Representation of unsat cores.
14
 */
15
16
#include "proof/unsat_core.h"
17
18
#include "base/check.h"
19
#include "expr/expr_iomanip.h"
20
#include "options/base_options.h"
21
#include "printer/printer.h"
22
#include "smt/smt_engine_scope.h"
23
24
namespace cvc5 {
25
26
1427
UnsatCore::UnsatCore(const std::vector<Node>& core)
27
1427
    : d_useNames(false), d_core(core), d_names()
28
{
29
1427
  Debug("core") << "UnsatCore size " << d_core.size() << std::endl;
30
1427
}
31
32
9
UnsatCore::UnsatCore(std::vector<std::string>& names)
33
9
    : d_useNames(true), d_core(), d_names(names)
34
{
35
9
  Debug("core") << "UnsatCore (names) size " << d_names.size() << std::endl;
36
9
}
37
38
const std::vector<Node>& UnsatCore::getCore() const { return d_core; }
39
9
const std::vector<std::string>& UnsatCore::getCoreNames() const
40
{
41
9
  return d_names;
42
}
43
44
1438
UnsatCore::const_iterator UnsatCore::begin() const {
45
1438
  return d_core.begin();
46
}
47
48
7496
UnsatCore::const_iterator UnsatCore::end() const {
49
7496
  return d_core.end();
50
}
51
52
12
void UnsatCore::toStream(std::ostream& out) const {
53
24
  expr::ExprDag::Scope scope(out, false);
54
12
  Printer::getPrinter(options::outputLanguage())->toStream(out, *this);
55
12
}
56
57
std::ostream& operator<<(std::ostream& out, const UnsatCore& core) {
58
  core.toStream(out);
59
  return out;
60
}
61
62
29340
}  // namespace cvc5