GCC Code Coverage Report
Directory: . Exec Total Coverage
File: build-coverage/src/options/uf_options.cpp Lines: 3 16 18.8 %
Date: 2021-11-07 Branches: 3 28 10.7 %

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/uf_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, UfssMode mode)
29
{
30
  switch(mode)
31
  {
32
    case UfssMode::NO_MINIMAL: return os << "no-minimal";
33
    case UfssMode::NONE: return os << "none";
34
    case UfssMode::FULL: return os << "full";
35
    default: Unreachable();
36
  }
37
  return os;
38
}
39
7
UfssMode stringToUfssMode(const std::string& optarg)
40
{
41
7
  if (optarg == "no-minimal") return UfssMode::NO_MINIMAL;
42
  else if (optarg == "none") return UfssMode::NONE;
43
  else if (optarg == "full") return UfssMode::FULL;
44
  else if (optarg == "help")
45
  {
46
    std::cerr << R"FOOBAR(
47
  UF with cardinality options currently supported by the --uf-ss option when
48
  combined with finite model finding.
49
Available modes for --uf-ss are:
50
+ no-minimal
51
  Use UF with cardinality to shrink models, but do no enforce minimality.
52
+ none
53
  Do not use UF with cardinality to shrink model sizes.
54
+ full (default)
55
  Default, use UF with cardinality to find minimal models for uninterpreted
56
  sorts.
57
)FOOBAR";
58
    std::exit(1);
59
  }
60
  throw OptionException(std::string("unknown option for --uf-ss: `") +
61
                        optarg + "'.  Try --uf-ss=help.");
62
}
63
// clang-format on
64
65
31137
}  // namespace cvc5::options