Clingo
Loading...
Searching...
No Matches

Class to provide access to theory atoms. More...

#include <base.hh>

Public Member Functions

 TheoryAtom (clingo_theory_base_t const &base, size_t index)
 Constructor from C representation.
 
auto name () const -> TheoryTerm
 Get the name of the theory atom.
 
auto elements () const -> TheoryElementVector
 Get the elements of the theory atom.
 
auto literal () const -> ProgramLiteral
 Get the literal of the theory atom.
 
auto guard () const -> std::optional< std::pair< std::string_view, TheoryTerm > >
 Get the guard of the theory atom.
 
auto to_string () const -> std::string
 Convert the theory atom to a string representation.
 
auto hash () const noexcept -> size_t
 Get the hash of the theory atom.
 

Friends

auto operator== (TheoryAtom const &a, TheoryAtom const &b) noexcept -> bool
 Compare two theory atoms for equality.
 
auto operator<=> (TheoryAtom const &a, TheoryAtom const &b) noexcept -> std::strong_ordering
 Compare two theory atoms.
 

Detailed Description

Class to provide access to theory atoms.

Constructor & Destructor Documentation

◆ TheoryAtom()

Clingo::TheoryAtom::TheoryAtom ( clingo_theory_base_t const base,
size_t  index 
)
inlineexplicit

Constructor from C representation.

Parameters
basethe C theory base
indexthe index of the atom

Member Function Documentation

◆ elements()

auto Clingo::TheoryAtom::elements ( ) const -> TheoryElementVector
inline

Get the elements of the theory atom.

Returns
the elements of the theory atom as a vector of TheoryElement

◆ guard()

auto Clingo::TheoryAtom::guard ( ) const -> std::optional<std::pair<std::string_view, TheoryTerm>>
inline

Get the guard of the theory atom.

Returns
the optional guard as a pair of a string view and a theory term

◆ hash()

auto Clingo::TheoryAtom::hash ( ) const -> size_t
inlinenoexcept

Get the hash of the theory atom.

The hash enables usage in hash tables. There is also an associtaed specialization of std::hash for this class.

Returns
the theory atom's hash

◆ literal()

auto Clingo::TheoryAtom::literal ( ) const -> ProgramLiteral
inline

Get the literal of the theory atom.

Returns
the literal of the theory atom as a program literal

◆ name()

auto Clingo::TheoryAtom::name ( ) const -> TheoryTerm
inline

Get the name of the theory atom.

Returns
the name of the theory atom as a theory term

◆ to_string()

auto Clingo::TheoryAtom::to_string ( ) const -> std::string
inline

Convert the theory atom to a string representation.

Returns
the string representation of the theory atom

Friends And Related Symbol Documentation

◆ operator<=>

auto operator<=> ( TheoryAtom const a,
TheoryAtom const b 
) -> std::strong_ordering
friend

Compare two theory atoms.

Parameters
athe first atom
bthe second atom
Returns
the result of the comparison

◆ operator==

auto operator== ( TheoryAtom const a,
TheoryAtom const b 
) -> bool
friend

Compare two theory atoms for equality.

Parameters
athe first atom
bthe second atom
Returns
whether the two atoms are equal

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