Clingo
Loading...
Searching...
No Matches
CppClingo::Control::Model Class Referenceabstract

The model class. More...

#include <solver.hh>

Public Member Functions

void symbols (SymbolSelectFlags type, SymbolVec &res) const
 Get the selected symbols in the model.
 
auto number () const -> uint64_t
 Get the running number of the model.
 
auto type () const -> ModelType
 Get the type of the model.
 
auto contains (Symbol sym) const -> bool
 Check if the model contains a (symbolic) atom.
 
auto is_true (prg_lit_t lit) const -> bool
 Check if a program literal is true in a model.
 
auto is_consequence (prg_lit_t lit) const -> ConsequenceType
 Check whether the given literal is a consequence.
 
auto costs () const -> std::span< prg_sum_t const >
 Get the costs associated with a model.
 
auto priorities () const -> std::span< prg_weight_t const >
 get the priorities of the costs.
 
auto optimality_proven () const -> bool
 Check if the model corresponds to an optimal solution.
 
auto thread_id () const -> prg_id_t
 Get the solver/thread id the model was found in.
 
auto context () -> SolveControl &
 Get the context object to control the search.
 
virtual void extend (SymbolSpan symbols)
 Extend the model with the given symbols.
 

Detailed Description

The model class.

Member Function Documentation

◆ contains()

auto CppClingo::Control::Model::contains ( Symbol  sym) const -> bool
inline

Check if the model contains a (symbolic) atom.

Parameters
symThe symbol representing the atom.
Returns
whether the atom is contained

◆ context()

auto CppClingo::Control::Model::context ( ) -> SolveControl &
inline

Get the context object to control the search.

Returns
the context object

◆ costs()

auto CppClingo::Control::Model::costs ( ) const -> std::span<prg_sum_t const>
inline

Get the costs associated with a model.

Returns
the costs

◆ is_consequence()

auto CppClingo::Control::Model::is_consequence ( prg_lit_t  lit) const -> ConsequenceType
inline

Check whether the given literal is a consequence.

Parameters
litthe literal to check
Returns
whether the literal is a consequence

◆ is_true()

auto CppClingo::Control::Model::is_true ( prg_lit_t  lit) const -> bool
inline

Check if a program literal is true in a model.

Parameters
litthe program literal
Returns
whether the literal is true

◆ number()

auto CppClingo::Control::Model::number ( ) const -> uint64_t
inline

Get the running number of the model.

Returns
the number

◆ optimality_proven()

auto CppClingo::Control::Model::optimality_proven ( ) const -> bool
inline

Check if the model corresponds to an optimal solution.

Returns
whether the model is optimal

◆ priorities()

auto CppClingo::Control::Model::priorities ( ) const -> std::span<prg_weight_t const>
inline

get the priorities of the costs.

Returns
the priorities

◆ symbols()

void CppClingo::Control::Model::symbols ( SymbolSelectFlags  type,
SymbolVec res 
) const
inline

Get the selected symbols in the model.

Parameters
typewhich symbols to select
resa vector to store the symbols

◆ thread_id()

auto CppClingo::Control::Model::thread_id ( ) const -> prg_id_t
inline

Get the solver/thread id the model was found in.

Returns
the thread id

◆ type()

auto CppClingo::Control::Model::type ( ) const -> ModelType
inline

Get the type of the model.

Returns
the type

The documentation for this class was generated from the following file: