OptionInfo
This class encapsulates all the information associated with a configuration
option. It can be retrieved via
cvc5::Solver::getOptionInfo()
and allows to query any configuration information associated with an option.
-
struct
OptionInfo
-
Holds some description about a particular option, including its name, its aliases, whether the option was explicitly set by the user, and information concerning its value. It can be obtained via
Solver::getOptionInfo()
and allows for a more detailed inspection of options thanSolver::getOption()
. ThevalueInfo
member holds any of the following alternatives:-
VoidInfo
if the option holds no value (or the value has no native type) -
ValueInfo
if the option is of typebool
orstd::string
, holds the current value and the default value. -
NumberInfo
if the option is of typeint64_t
,uint64_t
ordouble
, holds the current and default value, as well as the minimum and maximum. -
ModeInfo
if the option is a mode option, holds the current and default values, as well as a list of valid modes.
Additionally, this class provides convenience functions to obtain the current value of an option in a type-safe manner using
boolValue()
,stringValue()
,intValue()
,uintValue()
anddoubleValue()
. They assert that the option has the respective type and return the current value.If the option has a special type that is not covered by the above alternatives, the
valueInfo
holds aVoidInfo
. Some options, that are expected to be used by frontends (e.g., input and output streams) can also be accessed usingSolver::getDriverOptions()
.Public Types
-
using
OptionInfoVariant
=
std
::
variant
<
VoidInfo
,
ValueInfo
<
bool
>
,
ValueInfo
<
std
::
string
>
,
NumberInfo
<
int64_t
>
,
NumberInfo
<
uint64_t
>
,
NumberInfo
<
double
>
,
ModeInfo
>
-
Possible types for
valueInfo
.
Public Functions
-
bool
boolValue
(
)
const
-
Get the current value as a
bool
.Note
Asserts that
valueInfo
holds abool
.- Returns :
-
The current value as a
bool
.
-
std
::
string
stringValue
(
)
const
-
Get the current value as a
std::string
.Note
Asserts that
valueInfo
holds astd::string
.- Returns :
-
The current value as a
std::string
.
-
int64_t
intValue
(
)
const
-
Get the current value as an
int64_t
.Note
Asserts that
valueInfo
holds anint64_t
.- Returns :
-
The current value as a
int64_t
.
-
uint64_t
uintValue
(
)
const
-
Get the current value as a
uint64_t
.Note
Asserts that
valueInfo
holds auint64_t
.- Returns :
-
The current value as a
uint64_t
.
-
double
doubleValue
(
)
const
-
Obtain the current value as a
double
.Note
Asserts that
valueInfo
holds adouble
.- Returns :
-
The current value as a
double
.
Public Members
-
std
::
string
name
-
The option name
-
std
::
vector
<
std
::
string
>
aliases
-
The option name aliases
-
bool
setByUser
-
Whether the option was explicitly set by the user
-
bool
isExpert
-
Whether this is an expert option
-
bool
isRegular
-
Whether this is a regular option
-
OptionInfoVariant
valueInfo
-
The option value information
-
struct
ModeInfo
-
Information for mode option values.
-
template
<
typename
T
>
struct NumberInfo
-
Information for numeric values.
T
can beint64_t
,uint64_t
ordouble
.
-
template
<
typename
T
>
struct ValueInfo
-
Basic information for option values.
T
can bebool
orstd::string
.
-
struct
VoidInfo
-
Has no value information.
-
-
std
::
ostream
&
cvc5
::
operator
<<
(
std
::
ostream
&
os
,
const
OptionInfo
&
oi
)
-
Print an
OptionInfo
object to anstd::ostream
.