GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/proof/unsat_core.cpp Lines: 19 23 82.6 %
Date: 2021-05-22 Branches: 18 42 42.9 %

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
1367
UnsatCore::UnsatCore(const std::vector<Node>& core)
27
1367
    : d_useNames(false), d_core(core), d_names()
28
{
29
1367
  Debug("core") << "UnsatCore size " << d_core.size() << std::endl;
30
1367
}
31
32
7
UnsatCore::UnsatCore(std::vector<std::string>& names)
33
7
    : d_useNames(true), d_core(), d_names(names)
34
{
35
7
  Debug("core") << "UnsatCore (names) size " << d_names.size() << std::endl;
36
7
}
37
38
const std::vector<Node>& UnsatCore::getCore() const { return d_core; }
39
7
const std::vector<std::string>& UnsatCore::getCoreNames() const
40
{
41
7
  return d_names;
42
}
43
44
1378
UnsatCore::const_iterator UnsatCore::begin() const {
45
1378
  return d_core.begin();
46
}
47
48
7323
UnsatCore::const_iterator UnsatCore::end() const {
49
7323
  return d_core.end();
50
}
51
52
10
void UnsatCore::toStream(std::ostream& out) const {
53
20
  expr::ExprDag::Scope scope(out, false);
54
10
  Printer::getPrinter(options::outputLanguage())->toStream(out, *this);
55
10
}
56
57
std::ostream& operator<<(std::ostream& out, const UnsatCore& core) {
58
  core.toStream(out);
59
  return out;
60
}
61
62
28191
}  // namespace cvc5