GCC Code Coverage Report
Directory: . Exec Total Coverage
File: build-coverage/src/options/decision_options.h Lines: 9 17 52.9 %
Date: 2021-08-06 Branches: 0 0 0.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__DECISION_H
22
#define CVC5__OPTIONS__DECISION_H
23
24
#include "options/options.h"
25
26
// clang-format off
27
#include "options/decision_weight.h"
28
// clang-format on
29
30
namespace cvc5 {
31
namespace options {
32
33
// clang-format off
34
35
enum class DecisionWeightInternal
36
{
37
  USR1,
38
  MAX,
39
  SUM,
40
  OFF
41
};
42
43
static constexpr size_t DecisionWeightInternal__numValues = 4;
44
45
std::ostream& operator<<(std::ostream& os, DecisionWeightInternal mode);
46
DecisionWeightInternal stringToDecisionWeightInternal(const std::string& optarg);
47
enum class DecisionMode
48
{
49
  INTERNAL,
50
  STOPONLY,
51
  STOPONLY_OLD,
52
  JUSTIFICATION_OLD,
53
  JUSTIFICATION
54
};
55
56
static constexpr size_t DecisionMode__numValues = 5;
57
58
std::ostream& operator<<(std::ostream& os, DecisionMode mode);
59
DecisionMode stringToDecisionMode(const std::string& optarg);
60
enum class JutificationSkolemRlvMode
61
{
62
  ALWAYS,
63
  ASSERT
64
};
65
66
static constexpr size_t JutificationSkolemRlvMode__numValues = 2;
67
68
std::ostream& operator<<(std::ostream& os, JutificationSkolemRlvMode mode);
69
JutificationSkolemRlvMode stringToJutificationSkolemRlvMode(const std::string& optarg);
70
enum class JutificationSkolemMode
71
{
72
  LAST,
73
  FIRST
74
};
75
76
static constexpr size_t JutificationSkolemMode__numValues = 2;
77
78
std::ostream& operator<<(std::ostream& os, JutificationSkolemMode mode);
79
JutificationSkolemMode stringToJutificationSkolemMode(const std::string& optarg);
80
// clang-format on
81
82
#if defined(CVC5_MUZZLED) || defined(CVC5_COMPETITION_MODE)
83
#  define DO_SEMANTIC_CHECKS_BY_DEFAULT false
84
#else /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */
85
#  define DO_SEMANTIC_CHECKS_BY_DEFAULT true
86
#endif /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */
87
88
27401
struct HolderDECISION
89
{
90
// clang-format off
91
  int64_t decisionRandomWeight = 0;
92
  bool decisionRandomWeightWasSetByUser = false;
93
  cvc5::decision::DecisionWeight decisionThreshold = 0;
94
  bool decisionThresholdWasSetByUser = false;
95
  bool decisionUseWeight = false;
96
  bool decisionUseWeightWasSetByUser = false;
97
  DecisionWeightInternal decisionWeightInternal = DecisionWeightInternal::OFF;
98
  bool decisionWeightInternalWasSetByUser = false;
99
  DecisionMode decisionMode = DecisionMode::INTERNAL;
100
  bool decisionModeWasSetByUser = false;
101
  bool jhRlvOrder = false;
102
  bool jhRlvOrderWasSetByUser = false;
103
  JutificationSkolemRlvMode jhSkolemRlvMode = JutificationSkolemRlvMode::ASSERT;
104
  bool jhSkolemRlvModeWasSetByUser = false;
105
  JutificationSkolemMode jhSkolemMode = JutificationSkolemMode::FIRST;
106
  bool jhSkolemModeWasSetByUser = false;
107
// clang-format on
108
};
109
110
#undef DO_SEMANTIC_CHECKS_BY_DEFAULT
111
112
// clang-format off
113
extern struct decisionRandomWeight__option_t
114
{
115
  typedef int64_t type;
116
  type operator()() const;
117
} thread_local decisionRandomWeight;
118
extern struct decisionThreshold__option_t
119
{
120
  typedef cvc5::decision::DecisionWeight type;
121
  type operator()() const;
122
} thread_local decisionThreshold;
123
extern struct decisionUseWeight__option_t
124
{
125
  typedef bool type;
126
  type operator()() const;
127
} thread_local decisionUseWeight;
128
extern struct decisionWeightInternal__option_t
129
{
130
  typedef DecisionWeightInternal type;
131
  type operator()() const;
132
} thread_local decisionWeightInternal;
133
extern struct decisionMode__option_t
134
{
135
  typedef DecisionMode type;
136
  type operator()() const;
137
} thread_local decisionMode;
138
extern struct jhRlvOrder__option_t
139
{
140
  typedef bool type;
141
  type operator()() const;
142
} thread_local jhRlvOrder;
143
extern struct jhSkolemRlvMode__option_t
144
{
145
  typedef JutificationSkolemRlvMode type;
146
  type operator()() const;
147
} thread_local jhSkolemRlvMode;
148
extern struct jhSkolemMode__option_t
149
{
150
  typedef JutificationSkolemMode type;
151
  type operator()() const;
152
} thread_local jhSkolemMode;
153
// clang-format on
154
155
namespace decision
156
{
157
// clang-format off
158
static constexpr const char* decisionRandomWeight__name = "decision-random-weight";
159
static constexpr const char* decisionThreshold__name = "decision-threshold";
160
static constexpr const char* decisionUseWeight__name = "decision-use-weight";
161
static constexpr const char* decisionWeightInternal__name = "decision-weight-internal";
162
static constexpr const char* decisionMode__name = "decision";
163
static constexpr const char* jhRlvOrder__name = "jh-rlv-order";
164
static constexpr const char* jhSkolemRlvMode__name = "jh-skolem-rlv";
165
static constexpr const char* jhSkolemMode__name = "jh-skolem";
166
// clang-format on
167
}
168
169
}  // namespace options
170
171
// clang-format off
172
173
// clang-format on
174
175
namespace options {
176
// clang-format off
177
inline int64_t decisionRandomWeight__option_t::operator()() const
178
{ return Options::current().decision.decisionRandomWeight; }
179
inline cvc5::decision::DecisionWeight decisionThreshold__option_t::operator()() const
180
{ return Options::current().decision.decisionThreshold; }
181
inline bool decisionUseWeight__option_t::operator()() const
182
{ return Options::current().decision.decisionUseWeight; }
183
inline DecisionWeightInternal decisionWeightInternal__option_t::operator()() const
184
{ return Options::current().decision.decisionWeightInternal; }
185
35273
inline DecisionMode decisionMode__option_t::operator()() const
186
35273
{ return Options::current().decision.decisionMode; }
187
15478
inline bool jhRlvOrder__option_t::operator()() const
188
15478
{ return Options::current().decision.jhRlvOrder; }
189
7739
inline JutificationSkolemRlvMode jhSkolemRlvMode__option_t::operator()() const
190
7739
{ return Options::current().decision.jhSkolemRlvMode; }
191
7739
inline JutificationSkolemMode jhSkolemMode__option_t::operator()() const
192
7739
{ return Options::current().decision.jhSkolemMode; }
193
// clang-format on
194
195
namespace decision
196
{
197
// clang-format off
198
void setDefaultDecisionRandomWeight(Options& opts, int64_t value);
199
void setDefaultDecisionThreshold(Options& opts, cvc5::decision::DecisionWeight value);
200
void setDefaultDecisionUseWeight(Options& opts, bool value);
201
void setDefaultDecisionWeightInternal(Options& opts, DecisionWeightInternal value);
202
void setDefaultDecisionMode(Options& opts, DecisionMode value);
203
void setDefaultJhRlvOrder(Options& opts, bool value);
204
void setDefaultJhSkolemRlvMode(Options& opts, JutificationSkolemRlvMode value);
205
void setDefaultJhSkolemMode(Options& opts, JutificationSkolemMode value);
206
// clang-format on
207
}
208
209
}  // namespace options
210
}  // namespace cvc5
211
212
#endif /* CVC5__OPTIONS__DECISION_H */