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

#include <Disjunction.h>

Inheritance diagram for knowrob::Disjunction:
Collaboration diagram for knowrob::Disjunction:

Public Member Functions

 Disjunction (const std::vector< FormulaPtr > &formulae)
 
const char * operator_symbol () const override
 
 Disjunction (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 disjunctive expression.

Definition at line 17 of file Disjunction.h.

Constructor & Destructor Documentation

◆ Disjunction() [1/2]

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

◆ Disjunction() [2/2]

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

Member Function Documentation

◆ isEqual() [1/2]

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

Implements knowrob::Formula.

Definition at line 38 of file Disjunction.cpp.

38  {
39  const auto &x = static_cast<const Disjunction &>(other); // NOLINT
40  if (formulae_.size() != x.formulae_.size()) return false;
41  for (auto &y1: formulae_) {
42  bool hasEqual = false;
43  for (auto &y2: x.formulae_) {
44  if (*y1 == *y2) {
45  hasEqual = true;
46  break;
47  }
48  }
49  if (!hasEqual) return false;
50  }
51  return true;
52 }
const std::vector< FormulaPtr > formulae_

◆ isEqual() [2/2]

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

Implements knowrob::Formula.

◆ operator_symbol() [1/2]

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

Implements knowrob::CompoundFormula.

Definition at line 25 of file Disjunction.h.

25 { return "\u2228"; }

◆ operator_symbol() [2/2]

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

Implements knowrob::CompoundFormula.

Definition at line 25 of file Disjunction.h.

25 { return "\u2228"; }

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