7 #include <knowrob/formulas/Conjunction.h>
8 #include "knowrob/integration/python/utils.h"
9 #include "knowrob/formulas/SimpleConjunction.h"
18 const auto &x =
static_cast<const Conjunction &
>(other);
19 if (
formulae_.size() != x.formulae_.size())
return false;
21 bool hasEqual =
false;
22 for (
auto &y2: x.formulae_) {
28 if (!hasEqual)
return false;
35 if (phi->isBottom())
return phi;
36 else if (psi->isBottom())
return psi;
37 else if (phi->isTop())
return psi;
38 else if (psi->isTop())
return phi;
43 formulae.insert(formulae.end(), psi0.begin(), psi0.end());
45 formulae.push_back(psi);
47 return std::make_shared<Conjunction>(formulae);
50 std::vector<FormulaPtr> formulae = {phi};
51 formulae.insert(formulae.end(), psi0.begin(), psi0.end());
52 return std::make_shared<Conjunction>(formulae);
54 return std::make_shared<Conjunction>(std::vector<FormulaPtr>({phi, psi}));
63 class_<Conjunction, std::shared_ptr<Conjunction>, bases<CompoundFormula>>
64 (
"Conjunction", init<const std::vector<FormulaPtr> &>());
Conjunction(const std::vector< FormulaPtr > &formulae)
bool isEqual(const Formula &other) const override
void createType< SimpleConjunction >()
void createType< Conjunction >()
std::shared_ptr< Formula > FormulaPtr
FormulaPtr operator&(const FormulaPtr &phi, const FormulaPtr &psi)