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

#include <Conjunction.h>

Inheritance diagram for knowrob::Conjunction:
Collaboration diagram for knowrob::Conjunction:

Public Member Functions

 Conjunction (const std::vector< FormulaPtr > &formulae)
 
const char * operator_symbol () const override
 
 Conjunction (const std::vector< FormulaPtr > &formulae)
 
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 conjunction of formulae.

Definition at line 17 of file Conjunction.h.

Constructor & Destructor Documentation

◆ Conjunction() [1/2]

Conjunction::Conjunction ( const std::vector< FormulaPtr > &  formulae)
explicit
Parameters
formulaelist of sub-formulas.

Definition at line 13 of file Conjunction.cpp.

15 }
const std::vector< FormulaPtr > & formulae() const
CompoundFormula(FormulaType type, const std::vector< FormulaPtr > &formulae)

◆ Conjunction() [2/2]

knowrob::Conjunction::Conjunction ( const std::vector< FormulaPtr > &  formulae)
explicit
Parameters
formulaelist of sub-formulas.

Member Function Documentation

◆ isEqual() [1/2]

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

Implements knowrob::Formula.

Definition at line 17 of file Conjunction.cpp.

17  {
18  const auto &x = static_cast<const Conjunction &>(other); // NOLINT
19  if (formulae_.size() != x.formulae_.size()) return false;
20  for (auto &y1: formulae_) {
21  bool hasEqual = false;
22  for (auto &y2: x.formulae_) {
23  if (*y1 == *y2) {
24  hasEqual = true;
25  break;
26  }
27  }
28  if (!hasEqual) return false;
29  }
30  return true;
31 }
const std::vector< FormulaPtr > formulae_

◆ isEqual() [2/2]

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

Implements knowrob::Formula.

◆ operator_symbol() [1/2]

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

Implements knowrob::CompoundFormula.

Definition at line 25 of file Conjunction.h.

25 { return "\u2227"; }

◆ operator_symbol() [2/2]

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

Implements knowrob::CompoundFormula.

Definition at line 25 of file Conjunction.h.

25 { return "\u2227"; }

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