knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
Computable.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/reasoner/Computable.h>
7 
8 using namespace knowrob;
9 
10 Computable::Computable(const FirstOrderLiteral &literal, const std::vector<DefiningReasoner> &reasonerList)
11 : FirstOrderLiteral(literal), reasonerList_(reasonerList) {}
12 
14  const std::vector<DefiningReasoner> &reasonerList)
15 : FirstOrderLiteral(predicate, isNegative), reasonerList_(reasonerList) {}
16 
17 namespace knowrob {
18  ComputablePtr applyBindings(const ComputablePtr &lit, const Bindings &bindings) {
19  auto predicate = std::static_pointer_cast<Predicate>(applyBindings(lit->predicate(), bindings));
20  if (predicate != lit->predicate()) {
21  return std::make_shared<Computable>(predicate, lit->isNegated(), lit->reasonerList());
22  }
23  else {
24  return lit;
25  }
26  }
27 } // knowrob
Computable(const FirstOrderLiteral &literal, const std::vector< DefiningReasoner > &reasonerList)
Definition: Computable.cpp:10
PredicateRule & predicate()
Definition: formula.cpp:221
std::shared_ptr< Computable > ComputablePtr
Definition: Computable.h:45
std::shared_ptr< Predicate > PredicatePtr
Definition: Predicate.h:77
FirstOrderLiteralPtr applyBindings(const FirstOrderLiteralPtr &lit, const Bindings &bindings)