21 #ifndef _GRINGO_INPUT_AGGREGATE_HH
22 #define _GRINGO_INPUT_AGGREGATE_HH
31 using ULitVec = std::vector<ULit>;
33 using UStm = std::unique_ptr<Statement>;
34 using UStmVec = std::vector<UStm>;
50 typedef std::unique_ptr<BodyAggregate>
UBodyAggr;
54 typedef std::unique_ptr<HeadAggregate>
UHeadAggr;
62 typedef std::unordered_map<FWString, unsigned>
BoundSet;
71 std::unordered_map<FWString, std::vector<VarTerm*>>
occurr;
82 using VarMap = std::unordered_map<FWString, SC::VarNode *>;
101 using CreateLit = std::function<void (Ground::ULitVec &, bool)>;
102 using CreateStm = std::function<Ground::UStm (Ground::ULitVec &&)>;
156 virtual bool hasPool(
bool beforeRewrite)
const = 0;
186 virtual bool hasPool(
bool beforeRewrite)
const = 0;
200 #endif // _GRINGO_INPUT_AGGREGATE_HH
Definition: comparable.hh:29
std::vector< ULit > ULitVec
Definition: literal.hh:61
Definition: locatable.hh:30
virtual ~BodyAggregate()
Definition: aggregate.hh:159
std::unique_ptr< Term > UTerm
Definition: statement.hh:32
virtual bool check(ChkLvlVec &lvl) const =0
Definition: printable.hh:30
std::unique_ptr< Statement > UStm
Definition: statement.hh:33
Scripts & scripts
Definition: literals.cc:126
std::vector< std::unordered_map< UTerm, UTerm, value_hash< UTerm >, value_equal_to< UTerm >>> ArithmeticsMap
Definition: term.hh:121
Definition: hashable.hh:36
Definition: aggregate.hh:129
virtual bool rewriteAggregates(UBodyAggrVec &aggr)=0
virtual void collect(VarTermBoundVec &vars) const =0
std::vector< std::tuple< UTerm, UTerm, UTerm >> DotsMap
Type that stores for each rewritten DotsTerm the associated variable and the lower and upper bound...
Definition: term.hh:117
Definition: locatable.hh:51
std::vector< std::pair< VarTerm *, bool >> VarTermBoundVec
Definition: term.hh:106
virtual void unpool(UBodyAggrVec &x, bool beforeRewrite)=0
Unpool the aggregate and aggregate elements.
virtual bool isAssignment() const =0
Bound & bound
Definition: output.cc:122
virtual void rewriteArithmetics(Term::ArithmeticsMap &arith, Literal::AssignVec &assign, unsigned &auxNum)=0
virtual void removeAssignment()=0
virtual void simplify(Projections &project, Term::DotsMap &dots, Term::ScriptMap &scripts, unsigned &auxNum)=0
UTerm assign
Definition: literals.cc:59
Definition: clonable.hh:29
virtual void replace(Defines &dx)=0
int x
Definition: utility.cc:65
std::vector< unsigned > vars
Definition: statements.cc:1282
Definition: unique_list.hh:157
#define GRINGO_HASH(T)
Definition: hashable.hh:29
virtual CreateBody toGround(ToGroundArg &x, Ground::UStmVec &stms) const =0
std::vector< std::tuple< UTerm, FWString, UTermVec >> ScriptMap
Definition: term.hh:118
virtual bool hasPool(bool beforeRewrite) const =0
std::unique_ptr< DotsTerm > dots(UTerm &&left, UTerm &&right)
Definition: term_helper.hh:51
std::vector< UStm > UStmVec
Definition: statement.hh:35
virtual void assignLevels(AssignLevel &lvl)=0