6 #ifndef KNOWROB_DEPENDENCY_GRAPH_H
7 #define KNOWROB_DEPENDENCY_GRAPH_H
10 #include "knowrob/formulas/FirstOrderLiteral.h"
16 class DependencyNode {
23 const std::set<std::string_view> &
variables()
const {
return literal_->predicate()->variables(); }
48 std::list<std::shared_ptr<DependencyNode>>
neighbors_;
60 struct DependencyGroup {
62 std::list<DependencyNodePtr>
member_;
65 member_.insert(other.member_.end(), other.member_.begin(), other.member_.end());
66 variables_.insert(other.variables_.begin(), other.variables_.end());
75 class DependencyGraph {
108 void insert(
const std::vector<FirstOrderLiteralPtr> &literals);
116 template<
typename Iterator>
146 std::list<DependencyNodePtr>
nodes_;
147 std::list<DependencyGroup>
groups_;
void insert(const std::vector< FirstOrderLiteralPtr > &literals)
void insert(const DependencyNodePtr &node)
std::list< DependencyGroup > groups_
void insert(const DependencyNodePtr &node)
void insert(Iterator begin, Iterator end)
DependencyGraph(const DependencyGraph &other)=delete
void operator+=(const DependencyNodePtr &node)
void insert(const FirstOrderLiteralPtr &literal)
DependencyGraph()=default
std::list< DependencyNodePtr > nodes_
auto numNeighbors() const
const FirstOrderLiteralPtr literal_
const auto & neighbors() const
void addDependency(const std::shared_ptr< DependencyNode > &other)
std::list< std::shared_ptr< DependencyNode > > neighbors_
const std::set< std::string_view > & variables() const
const auto & literal() const
auto numVariables() const
DependencyNode(const FirstOrderLiteralPtr &literal)
std::shared_ptr< DependencyNode > DependencyNodePtr
std::shared_ptr< FirstOrderLiteral > FirstOrderLiteralPtr
std::list< DependencyNodePtr > member_
void operator+=(const DependencyGroup &other)
std::set< std::string_view > variables_