knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
knowrob::Top Class Reference

#include <Top.h>

Inheritance diagram for knowrob::Top:
Collaboration diagram for knowrob::Top:

Public Member Functions

void write (std::ostream &os) const override
 
void write (std::ostream &os) const override
 
- Public Member Functions inherited from knowrob::Predicate
 Predicate (std::string_view functor, const std::vector< TermPtr > &arguments={})
 
 Predicate (AtomPtr functor, const std::vector< TermPtr > &arguments={})
 
auto & functor () const
 
auto arity () const
 
const std::vector< TermPtr > & arguments () const
 
const std::set< std::string_view > & variables ()
 
size_t hash () const
 
 Predicate (std::string_view functor, const std::vector< TermPtr > &arguments={})
 
 Predicate (AtomPtr functor, const std::vector< TermPtr > &arguments={})
 
auto & functor () const
 
auto arity () const
 
const std::vector< TermPtr > & arguments () const
 
const std::set< std::string_view > & variables ()
 
size_t hash () const
 
- Public Member Functions inherited from knowrob::Formula
 Formula (const FormulaType &type)
 
virtual ~Formula ()=default
 
bool operator== (const Formula &other) const
 
FormulaType type () const
 
bool isAtomic () const
 
bool isGround () const
 
bool isTop () const
 
bool isBottom () const
 
 Formula (const FormulaType &type)
 
virtual ~Formula ()=default
 
bool operator== (const Formula &other) const
 
FormulaType type () const
 
bool isAtomic () const
 
bool isGround () const
 
bool isTop () const
 
bool isBottom () const
 
- Public Member Functions inherited from knowrob::Printable
virtual ~Printable ()=default
 
virtual std::string format () const
 
virtual ~Printable ()=default
 
virtual std::string format () const
 

Static Public Member Functions

static const std::shared_ptr< Top > & get ()
 
static const std::shared_ptr< Top > & get ()
 
- Static Public Member Functions inherited from knowrob::Predicate
static FunctionPtr toFunction (const std::shared_ptr< Predicate > &predicate)
 
static std::shared_ptr< PredicatefromFunction (const FunctionPtr &fn)
 
static FunctionPtr toFunction (const std::shared_ptr< Predicate > &predicate)
 
static std::shared_ptr< PredicatefromFunction (const FunctionPtr &fn)
 

Protected Member Functions

bool isEqual (const Formula &other) const override
 
bool isEqual (const Formula &other) const override
 
- Protected Member Functions inherited from knowrob::Predicate
std::set< std::string_view > getVariables1 () const
 
std::set< std::string_view > getVariables1 () const
 

Additional Inherited Members

- Protected Attributes inherited from knowrob::Predicate
const AtomPtr functor_
 
const std::vector< TermPtrarguments_
 
const std::set< std::string_view > variables_
 
- Protected Attributes inherited from knowrob::Formula
const FormulaType type_
 
bool isGround_ = true
 

Detailed Description

A predicate with a fixed truth value being true.

Definition at line 17 of file Top.h.

Member Function Documentation

◆ get() [1/2]

const std::shared_ptr< Top > & Top::get ( )
static

Definition at line 11 of file Top.cpp.

11  {
12  static std::shared_ptr<Top> singleton(new Top);
13  return singleton;
14 }

◆ get() [2/2]

static const std::shared_ptr<Top>& knowrob::Top::get ( )
static

◆ isEqual() [1/2]

bool Top::isEqual ( const Formula other) const
overrideprotectedvirtual

Reimplemented from knowrob::Predicate.

Definition at line 20 of file Top.cpp.

20  {
21  return true; // isEqual is only called of other also has type "Bottom"
22 }

◆ isEqual() [2/2]

bool knowrob::Top::isEqual ( const Formula other) const
overrideprotectedvirtual

Reimplemented from knowrob::Predicate.

◆ write() [1/2]

void Top::write ( std::ostream &  os) const
overridevirtual

Print this object to a stream.

Parameters
osthe stream to print to.

Reimplemented from knowrob::Predicate.

Definition at line 24 of file Top.cpp.

24  {
25  os << "\u22A4";
26 }

◆ write() [2/2]

void knowrob::Top::write ( std::ostream &  os) const
overridevirtual

Print this object to a stream.

Parameters
osthe stream to print to.

Reimplemented from knowrob::Predicate.


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