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

#include <Negation.h>

Inheritance diagram for knowrob::Negation:
Collaboration diagram for knowrob::Negation:

Public Member Functions

 Negation (const FormulaPtr &formula)
 
const FormulaPtrnegatedFormula () const
 
const char * operator_symbol () const override
 
 Negation (const FormulaPtr &formula)
 
const FormulaPtrnegatedFormula () const
 
const char * operator_symbol () const override
 
- Public Member Functions inherited from knowrob::CompoundFormula
 CompoundFormula (FormulaType type, const std::vector< FormulaPtr > &formulae)
 
virtual ~CompoundFormula ()=default
 
const std::vector< FormulaPtr > & formulae () const
 
void write (std::ostream &os) const override
 
 CompoundFormula (FormulaType type, const std::vector< FormulaPtr > &formulae)
 
virtual ~CompoundFormula ()=default
 
const std::vector< FormulaPtr > & formulae () const
 
void write (std::ostream &os) const override
 
- 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
 

Protected Member Functions

bool isEqual (const Formula &other) const override
 
bool isEqual (const Formula &other) const override
 
- Protected Member Functions inherited from knowrob::CompoundFormula
bool isGround1 () const
 
bool isGround1 () const
 

Additional Inherited Members

- Protected Attributes inherited from knowrob::CompoundFormula
const std::vector< FormulaPtrformulae_
 
- Protected Attributes inherited from knowrob::Formula
const FormulaType type_
 
bool isGround_ = true
 

Detailed Description

A negated formula.

Definition at line 16 of file Negation.h.

Constructor & Destructor Documentation

◆ Negation() [1/2]

Negation::Negation ( const FormulaPtr formula)
explicit
Parameters
formulathe negated formula.

Definition at line 14 of file Negation.cpp.

16 }
CompoundFormula(FormulaType type, const std::vector< FormulaPtr > &formulae)
FormulaRule & formula()
Definition: formula.cpp:283

◆ Negation() [2/2]

knowrob::Negation::Negation ( const FormulaPtr formula)
explicit
Parameters
formulathe negated formula.

Member Function Documentation

◆ isEqual() [1/2]

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

Implements knowrob::Formula.

Definition at line 18 of file Negation.cpp.

18  {
19  const auto &x = static_cast<const Negation &>(other); // NOLINT
20  return (*negatedFormula()) == (*x.negatedFormula());
21 }
const FormulaPtr & negatedFormula() const
Definition: Negation.h:23

◆ isEqual() [2/2]

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

Implements knowrob::Formula.

◆ negatedFormula() [1/2]

const FormulaPtr& knowrob::Negation::negatedFormula ( ) const
inline

Definition at line 23 of file Negation.h.

23 { return formulae_[0]; }
const std::vector< FormulaPtr > formulae_

◆ negatedFormula() [2/2]

const FormulaPtr& knowrob::Negation::negatedFormula ( ) const
inline

Definition at line 23 of file Negation.h.

23 { return formulae_[0]; }

◆ operator_symbol() [1/2]

const char* knowrob::Negation::operator_symbol ( ) const
inlineoverridevirtual
Returns
symbol string of the operator

Implements knowrob::CompoundFormula.

Definition at line 26 of file Negation.h.

26 { return "~"; }

◆ operator_symbol() [2/2]

const char* knowrob::Negation::operator_symbol ( ) const
inlineoverridevirtual
Returns
symbol string of the operator

Implements knowrob::CompoundFormula.

Definition at line 26 of file Negation.h.

26 { return "~"; }

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