Clingo
Loading...
Searching...
No Matches
program.hh
1#pragma once
2
3#include <clingo/ground/statement.hh>
4
5#include <clingo/util/enum.hh>
6
7namespace CppClingo::Ground {
8
11
13class Component {
14 public:
18 Component(bool domain) : domain_{domain} {}
20 void add(UStm stm) { stms_.emplace_back(std::move(stm)); }
22 [[nodiscard]] auto stms() const -> UStmVec const & { return stms_; }
24 [[nodiscard]] auto domain() const -> bool { return domain_; }
25
26 private:
27 UStmVec stms_;
28 bool domain_;
29};
30
32
33} // namespace CppClingo::Ground
Captures statements depending cyclically on each other.
Definition program.hh:13
void add(UStm stm)
Add a statement to a component.
Definition program.hh:20
Component(bool domain)
Construct a component.
Definition program.hh:18
auto domain() const -> bool
Return true if the statements in this component only derive facts.
Definition program.hh:24
auto stms() const -> UStmVec const &
Get the statements in the component.
Definition program.hh:22
std::vector< UStm > UStmVec
A vector of statements.
Definition statement.hh:44
std::unique_ptr< Stm > UStm
A unique pointer holding a statement.
Definition statement.hh:42