knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
SimpleConjunction.cpp File Reference
#include <knowrob/formulas/SimpleConjunction.h>
#include "knowrob/formulas/Negation.h"
#include "knowrob/integration/python/utils.h"
Include dependency graph for SimpleConjunction.cpp:

Go to the source code of this file.

Namespaces

 knowrob
 
 knowrob::py
 

Functions

std::vector< FormulaPtrliteralsToFormulae (const std::vector< FirstOrderLiteralPtr > &literals)
 
template<>
void knowrob::py::createType< SimpleConjunction > ()
 

Function Documentation

◆ literalsToFormulae()

std::vector<FormulaPtr> literalsToFormulae ( const std::vector< FirstOrderLiteralPtr > &  literals)

Definition at line 12 of file SimpleConjunction.cpp.

12  {
13  std::vector<FormulaPtr> formulae;
14  for (const auto &literal: literals) {
15  if (literal->isNegated()) {
16  formulae.push_back(std::make_shared<Negation>(literal->predicate()));
17  } else {
18  formulae.push_back(literal->predicate());
19  }
20  }
21  return formulae;
22 }