GCC Code Coverage Report
Directory: . Exec Total Coverage
File: build-coverage/src/options/datatypes_options.cpp Lines: 7 20 35.0 %
Date: 2021-11-07 Branches: 7 34 20.6 %

Line Exec Source
1
/******************************************************************************
2
 * Top contributors (to current version):
3
 *   Mathias Preiner, 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
 * Option template for option modules.
14
 *
15
 * For each <module>_options.toml configuration file, mkoptions.py
16
 * expands this template and generates a <module>_options.cpp file.
17
 */
18
#include "options/datatypes_options.h"
19
20
#include <iostream>
21
22
#include "base/check.h"
23
#include "options/option_exception.h"
24
25
namespace cvc5::options {
26
27
// clang-format off
28
std::ostream& operator<<(std::ostream& os, SygusFairMode mode)
29
{
30
  switch(mode)
31
  {
32
    case SygusFairMode::DT_HEIGHT_PRED: return os << "dt-height-bound";
33
    case SygusFairMode::NONE: return os << "none";
34
    case SygusFairMode::DT_SIZE_PRED: return os << "dt-size-bound";
35
    case SygusFairMode::DT_SIZE: return os << "dt-size";
36
    case SygusFairMode::DIRECT: return os << "direct";
37
    default: Unreachable();
38
  }
39
  return os;
40
}
41
4
SygusFairMode stringToSygusFairMode(const std::string& optarg)
42
{
43
4
  if (optarg == "dt-height-bound") return SygusFairMode::DT_HEIGHT_PRED;
44
4
  else if (optarg == "none") return SygusFairMode::NONE;
45
4
  else if (optarg == "dt-size-bound") return SygusFairMode::DT_SIZE_PRED;
46
4
  else if (optarg == "dt-size") return SygusFairMode::DT_SIZE;
47
4
  else if (optarg == "direct") return SygusFairMode::DIRECT;
48
  else if (optarg == "help")
49
  {
50
    std::cerr << R"FOOBAR(
51
  Modes for enforcing fairness for counterexample guided quantifier instantion.
52
Available modes for --sygus-fair are:
53
+ dt-height-bound
54
  Enforce fairness by height bound predicate.
55
+ none
56
  Do not enforce fairness.
57
+ dt-size-bound
58
  Enforce fairness by size bound predicate.
59
+ dt-size (default)
60
  Enforce fairness using size operator.
61
+ direct
62
  Enforce fairness using direct conflict lemmas.
63
)FOOBAR";
64
    std::exit(1);
65
  }
66
  throw OptionException(std::string("unknown option for --sygus-fair: `") +
67
                        optarg + "'.  Try --sygus-fair=help.");
68
}
69
// clang-format on
70
71
31137
}  // namespace cvc5::options