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

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

#include <logic_program_types.h>

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

Public Member Functions

 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...
 
implementation functions

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

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)
 

Static Public Attributes

static const uint32 noScc = (1u << 27)-1
 
static const uint32 maxVertex = (1u << 28)-1
 
static const uint32 noIdx = 1
 

Protected Attributes

uint32 litIdx_: 31
 
uint32 noScc_: 1
 
uint32 id_: 28
 
uint32 val_: 2
 
uint32 eq_: 1
 
uint32 seen_: 1
 

Detailed Description

A node of a program-dependency graph.

A node represents a relevant part in a logic program. Each node has at least a literal and a value.

Constructor & Destructor Documentation

Clasp::Asp::PrgNode::PrgNode ( uint32  id,
bool  checkScc = true 
)
explicit

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

Member Function Documentation

bool Clasp::Asp::PrgNode::assignValueImpl ( ValueRep  v,
bool  noWeak 
)
inline

Here is the call graph for this function:

void Clasp::Asp::PrgNode::clearLiteral ( bool  clVal)
inline
bool Clasp::Asp::PrgNode::eq ( ) const
inline

Returns true if this node is equivalent to some other node.

If eq() is true, the node is no longer relevant and must not be used any further. The only sensible operation is to call id() in order to get the id of the node that is equivalent to this node.

bool Clasp::Asp::PrgNode::hasVar ( ) const
inline

Returns true if node has an associated variable in a solver.

uint32 Clasp::Asp::PrgNode::id ( ) const
inline

Returns the current id of this node.

bool Clasp::Asp::PrgNode::ignoreScc ( ) const
inline

Ignore the node during scc checking?

Literal Clasp::Asp::PrgNode::literal ( ) const
inline

Returns the literal associated with this node or a sentinel literal if no var is associated with this node.

Here is the call graph for this function:

void Clasp::Asp::PrgNode::markRemoved ( )
inline

Here is the call graph for this function:

void Clasp::Asp::PrgNode::markSeen ( bool  b)
inline
bool Clasp::Asp::PrgNode::relevant ( ) const
inline

Is the node still relevant or removed() resp. eq()?

bool Clasp::Asp::PrgNode::removed ( ) const
inline

Was the node removed?

void Clasp::Asp::PrgNode::resetId ( uint32  id,
bool  seen 
)
inline

Here is the call graph for this function:

bool Clasp::Asp::PrgNode::seen ( ) const
inline
void Clasp::Asp::PrgNode::setEq ( uint32  eqId)
inline
void Clasp::Asp::PrgNode::setIgnoreScc ( bool  b)
inline
void Clasp::Asp::PrgNode::setLiteral ( Literal  x)
inline

Here is the call graph for this function:

void Clasp::Asp::PrgNode::setValue ( ValueRep  v)
inline
Literal Clasp::Asp::PrgNode::trueLit ( ) const
inline

Returns the literal that must be true in order to fulfill the truth-value of this node.

Here is the call graph for this function:

ValueRep Clasp::Asp::PrgNode::value ( ) const
inline

Returns the value currently assigned to this node.

Var Clasp::Asp::PrgNode::var ( ) const
inline

Returns the variable associated with this node or sentVar if no var is associated with this node.

Member Data Documentation

uint32 Clasp::Asp::PrgNode::eq_
protected
uint32 Clasp::Asp::PrgNode::id_
protected
uint32 Clasp::Asp::PrgNode::litIdx_
protected
const uint32 Clasp::Asp::PrgNode::maxVertex = (1u << 28)-1
static
const uint32 Clasp::Asp::PrgNode::noIdx = 1
static
const uint32 Clasp::Asp::PrgNode::noScc = (1u << 27)-1
static
uint32 Clasp::Asp::PrgNode::noScc_
protected
uint32 Clasp::Asp::PrgNode::seen_
protected
uint32 Clasp::Asp::PrgNode::val_
protected

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