clingo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Clasp::Asp::PrgHead Class Reference

A head node of a program-dependency graph. More...

#include <logic_program_types.h>

Inheritance diagram for Clasp::Asp::PrgHead:
Inheritance graph
Collaboration diagram for Clasp::Asp::PrgHead:
Collaboration graph

Public Types

enum  Simplify { no_simplify = 0, force_simplify = 1 }
 
enum  State { state_normal = 0u, state_in_flux = 1u, state_freeze = 2u, state_freeze_true = 3u }
 
typedef EdgeIterator sup_iterator
 

Public Member Functions

bool inUpper () const
 Is the head part of the (simplified) program? More...
 
bool isAtom () const
 Is this head an atom? More...
 
uint32 supports () const
 Number of supports (rules) for this head. More...
 
sup_iterator supps_begin () const
 
sup_iterator supps_end () const
 
bool frozen () const
 Defined in a later incremental step? More...
 
bool inFlux () const
 Thawed in this step? More...
 
Literal assumption () const
 
State state () const
 
void addSupport (PrgEdge r)
 Adds r as support edge for this node. More...
 
void addSupport (PrgEdge r, Simplify s)
 
void removeSupport (PrgEdge r)
 Removes r from the head's list of supports. More...
 
void clearSupports ()
 
void clearSupports (EdgeVec &to)
 
bool simplifySupports (LogicProgram &prg, bool strong, uint32 *numDiffSupps=0)
 Removes any superfluous/irrelevant supports. More...
 
bool assignValue (ValueRep v)
 Assigns the value v to this head. More...
 
implementation functions

Low-level implementation functions. Use with care and only if you know what you are doing!

void setInUpper (bool b)
 
void markDirty ()
 
void assignVar (LogicProgram &prg, PrgEdge it)
 
- Public Member Functions inherited from Clasp::Asp::PrgNode
 PrgNode (uint32 id, bool checkScc=true)
 Creates a new node that corresponds to a literal that is false. More...
 
bool relevant () const
 Is the node still relevant or removed() resp. eq()? More...
 
bool removed () const
 Was the node removed? More...
 
bool ignoreScc () const
 Ignore the node during scc checking? More...
 
bool eq () const
 Returns true if this node is equivalent to some other node. More...
 
bool seen () const
 
bool hasVar () const
 Returns true if node has an associated variable in a solver. More...
 
Var var () const
 Returns the variable associated with this node or sentVar if no var is associated with this node. More...
 
Literal literal () const
 Returns the literal associated with this node or a sentinel literal if no var is associated with this node. More...
 
ValueRep value () const
 Returns the value currently assigned to this node. More...
 
uint32 id () const
 Returns the current id of this node. More...
 
Literal trueLit () const
 Returns the literal that must be true in order to fulfill the truth-value of this node. More...
 
void setLiteral (Literal x)
 
void clearLiteral (bool clVal)
 
void setValue (ValueRep v)
 
void setEq (uint32 eqId)
 
void setIgnoreScc (bool b)
 
void markRemoved ()
 
void markSeen (bool b)
 
void resetId (uint32 id, bool seen)
 
bool assignValueImpl (ValueRep v, bool noWeak)
 

Protected Member Functions

 PrgHead (uint32 id, NodeType t, uint32 data=0, bool checkScc=true)
 Creates a new node that corresponds to a literal that is false. More...
 
bool backpropagate (LogicProgram &prg, ValueRep val, bool bpFull)
 

Protected Attributes

EdgeVec supports_
 
uint32 data_: 27
 
uint32 upper_: 1
 
uint32 dirty_: 1
 
uint32 state_: 2
 
uint32 isAtom_: 1
 
- Protected Attributes inherited from Clasp::Asp::PrgNode
uint32 litIdx_: 31
 
uint32 noScc_: 1
 
uint32 id_: 28
 
uint32 val_: 2
 
uint32 eq_: 1
 
uint32 seen_: 1
 

Additional Inherited Members

- Static Public Attributes inherited from Clasp::Asp::PrgNode
static const uint32 noScc = (1u << 27)-1
 
static const uint32 maxVertex = (1u << 28)-1
 
static const uint32 noIdx = 1
 

Detailed Description

A head node of a program-dependency graph.

A head node stores its possible supports and is either an atom or a disjunction.

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
no_simplify 
force_simplify 
Enumerator
state_normal 
state_in_flux 
state_freeze 
state_freeze_true 

Constructor & Destructor Documentation

Clasp::Asp::PrgHead::PrgHead ( uint32  id,
NodeType  t,
uint32  data = 0,
bool  checkScc = true 
)
explicitprotected

Creates a new node that corresponds to a literal that is false.

Member Function Documentation

void Clasp::Asp::PrgHead::addSupport ( PrgEdge  r)
inline

Adds r as support edge for this node.

Here is the call graph for this function:

void Clasp::Asp::PrgHead::addSupport ( PrgEdge  r,
Simplify  s 
)
bool Clasp::Asp::PrgHead::assignValue ( ValueRep  v)
inline

Assigns the value v to this head.

Here is the call graph for this function:

void Clasp::Asp::PrgHead::assignVar ( LogicProgram prg,
PrgEdge  it 
)

Here is the call graph for this function:

Literal Clasp::Asp::PrgHead::assumption ( ) const
inline

Here is the call graph for this function:

bool Clasp::Asp::PrgHead::backpropagate ( LogicProgram prg,
ValueRep  val,
bool  bpFull 
)
protected

Here is the call graph for this function:

void Clasp::Asp::PrgHead::clearSupports ( )
void Clasp::Asp::PrgHead::clearSupports ( EdgeVec to)
inline

Here is the call graph for this function:

bool Clasp::Asp::PrgHead::frozen ( ) const
inline

Defined in a later incremental step?

bool Clasp::Asp::PrgHead::inFlux ( ) const
inline

Thawed in this step?

bool Clasp::Asp::PrgHead::inUpper ( ) const
inline

Is the head part of the (simplified) program?

Here is the call graph for this function:

bool Clasp::Asp::PrgHead::isAtom ( ) const
inline

Is this head an atom?

void Clasp::Asp::PrgHead::markDirty ( )
inline
void Clasp::Asp::PrgHead::removeSupport ( PrgEdge  r)

Removes r from the head's list of supports.

Here is the call graph for this function:

void Clasp::Asp::PrgHead::setInUpper ( bool  b)
inline
bool Clasp::Asp::PrgHead::simplifySupports ( LogicProgram prg,
bool  strong,
uint32 *  numDiffSupps = 0 
)

Removes any superfluous/irrelevant supports.

Here is the call graph for this function:

State Clasp::Asp::PrgHead::state ( ) const
inline
uint32 Clasp::Asp::PrgHead::supports ( ) const
inline

Number of supports (rules) for this head.

sup_iterator Clasp::Asp::PrgHead::supps_begin ( ) const
inline
sup_iterator Clasp::Asp::PrgHead::supps_end ( ) const
inline

Member Data Documentation

uint32 Clasp::Asp::PrgHead::data_
protected
uint32 Clasp::Asp::PrgHead::dirty_
protected
uint32 Clasp::Asp::PrgHead::isAtom_
protected
uint32 Clasp::Asp::PrgHead::state_
protected
EdgeVec Clasp::Asp::PrgHead::supports_
protected
uint32 Clasp::Asp::PrgHead::upper_
protected

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