GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/prop/sat_solver_factory.cpp Lines: 13 15 86.7 %
Date: 2021-09-29 Branches: 6 18 33.3 %

Line Exec Source
1
/******************************************************************************
2
 * Top contributors (to current version):
3
 *   Mathias Preiner, Aina Niemetz, Dejan Jovanovic
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
 * SAT Solver creation facility.
14
 */
15
16
#include "prop/sat_solver_factory.h"
17
18
#include "prop/bvminisat/bvminisat.h"
19
#include "prop/cadical.h"
20
#include "prop/cryptominisat.h"
21
#include "prop/kissat.h"
22
#include "prop/minisat/minisat.h"
23
24
namespace cvc5 {
25
namespace prop {
26
27
3
BVSatSolverInterface* SatSolverFactory::createMinisat(
28
    context::Context* mainSatContext,
29
    StatisticsRegistry& registry,
30
    const std::string& name)
31
{
32
3
  return new BVMinisatSatSolver(registry, mainSatContext, name);
33
}
34
35
6328
MinisatSatSolver* SatSolverFactory::createCDCLTMinisat(
36
    StatisticsRegistry& registry)
37
{
38
6328
  return new MinisatSatSolver(registry);
39
}
40
41
4
SatSolver* SatSolverFactory::createCryptoMinisat(StatisticsRegistry& registry,
42
                                                 const std::string& name)
43
{
44
#ifdef CVC5_USE_CRYPTOMINISAT
45
4
  CryptoMinisatSolver* res = new CryptoMinisatSolver(registry, name);
46
4
  res->init();
47
4
  return res;
48
#else
49
  Unreachable() << "cvc5 was not compiled with Cryptominisat support.";
50
#endif
51
}
52
53
6109
SatSolver* SatSolverFactory::createCadical(StatisticsRegistry& registry,
54
                                           const std::string& name)
55
{
56
6109
  CadicalSolver* res = new CadicalSolver(registry, name);
57
6109
  res->init();
58
6109
  return res;
59
}
60
61
SatSolver* SatSolverFactory::createKissat(StatisticsRegistry& registry,
62
                                          const std::string& name)
63
{
64
#ifdef CVC5_USE_KISSAT
65
  KissatSolver* res = new KissatSolver(registry, name);
66
  res->init();
67
  return res;
68
#else
69
  Unreachable() << "cvc5 was not compiled with Kissat support.";
70
#endif
71
}
72
73
}  // namespace prop
74
22746
}  // namespace cvc5