Class to provide an immutable view of a model.
More...
#include <solve.hh>
Class to provide an immutable view of a model.
◆ ConstModel()
Constructor from the underlying C representation.
For internal use.
- Parameters
-
mdl | the C representation of the model |
◆ contains()
auto Clingo::ConstModel::contains |
( |
Symbol const & |
atom | ) |
const -> bool |
|
inline |
Check if the model contains a specific atom.
- Parameters
-
- Returns
- whether the model contains the atom
◆ cost()
auto Clingo::ConstModel::cost |
( |
| ) |
const -> SumSpan |
|
inline |
Get the cost of the model.
Each priority of a minimize constraint is associated with a cost.
- Returns
- the cost of the model
◆ is_consequence()
auto Clingo::ConstModel::is_consequence |
( |
ProgramLiteral |
lit | ) |
const -> std::optional<bool> |
|
inline |
Check whether the given literal is consequence of the model.
The function return std::nullopt if it is not known whether the literal is a consequence. Otherwise, it returns true if the literal is a consequence and false if it is not.
- Parameters
-
- Returns
- whether the literal is a consequence
◆ is_true()
Check whether the given literal is true in the model.
- Parameters
-
- Returns
- whether the literal is true in the model
◆ number()
auto Clingo::ConstModel::number |
( |
| ) |
const -> uint64_t |
|
inline |
Get the running number of the model.
- Returns
- the running number of the model
◆ optimality_proven()
auto Clingo::ConstModel::optimality_proven |
( |
| ) |
const -> bool |
|
inline |
Check whether the model is proven to be optimal.
Depending on the reasoning mode and the context the model is access, this function might return false even though the model is optimal.
- Returns
- whether the model is proven to be optimal
◆ priorities()
auto Clingo::ConstModel::priorities |
( |
| ) |
const -> WeightSpan |
|
inline |
Get the priorities of the costs of a model.
- Returns
- the priorities of the costs
◆ symbols()
Get the symbols of the model.
- Parameters
-
flags | the flags to select which symbols to return |
- Returns
- the symbols of the model
◆ thread_id()
auto Clingo::ConstModel::thread_id |
( |
| ) |
const -> ProgramId |
|
inline |
Get the thread id of the solver that found the model.
- Returns
- the thread id of the solver that found the model
◆ to_string()
auto Clingo::ConstModel::to_string |
( |
| ) |
const -> std::string |
|
inline |
Convert the model to a string representation.
- Returns
- the string representation of the model
◆ type()
auto Clingo::ConstModel::type |
( |
| ) |
const -> ModelType |
|
inline |
Get the type of the model.
- Returns
- the type of the model
◆ c_cast
Cast the model to its C representation.
- Parameters
-
- Returns
- the C representation of the model
The documentation for this class was generated from the following file: