GCC Code Coverage Report
Directory: . Exec Total Coverage
File: build-coverage/src/options/base_options.cpp Lines: 14 22 63.6 %
Date: 2021-11-07 Branches: 18 37 48.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/base_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
2
std::ostream& operator<<(std::ostream& os, OutputTag mode)
29
{
30
2
  switch(mode)
31
  {
32
    case OutputTag::SYGUS_GRAMMAR: return os << "sygus-grammar";
33
    case OutputTag::TRIGGER: return os << "trigger";
34
    case OutputTag::RAW_BENCHMARK: return os << "raw-benchmark";
35
2
    case OutputTag::NONE: return os << "none";
36
    case OutputTag::INST: return os << "inst";
37
    case OutputTag::SYGUS: return os << "sygus";
38
    default: Unreachable();
39
  }
40
  return os;
41
}
42
242472
OutputTag stringToOutputTag(const std::string& optarg)
43
{
44
242472
  if (optarg == "sygus-grammar") return OutputTag::SYGUS_GRAMMAR;
45
242470
  else if (optarg == "trigger") return OutputTag::TRIGGER;
46
242470
  else if (optarg == "raw-benchmark") return OutputTag::RAW_BENCHMARK;
47
18
  else if (optarg == "none") return OutputTag::NONE;
48
18
  else if (optarg == "inst") return OutputTag::INST;
49
6
  else if (optarg == "sygus") return OutputTag::SYGUS;
50
4
  else if (optarg == "help")
51
  {
52
    std::cerr << R"FOOBAR(
53
  Output tags.
54
Available tags for --output are:
55
+ sygus-grammar
56
  print grammars automatically generated by the sygus solver
57
+ trigger
58
  print selected triggers for quantified formulas
59
+ raw-benchmark
60
  print the benchmark back on the output verbatim as it is processed
61
+ inst
62
  print instantiations during solving
63
+ sygus
64
  print enumerated terms and candidates generated by the sygus solver
65
)FOOBAR";
66
    std::exit(1);
67
  }
68
8
  throw OptionException(std::string("unknown option for --output: `") +
69
12
                        optarg + "'.  Try --output=help.");
70
}
71
// clang-format on
72
73
31137
}  // namespace cvc5::options