Clingo
Loading...
Searching...
No Matches

Class to provide access to terms in a program. More...

#include <base.hh>

Public Member Functions

 Term (clingo_term_base_t const &base, size_t index)
 Construct a term from its C representation.
 
auto symbol () const -> Symbol
 Get the symbol of the term.
 
auto condition () const -> std::vector< ProgramLiteralVector >
 Get the condition of the term.
 
auto hash () const noexcept -> size_t
 Get the hash of the term.
 

Friends

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

Detailed Description

Class to provide access to terms in a program.

Constructor & Destructor Documentation

◆ Term()

Clingo::Term::Term ( clingo_term_base_t const base,
size_t  index 
)
inlineexplicit

Construct a term from its C representation.

Parameters
basethe C term base
indexthe index of the term

Member Function Documentation

◆ condition()

auto Clingo::Term::condition ( ) const -> std::vector<ProgramLiteralVector>
inline

Get the condition of the term.

Returns
the conditions as a vector of program literal vectors

◆ hash()

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

Get the hash of the term.

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

Returns
the term's hash

◆ symbol()

auto Clingo::Term::symbol ( ) const -> Symbol
inline

Get the symbol of the term.

Returns
the symbol of the term

Friends And Related Symbol Documentation

◆ operator<=>

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

Compare two terms.

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

◆ operator==

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

Compare two terms for equality.

Parameters
athe first term
bthe second term
Returns
whether the two terms are equal

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