Clingo
Loading...
Searching...
No Matches
Clingo::TheoryAssignment Class Reference

Class to represent a theory assignment. More...

#include <theory.hh>

Classes

class  iterator
 Iterator type for the theory assignment. More...
 
struct  sentinel
 Sentinel type for the end of the theory assignment. More...
 

Public Member Functions

 TheoryAssignment (clingo_theory_t const *theory, uint32_t thread_id)
 Construct a theory assignment from its C representation and a thread id.
 
auto lookup (Symbol const &sym) const -> std::optional< size_t >
 Lookup a symbol in the theory assignment.
 
auto at (size_t index) const -> std::pair< Symbol, std::variant< int, double, Symbol > >
 Get the symbol value pair at the given index in the theory assignment.
 
auto begin () const -> iterator
 Get an iterator pointing to the first element of the theory assignment.
 

Static Public Member Functions

static auto end () -> sentinel
 Get sentinel marking the end of the theory assignment.
 

Detailed Description

Class to represent a theory assignment.

Constructor & Destructor Documentation

◆ TheoryAssignment()

Clingo::TheoryAssignment::TheoryAssignment ( clingo_theory_t const theory,
uint32_t  thread_id 
)
inlineexplicit

Construct a theory assignment from its C representation and a thread id.

Parameters
theorythe C theory representation
thread_idthe thread id for which to get the assignment

Member Function Documentation

◆ at()

auto Clingo::TheoryAssignment::at ( size_t  index) const -> std::pair<Symbol, std::variant<int, double, Symbol>>
inline

Get the symbol value pair at the given index in the theory assignment.

Parameters
indexthe index of the value to get
Returns
the symbol and its value at the given index

◆ begin()

auto Clingo::TheoryAssignment::begin ( ) const -> iterator
inline

Get an iterator pointing to the first element of the theory assignment.

Returns
an iterator to the first element

◆ end()

static auto Clingo::TheoryAssignment::end ( ) -> sentinel
inlinestatic

Get sentinel marking the end of the theory assignment.

Returns
a sentinel marking the end of the theory assignment

◆ lookup()

auto Clingo::TheoryAssignment::lookup ( Symbol const sym) const -> std::optional<size_t>
inline

Lookup a symbol in the theory assignment.

Parameters
symthe symbol to look up
Returns
the index of the symbol if found, or std::nullopt if not found

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