clingo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
Public Member Functions | Public Attributes | List of all members
Gringo::Input::TupleBodyAggregate Struct Reference

#include <aggregates.hh>

Inheritance diagram for Gringo::Input::TupleBodyAggregate:
Inheritance graph
Collaboration diagram for Gringo::Input::TupleBodyAggregate:
Collaboration graph

Public Member Functions

 TupleBodyAggregate (NAF naf, AggregateFunction fun, BoundVec &&bounds, BodyAggrElemVec &&elems)
 
virtual bool rewriteAggregates (UBodyAggrVec &aggr)
 
virtual bool isAssignment () const
 
virtual void removeAssignment ()
 
virtual void collect (VarTermBoundVec &vars) const
 
virtual bool operator== (BodyAggregate const &other) const
 
virtual void print (std::ostream &out) const
 
virtual size_t hash () const
 
virtual TupleBodyAggregateclone () const
 
virtual void unpool (UBodyAggrVec &x, bool beforeRewrite)
 Unpool the aggregate and aggregate elements. More...
 
virtual void simplify (Projections &project, Term::DotsMap &dots, Term::ScriptMap &scripts, unsigned &auxNum)
 
virtual void assignLevels (AssignLevel &lvl)
 
virtual void rewriteArithmetics (Term::ArithmeticsMap &arith, Literal::AssignVec &assign, unsigned &auxNum)
 
virtual bool hasPool (bool beforeRewrite) const
 
virtual bool check (ChkLvlVec &lvl) const
 
virtual void replace (Defines &dx)
 
virtual CreateBody toGround (ToGroundArg &x, Ground::UStmVec &stms) const
 
virtual ~TupleBodyAggregate ()
 
- Public Member Functions inherited from Gringo::Input::BodyAggregate
virtual ~BodyAggregate ()
 
- Public Member Functions inherited from Gringo::Printable
virtual ~Printable ()
 
- Public Member Functions inherited from Gringo::Hashable
virtual ~Hashable ()
 
- Public Member Functions inherited from Gringo::Locatable
virtual Location const & loc () const =0
 
virtual void loc (Location const &loc)=0
 
virtual ~Locatable ()
 
- Public Member Functions inherited from Gringo::Clonable< BodyAggregate >
virtual ~Clonable ()
 
- Public Member Functions inherited from Gringo::Comparable< BodyAggregate >
virtual bool operator== (BodyAggregateconst &other) const =0
 
virtual bool operator!= (BodyAggregateconst &other) const
 
virtual ~Comparable ()
 

Public Attributes

NAF naf
 
AggregateFunction fun
 
BoundVec bounds
 
BodyAggrElemVec elems
 

Constructor & Destructor Documentation

Gringo::Input::TupleBodyAggregate::TupleBodyAggregate ( NAF  naf,
AggregateFunction  fun,
BoundVec &&  bounds,
BodyAggrElemVec &&  elems 
)
Gringo::Input::TupleBodyAggregate::~TupleBodyAggregate ( )
virtual

Member Function Documentation

void Gringo::Input::TupleBodyAggregate::assignLevels ( AssignLevel lvl)
virtual

Assign levels to variables using the VarCollector.

Precondition
Must be called after simplify.

Implements Gringo::Input::BodyAggregate.

Here is the call graph for this function:

bool Gringo::Input::TupleBodyAggregate::check ( ChkLvlVec lvl) const
virtual

Implements Gringo::Input::BodyAggregate.

Here is the call graph for this function:

TupleBodyAggregate * Gringo::Input::TupleBodyAggregate::clone ( ) const
virtual

Implements Gringo::Clonable< BodyAggregate >.

Here is the call graph for this function:

void Gringo::Input::TupleBodyAggregate::collect ( VarTermBoundVec vars) const
virtual

Collects all variables occuring in the aggregate. Occurrences bound by the aggregate are marked as such (occurrences bound in nested scopes are not marked).

Implements Gringo::Input::BodyAggregate.

size_t Gringo::Input::TupleBodyAggregate::hash ( ) const
virtual

Implements Gringo::Hashable.

Here is the call graph for this function:

bool Gringo::Input::TupleBodyAggregate::hasPool ( bool  beforeRewrite) const
virtual
bool Gringo::Input::TupleBodyAggregate::isAssignment ( ) const
virtual
bool Gringo::Input::TupleBodyAggregate::operator== ( BodyAggregate const &  other) const
virtual

Here is the call graph for this function:

void Gringo::Input::TupleBodyAggregate::print ( std::ostream &  out) const
virtual

Implements Gringo::Printable.

Here is the call graph for this function:

void Gringo::Input::TupleBodyAggregate::removeAssignment ( )
virtual

Returns true if the aggregate is an assignment aggregate.

Note
Does not consider relation literals.

Implements Gringo::Input::BodyAggregate.

Here is the call graph for this function:

void Gringo::Input::TupleBodyAggregate::replace ( Defines dx)
virtual

Implements Gringo::Input::BodyAggregate.

Here is the call graph for this function:

bool Gringo::Input::TupleBodyAggregate::rewriteAggregates ( UBodyAggrVec aggr)
virtual

Rewrite aggregates. Separates assignment aggregates from ordinary bounds, and transforms literal aggregates into tuple aggregates. Returns false iff the aggregates must be removed. Argument aggr contains the rewritten aggregates.

Implements Gringo::Input::BodyAggregate.

Here is the call graph for this function:

void Gringo::Input::TupleBodyAggregate::rewriteArithmetics ( Term::ArithmeticsMap arith,
Literal::AssignVec assign,
unsigned &  auxNum 
)
virtual

Rewrite arithmetics.

Precondition
Requires variables assigned to levels.

Implements Gringo::Input::BodyAggregate.

Here is the call graph for this function:

void Gringo::Input::TupleBodyAggregate::simplify ( Projections project,
Term::DotsMap dots,
Term::ScriptMap scripts,
unsigned &  auxNum 
)
virtual

Simplify the aggregate and aggregate elements.

Precondition
Must be called after unpool.

Implements Gringo::Input::BodyAggregate.

Here is the call graph for this function:

CreateBody Gringo::Input::TupleBodyAggregate::toGround ( ToGroundArg x,
Ground::UStmVec stms 
) const
virtual

Implements Gringo::Input::BodyAggregate.

Here is the call graph for this function:

void Gringo::Input::TupleBodyAggregate::unpool ( UBodyAggrVec x,
bool  beforeRewrite 
)
virtual

Unpool the aggregate and aggregate elements.

Implements Gringo::Input::BodyAggregate.

Here is the call graph for this function:

Member Data Documentation

BoundVec Gringo::Input::TupleBodyAggregate::bounds
BodyAggrElemVec Gringo::Input::TupleBodyAggregate::elems
AggregateFunction Gringo::Input::TupleBodyAggregate::fun
NAF Gringo::Input::TupleBodyAggregate::naf

The documentation for this struct was generated from the following files: