knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
AnswerNo.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_NEGATIVE_ANSWER_H
7 #define KNOWROB_NEGATIVE_ANSWER_H
8 
9 #include "Answer.h"
10 #include "knowrob/formulas/FramedPredicate.h"
11 
12 namespace knowrob {
17  class AnswerNo : public Answer {
18  public:
23 
28  AnswerNo(const AnswerNo &other);
29 
35  void addUngrounded(const std::shared_ptr<Predicate> &predicate, bool isNegated = false);
36 
42  auto &positiveUngrounded() const { return positiveUngrounded_; }
43 
49  auto &negativeUngrounded() const { return negativeUngrounded_; }
50 
56  bool mergeWith(const AnswerNo &other);
57 
62 
67 
68  protected:
69  std::vector<FramedPredicate> positiveUngrounded_;
70  std::vector<FramedPredicate> negativeUngrounded_;
71  };
72 
73  // alias
74  using AnswerNoPtr = std::shared_ptr<const AnswerNo>;
75 
79  const std::shared_ptr<const AnswerNo> &GenericNo();
80 
82 
83 } // knowrob
84 
85 #endif //KNOWROB_NEGATIVE_ANSWER_H
AnswerNo(const AnswerNo &other)
std::vector< FramedPredicate > positiveUngrounded_
Definition: AnswerNo.h:69
std::string stringFormOfNo() const
std::vector< FramedPredicate > negativeUngrounded_
Definition: AnswerNo.h:70
std::string humanReadableFormOfNo() const
void addUngrounded(const std::shared_ptr< Predicate > &predicate, bool isNegated=false)
auto & positiveUngrounded() const
Definition: AnswerNo.h:42
bool mergeWith(const AnswerNo &other)
auto & negativeUngrounded() const
Definition: AnswerNo.h:49
PredicateRule & predicate()
Definition: formula.cpp:221
TermRule & string()
Definition: terms.cpp:63
AnswerPtr mergeNegativeAnswers(const AnswerNoPtr &a, const AnswerNoPtr &b)
Definition: AnswerNo.cpp:88
std::shared_ptr< const Answer > AnswerPtr
Definition: Answer.h:129
const std::shared_ptr< const AnswerNo > & GenericNo()
Definition: AnswerNo.cpp:11
std::shared_ptr< const AnswerNo > AnswerNoPtr
Definition: AnswerNo.h:74