knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
Negation.h
Go to the documentation of this file.
1 /*
2  * This file is part of KnowRob, please consult
3  * https://github.com/knowrob/knowrob for license details.
4  */
5 
6 #ifndef KNOWROB_NEGATED_FORMULA_H
7 #define KNOWROB_NEGATED_FORMULA_H
8 
9 #include "CompoundFormula.h"
10 #include "Predicate.h"
11 
12 namespace knowrob {
16  class Negation : public CompoundFormula {
17  public:
21  explicit Negation(const FormulaPtr &formula);
22 
23  const FormulaPtr &negatedFormula() const { return formulae_[0]; }
24 
25  // Override ConnectiveFormula
26  const char *operator_symbol() const override { return "~"; }
27 
28  protected:
29  bool isEqual(const Formula &other) const override;
30  };
31 
37  FormulaPtr operator~(const FormulaPtr &phi);
38 
39 } // knowrob
40 
41 #endif //KNOWROB_NEGATED_FORMULA_H
const std::vector< FormulaPtr > formulae_
const FormulaPtr & negatedFormula() const
Definition: Negation.h:23
Negation(const FormulaPtr &formula)
const char * operator_symbol() const override
Definition: Negation.h:26
bool isEqual(const Formula &other) const override
FormulaRule & formula()
Definition: formula.cpp:283
std::shared_ptr< Formula > FormulaPtr
Definition: Formula.h:99
FormulaPtr operator~(const FormulaPtr &phi)
Definition: Negation.cpp:24