knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
Implication.cpp
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 #include "knowrob/formulas/Implication.h"
7 #include "knowrob/integration/python/utils.h"
8 
9 using namespace knowrob;
10 
11 Implication::Implication(const FormulaPtr &antecedent, const FormulaPtr &consequent)
13 }
14 
15 bool Implication::isEqual(const Formula &other) const {
16  const auto &x = static_cast<const Implication &>(other); // NOLINT
17  return (*antecedent()) == (*x.antecedent()) &&
18  (*consequent()) == (*x.consequent());
19 }
20 
21 namespace knowrob::py {
22  template<>
24  using namespace boost::python;
25  class_<Implication, std::shared_ptr<Implication>, bases<CompoundFormula>>
26  ("Implication", init<const FormulaPtr &, const FormulaPtr &>())
27  .def("antecedent", &Implication::antecedent, return_value_policy<copy_const_reference>())
28  .def("consequent", &Implication::consequent, return_value_policy<copy_const_reference>());
29  }
30 }
const FormulaPtr & antecedent() const
Definition: Implication.h:26
const FormulaPtr & consequent() const
Definition: Implication.h:31
bool isEqual(const Formula &other) const override
Definition: Implication.cpp:15
Implication(const FormulaPtr &antecedent, const FormulaPtr &consequent)
Definition: Implication.cpp:11
void createType< Implication >()
Definition: Implication.cpp:23
std::shared_ptr< Formula > FormulaPtr
Definition: Formula.h:99
FormulaType
Definition: Formula.h:17