Clingo
Loading...
Searching...
No Matches
CppClingo::Ground::Lit Class Referenceabstract

The base class for groundable literals. More...

#include <literal.hh>

Inheritance diagram for CppClingo::Ground::Lit:
CppClingo::Ground::LitAssignAggr CppClingo::Ground::LitAssignAggrStrat CppClingo::Ground::LitBdAggr CppClingo::Ground::LitBdAggrStrat CppClingo::Ground::LitBdTheory CppClingo::Ground::LitCheck CppClingo::Ground::LitComparison CppClingo::Ground::LitCondLit CppClingo::Ground::LitCondLitStrat CppClingo::Ground::LitDisjunction CppClingo::Ground::LitExternal CppClingo::Ground::LitHdAggr CppClingo::Ground::LitInterval CppClingo::Ground::LitMatchTheory CppClingo::Ground::LitProject CppClingo::Ground::LitSimpleAggr CppClingo::Ground::LitSymbolic CppClingo::Ground::LitTuple

Public Member Functions

virtual ~Lit ()=default
 Destroy the literal.
 
void vars (VariableSet &vars, VarSelectMode mode) const
 Get the variables in the predicate.
 
auto domain () const -> bool
 Returns true if matching literals are always fact.
 
auto single_pass () const -> bool
 Returns true if the literal can be grounded in a single pass.
 
auto matcher (std::pmr::monotonic_buffer_resource &mbr, MatcherType type, std::vector< bool > const &bound) -> std::pair< UMatcher, std::optional< size_t > >
 Returns true if the base of the literal is complete at the time of grounding.
 
auto score (std::vector< bool > const &bound) const -> double
 Compute a score used to order rule bodies.
 
auto output (EvalContext const &ctx, OutputLit &out) const -> bool
 Output the literal.
 
auto copy () const -> ULit
 Copy the literal.
 
auto hash () const -> size_t
 Compute a hash for the literal.
 

Friends

auto operator== (Lit const &a, Lit const &b) -> bool
 Compare two literals.
 
auto operator<=> (Lit const &a, Lit const &b) -> std::weak_ordering
 Compare two literals.
 
auto operator<< (std::ostream &out, Lit const &lit) -> std::ostream &
 Print the literal.
 

Detailed Description

The base class for groundable literals.

Member Function Documentation

◆ domain()

auto CppClingo::Ground::Lit::domain ( ) const -> bool
inline

Returns true if matching literals are always fact.

For example, symbolic literals are domain if there are no negative cycles through them and their (current) base is domain.

◆ output()

auto CppClingo::Ground::Lit::output ( EvalContext const &  ctx,
OutputLit out 
) const -> bool
inline

Output the literal.

If the literal is a fact, it should not be output and the function should return false.

◆ single_pass()

auto CppClingo::Ground::Lit::single_pass ( ) const -> bool
inline

Returns true if the literal can be grounded in a single pass.

Such literals are always have a complete state ready to be output.


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