GCC Code Coverage Report
Directory: . Exec Total Coverage
File: build-coverage/src/options/base_options.h Lines: 6 6 100.0 %
Date: 2021-09-29 Branches: 2 4 50.0 %

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
 * Contains code for handling command-line options.
14
 *
15
 * For each <module>_options.toml configuration file, mkoptions.py
16
 * expands this template and generates a <module>_options.h file.
17
 */
18
19
#include "cvc5_private.h"
20
21
#ifndef CVC5__OPTIONS__BASE_H
22
#define CVC5__OPTIONS__BASE_H
23
24
#include "options/options.h"
25
26
// clang-format off
27
#include "options/language.h"
28
#include "options/managed_streams.h"
29
#include <bitset>
30
#include <iostream>
31
// clang-format on
32
33
namespace cvc5::options {
34
35
// clang-format off
36
enum class OutputTag
37
{
38
  INST, RAW_BENCHMARK, NONE, SYGUS, TRIGGER
39
};
40
static constexpr size_t OutputTag__numValues = 5;
41
std::ostream& operator<<(std::ostream& os, OutputTag mode);
42
OutputTag stringToOutputTag(const std::string& optarg);
43
44
// clang-format on
45
46
#if defined(CVC5_MUZZLED) || defined(CVC5_COMPETITION_MODE)
47
#  define DO_SEMANTIC_CHECKS_BY_DEFAULT false
48
#else /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */
49
#  define DO_SEMANTIC_CHECKS_BY_DEFAULT true
50
#endif /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */
51
52
44637
struct HolderBASE
53
{
54
// clang-format off
55
ManagedErr err;
56
  bool errWasSetByUser = false;
57
  ManagedIn in;
58
  bool inWasSetByUser = false;
59
  bool incrementalSolving = true;
60
  bool incrementalSolvingWasSetByUser = false;
61
  Language inputLanguage = Language::LANG_AUTO;
62
  bool inputLanguageWasSetByUser = false;
63
  bool languageHelp;
64
  bool languageHelpWasSetByUser = false;
65
  ManagedOut out;
66
  bool outWasSetByUser = false;
67
  OutputTag outputTag = OutputTag::NONE;
68
  bool outputTagWasSetByUser = false;
69
  Language outputLanguage = Language::LANG_AUTO;
70
  bool outputLanguageWasSetByUser = false;
71
  bool parseOnly;
72
  bool parseOnlyWasSetByUser = false;
73
  bool preprocessOnly;
74
  bool preprocessOnlyWasSetByUser = false;
75
  bool printSuccess;
76
  bool printSuccessWasSetByUser = false;
77
  uint64_t cumulativeResourceLimit;
78
  bool cumulativeResourceLimitWasSetByUser = false;
79
  uint64_t perCallResourceLimit;
80
  bool perCallResourceLimitWasSetByUser = false;
81
  bool statistics;
82
  bool statisticsWasSetByUser = false;
83
  bool statisticsAll;
84
  bool statisticsAllWasSetByUser = false;
85
  bool statisticsEveryQuery = false;
86
  bool statisticsEveryQueryWasSetByUser = false;
87
  bool statisticsExpert;
88
  bool statisticsExpertWasSetByUser = false;
89
  uint64_t cumulativeMillisecondLimit;
90
  bool cumulativeMillisecondLimitWasSetByUser = false;
91
  uint64_t perCallMillisecondLimit;
92
  bool perCallMillisecondLimitWasSetByUser = false;
93
  int64_t verbosity = 0;
94
  bool verbosityWasSetByUser = false;
95
  std::vector<std::string> resourceWeightHolder;
96
  bool resourceWeightHolderWasSetByUser = false;
97
  std::bitset<OutputTag__numValues> outputTagHolder;
98
  bool outputTagHolderWasSetByUser = false;
99
// clang-format on
100
};
101
102
#undef DO_SEMANTIC_CHECKS_BY_DEFAULT
103
104
// clang-format off
105
inline ManagedErr err() { return Options::current().base.err; }
106
inline ManagedIn in() { return Options::current().base.in; }
107
796420
inline bool incrementalSolving() { return Options::current().base.incrementalSolving; }
108
54966
inline Language inputLanguage() { return Options::current().base.inputLanguage; }
109
inline bool languageHelp() { return Options::current().base.languageHelp; }
110
inline ManagedOut out() { return Options::current().base.out; }
111
inline OutputTag outputTag() { return Options::current().base.outputTag; }
112
32135
inline Language outputLanguage() { return Options::current().base.outputLanguage; }
113
inline bool parseOnly() { return Options::current().base.parseOnly; }
114
9354
inline bool preprocessOnly() { return Options::current().base.preprocessOnly; }
115
inline bool printSuccess() { return Options::current().base.printSuccess; }
116
inline uint64_t cumulativeResourceLimit() { return Options::current().base.cumulativeResourceLimit; }
117
inline uint64_t perCallResourceLimit() { return Options::current().base.perCallResourceLimit; }
118
inline bool statistics() { return Options::current().base.statistics; }
119
inline bool statisticsAll() { return Options::current().base.statisticsAll; }
120
inline bool statisticsEveryQuery() { return Options::current().base.statisticsEveryQuery; }
121
inline bool statisticsExpert() { return Options::current().base.statisticsExpert; }
122
inline uint64_t cumulativeMillisecondLimit() { return Options::current().base.cumulativeMillisecondLimit; }
123
inline uint64_t perCallMillisecondLimit() { return Options::current().base.perCallMillisecondLimit; }
124
9351
inline int64_t verbosity() { return Options::current().base.verbosity; }
125
inline std::vector<std::string> resourceWeightHolder() { return Options::current().base.resourceWeightHolder; }
126
inline std::bitset<OutputTag__numValues> outputTagHolder() { return Options::current().base.outputTagHolder; }
127
// clang-format on
128
129
namespace base
130
{
131
// clang-format off
132
static constexpr const char* err__name = "err";
133
static constexpr const char* in__name = "in";
134
static constexpr const char* incrementalSolving__name = "incremental";
135
static constexpr const char* inputLanguage__name = "lang";
136
static constexpr const char* languageHelp__name = "language-help";
137
static constexpr const char* out__name = "out";
138
static constexpr const char* outputTag__name = "output";
139
static constexpr const char* outputLanguage__name = "output-lang";
140
static constexpr const char* parseOnly__name = "parse-only";
141
static constexpr const char* preprocessOnly__name = "preprocess-only";
142
static constexpr const char* printSuccess__name = "print-success";
143
static constexpr const char* cumulativeResourceLimit__name = "rlimit";
144
static constexpr const char* perCallResourceLimit__name = "rlimit-per";
145
static constexpr const char* statistics__name = "stats";
146
static constexpr const char* statisticsAll__name = "stats-all";
147
static constexpr const char* statisticsEveryQuery__name = "stats-every-query";
148
static constexpr const char* statisticsExpert__name = "stats-expert";
149
static constexpr const char* cumulativeMillisecondLimit__name = "tlimit";
150
static constexpr const char* perCallMillisecondLimit__name = "tlimit-per";
151
static constexpr const char* verbosity__name = "verbosity";
152
153
void setDefaultErr(Options& opts, ManagedErr value);
154
void setDefaultIn(Options& opts, ManagedIn value);
155
void setDefaultIncrementalSolving(Options& opts, bool value);
156
void setDefaultInputLanguage(Options& opts, Language value);
157
void setDefaultLanguageHelp(Options& opts, bool value);
158
void setDefaultOut(Options& opts, ManagedOut value);
159
void setDefaultOutputTag(Options& opts, OutputTag value);
160
void setDefaultOutputLanguage(Options& opts, Language value);
161
void setDefaultParseOnly(Options& opts, bool value);
162
void setDefaultPreprocessOnly(Options& opts, bool value);
163
void setDefaultPrintSuccess(Options& opts, bool value);
164
void setDefaultCumulativeResourceLimit(Options& opts, uint64_t value);
165
void setDefaultPerCallResourceLimit(Options& opts, uint64_t value);
166
void setDefaultStatistics(Options& opts, bool value);
167
void setDefaultStatisticsAll(Options& opts, bool value);
168
void setDefaultStatisticsEveryQuery(Options& opts, bool value);
169
void setDefaultStatisticsExpert(Options& opts, bool value);
170
void setDefaultCumulativeMillisecondLimit(Options& opts, uint64_t value);
171
void setDefaultPerCallMillisecondLimit(Options& opts, uint64_t value);
172
void setDefaultVerbosity(Options& opts, int64_t value);
173
void setDefaultResourceWeightHolder(Options& opts, std::vector<std::string> value);
174
void setDefaultOutputTagHolder(Options& opts, std::bitset<OutputTag__numValues> value);
175
// clang-format on
176
}
177
178
}  // namespace cvc5::options
179
180
#endif /* CVC5__OPTIONS__BASE_H */