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

#include <Implication.h>

Inheritance diagram for knowrob::Implication:
Collaboration diagram for knowrob::Implication:

Public Member Functions

 Implication (const FormulaPtr &antecedent, const FormulaPtr &consequent)
 
const FormulaPtrantecedent () const
 
const FormulaPtrconsequent () const
 
const char * operator_symbol () const override
 
 Implication (const FormulaPtr &antecedent, const FormulaPtr &consequent)
 
const FormulaPtrantecedent () const
 
const FormulaPtrconsequent () 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

An implication formula.

Definition at line 15 of file Implication.h.

Constructor & Destructor Documentation

◆ Implication() [1/2]

Implication::Implication ( const FormulaPtr antecedent,
const FormulaPtr consequent 
)
explicit
Parameters
antecedentthe antecedent of the implication.
consequentthe consequent of the implication.

Definition at line 11 of file Implication.cpp.

13 }
CompoundFormula(FormulaType type, const std::vector< FormulaPtr > &formulae)
const FormulaPtr & antecedent() const
Definition: Implication.h:26
const FormulaPtr & consequent() const
Definition: Implication.h:31

◆ Implication() [2/2]

knowrob::Implication::Implication ( const FormulaPtr antecedent,
const FormulaPtr consequent 
)
explicit
Parameters
antecedentthe antecedent of the implication.
consequentthe consequent of the implication.

Member Function Documentation

◆ antecedent() [1/2]

const FormulaPtr& knowrob::Implication::antecedent ( ) const
inline
Returns
the antecedent of the implication.

Definition at line 26 of file Implication.h.

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

◆ antecedent() [2/2]

const FormulaPtr& knowrob::Implication::antecedent ( ) const
inline
Returns
the antecedent of the implication.

Definition at line 26 of file Implication.h.

26 { return formulae_[0]; }

◆ consequent() [1/2]

const FormulaPtr& knowrob::Implication::consequent ( ) const
inline
Returns
the consequent of the implication.

Definition at line 31 of file Implication.h.

31 { return formulae_[1]; }

◆ consequent() [2/2]

const FormulaPtr& knowrob::Implication::consequent ( ) const
inline
Returns
the consequent of the implication.

Definition at line 31 of file Implication.h.

31 { return formulae_[1]; }

◆ isEqual() [1/2]

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

Implements knowrob::Formula.

Definition at line 15 of file Implication.cpp.

15  {
16  const auto &x = static_cast<const Implication &>(other); // NOLINT
17  return (*antecedent()) == (*x.antecedent()) &&
18  (*consequent()) == (*x.consequent());
19 }

◆ isEqual() [2/2]

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

Implements knowrob::Formula.

◆ operator_symbol() [1/2]

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

Implements knowrob::CompoundFormula.

Definition at line 34 of file Implication.h.

34 { return "->"; }

◆ operator_symbol() [2/2]

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

Implements knowrob::CompoundFormula.

Definition at line 34 of file Implication.h.

34 { return "->"; }

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