Clingo
Loading...
Searching...
No Matches
project.hh
1#pragma once
2
3#include <clingo/input/program.hh>
4
5#include <clingo/util/unordered_map.hh>
6
7namespace CppClingo::Input {
8
11
14 public:
21 [[nodiscard]] auto projectable(String const &var, bool anonymous) const -> bool;
23 [[nodiscard]] auto counts() const -> Util::unordered_map<String, size_t> const &;
25 [[nodiscard]] auto mode() const -> ProjectionMode;
26
27 private:
29 Util::unordered_map<String, size_t> const *counts_;
31 ProjectionMode mode_;
32};
33
35[[nodiscard]] auto project(Term const &term, ProjectionMap project) -> std::optional<Term>;
36
38[[nodiscard]] auto project(Lit const &lit, ProjectionMap project) -> std::optional<Lit>;
39
41[[nodiscard]] auto project(HdLit const &lit, ProjectionMap project) -> std::optional<HdLit>;
42
47[[nodiscard]] auto project(BdLit const &lit, ProjectionMap project, bool in_classical_scope) -> std::optional<BdLit>;
48
52[[nodiscard]] auto project(RewriteOptions const &opts, Stm const &stm) -> std::optional<Stm>;
53
55
56} // namespace CppClingo::Input
Helper to gather projection related arguments.
Definition project.hh:13
auto projectable(String const &var, bool anonymous) const -> bool
Return whether a the given variable should be projected.
auto mode() const -> ProjectionMode
Return the mode.
ProjectionMap(ProjectionMode mode, Util::unordered_map< String, size_t > const &counts)
Constructor taking the mode which variables to project and a map with counts of variables.
Definition project.hh:16
auto counts() const -> Util::unordered_map< String, size_t > const &
Return the variable counts.
Reference to a string stored in a symbol store.
Definition symbol.hh:18
std::variant< BdLitSimple, BdLitConjunction, BdLitAggregate, BdLitSetAggregate, BdLitTheoryAtom > BdLit
A body literal.
Definition body_literal.hh:116
std::variant< HdLitSimple, HdLitDisjunction, HdLitAggregate, HdLitSetAggregate, HdLitTheoryAtom > HdLit
A head literal.
Definition head_literal.hh:130
std::variant< LitBool, LitComparison, LitSymbolic > Lit
Variant holding the different literal types.
Definition literal.hh:129
ProjectionMode
Enumeration to select variables to project.
Definition program.hh:19
@ anonymous
Only project anonymous variables.
std::variant< StmRule, StmTheory, StmOptimize, StmWeakConstraint, StmShow, StmShowNothing, StmShowSig, StmProject, StmProjectSig, StmDefined, StmExternal, StmEdge, StmHeuristic, StmScript, StmInclude, StmProgram, StmConst, StmParts, StmComment > Stm
Variant of available statements.
Definition statement.hh:828
std::variant< TermVariable, TermSymbol, TermTuple, TermFunction, TermAbs, TermUnary, TermBinary > Term
Variant holding the different term types.
Definition term.hh:45
tsl::hopscotch_map< Key, T, Hash, KeyEqual, Allocator, NeighborhoodSize, StoreHash, GrowthPolicy > unordered_map
Alias for unordered maps.
Definition unordered_map.hh:17
Options to configure rewriting.
Definition program.hh:26