pulsatrix
Loading...
Searching...
No Matches
pulsatrix::datalog::Atom Class Reference

An atom is a predicate name applied to a tuple of Terms, e.g. edge(a, b) or ancestor(X, Y) – never a nested/compound structure, since Term itself cannot nest (see datalog_term.hpp). More...

#include <datalog_atom.hpp>

Public Member Functions

 Atom (std::string predicate_name, std::vector< Term > terms)
 
const std::string & predicate_name () const
 
const std::vector< Term > & terms () const
 
std::size_t arity () const
 
bool is_ground () const
 True iff every term in this atom is a constant (no variables).
 
bool operator== (const Atom &other) const
 
bool operator!= (const Atom &other) const
 

Detailed Description

An atom is a predicate name applied to a tuple of Terms, e.g. edge(a, b) or ancestor(X, Y) – never a nested/compound structure, since Term itself cannot nest (see datalog_term.hpp).

Note
An atom is "ground" (a fact, suitable for a FactDatabase) iff every one of its terms is a constant. An atom with any variable term is only valid inside a rule's head or body, never inside a FactDatabase.

Constructor & Destructor Documentation

◆ Atom()

pulsatrix::datalog::Atom::Atom ( std::string  predicate_name,
std::vector< Term >  terms 
)
inline

Member Function Documentation

◆ arity()

std::size_t pulsatrix::datalog::Atom::arity ( ) const
inline

◆ is_ground()

bool pulsatrix::datalog::Atom::is_ground ( ) const
inline

True iff every term in this atom is a constant (no variables).

◆ operator!=()

bool pulsatrix::datalog::Atom::operator!= ( const Atom &  other) const
inline

◆ operator==()

bool pulsatrix::datalog::Atom::operator== ( const Atom &  other) const
inline

◆ predicate_name()

const std::string & pulsatrix::datalog::Atom::predicate_name ( ) const
inline

◆ terms()

const std::vector< Term > & pulsatrix::datalog::Atom::terms ( ) const
inline

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