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 information about a specific 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(). ThevalueInfomember holds any of the following alternatives:VoidInfoif the option holds no value (or the value has no native type)ValueInfoif the option is of typeboolorstd::string, holds the current value and the default value.NumberInfoif the option is of typeint64_t,uint64_tordouble, holds the current and default value, as well as the minimum and maximum.ModeInfoif 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
valueInfoholds 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
-
OptionInfo &operator=(OptionInfo &&info)
Move assignment operator.
-
bool boolValue() const
Get the current value as a
bool.Note
Asserts that
valueInfoholds abool.- Returns:
The current value as a
bool.
-
std::string stringValue() const
Get the current value as a
std::string.Note
Asserts that
valueInfoholds 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
valueInfoholds 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
valueInfoholds auint64_t.- Returns:
The current value as a
uint64_t.
-
double doubleValue() const
Obtain the current value as a
double.Note
Asserts that
valueInfoholds adouble.- Returns:
The current value as a
double.
-
std::string toString() const
Get a string representation of an option info.
- Returns:
The string representation.
Public Members
-
std::string name
The option name
-
std::vector<std::string> aliases
The option name aliases
-
std::vector<std::string> noSupports
The features not supported with this
-
bool setByUser
Whether the option was explicitly set by the user
-
bool isExpert
True if the option is an expert option
Warning
This field is deprecated and replaced by
category. It will be removed in a future release.
-
bool isRegular
True if the option is a regular option
Warning
This field is deprecated and replaced by
category. It will be removed in a future release.
-
modes::OptionCategory category
The category of this option.
-
OptionInfoVariant valueInfo
The option value information
-
struct ModeInfo
Information for mode option values.
-
template<typename T>
struct NumberInfo Information for numeric values.
Tcan beint64_t,uint64_tordouble.
-
template<typename T>
struct ValueInfo Basic information for option values.
Tcan beboolorstd::string.
-
struct VoidInfo
Has no value information.
-
std::ostream &cvc5::operator<<(std::ostream &os, const OptionInfo &oi)
Print an
OptionInfoobject to an output stream.- Parameters:
os – The output stream.
oi – The option info.
- Returns:
The output stream.