Public Types | Public Member Functions
Clasp::SharedDependencyGraph::BodyNode Struct Reference

A body node. More...

#include <dependency_graph.h>

Inheritance diagram for Clasp::SharedDependencyGraph::BodyNode:
Inheritance graph
[legend]

List of all members.

Public Types

enum  Flag { flag_has_delta = 4u, flag_seen = 8u }
enum  Type { type_normal = 0u, type_count = 1u, type_sum = 3u }

Public Member Functions

 BodyNode (PrgBody *b, uint32 scc)
bool delta () const
 Any disjunctive heads?
weight_t ext_bound () const
 Bound of extended body.
bool extended () const
 Is the body an extended body?
NodeId get_pred (uint32 idx) const
uint32 get_pred_idx (NodeId atomId) const
 Returns idx of atomId in preds.
const NodeIdheads_begin () const
 Heads (i.e. successors): atoms from same SCC precede those from other SCCs.
const NodeIdheads_end () const
uint32 num_preds () const
 Number of predecessors (counting external subgoals).
uint32 pred_inc () const
 Increment to jump from one pred to the next.
uint32 pred_weight (uint32 i, bool ext) const
 Weight of ith subgoal.
const NodeIdpreds () const
 Predecessors from same SCC [a1,...an, idMax].
bool seen () const
void seen (bool b)
bool sum () const
 Is the body a sum body?

Detailed Description

A body node.

The PBDAG stores a node of type BodyNode for each body that defines a non-trivially connected atom. The predecessors of a BodyNode are the body's subgoals. Its successors are the heads that are defined by the body.

Note:
Normal bodies only store the positive subgoals from the same SCC, while extended rule bodies store all subgoals. In the latter case, the positive subgoals from the same SCC are stored as AtomNodes. All other subgoals are stored as literals.

Definition at line 154 of file dependency_graph.h.


Member Enumeration Documentation

Enumerator:
flag_has_delta 
flag_seen 

Definition at line 156 of file dependency_graph.h.

Enumerator:
type_normal 
type_count 
type_sum 

Definition at line 155 of file dependency_graph.h.


Constructor & Destructor Documentation

Clasp::SharedDependencyGraph::BodyNode::BodyNode ( PrgBody b,
uint32  scc 
) [inline, explicit]

Definition at line 157 of file dependency_graph.h.


Member Function Documentation

Any disjunctive heads?

Definition at line 182 of file dependency_graph.h.

Bound of extended body.

Definition at line 228 of file dependency_graph.h.

Is the body an extended body?

Definition at line 224 of file dependency_graph.h.

Definition at line 200 of file dependency_graph.h.

Returns idx of atomId in preds.

Definition at line 192 of file dependency_graph.h.

Heads (i.e. successors): atoms from same SCC precede those from other SCCs.

Note:
Disjunctive heads are stored in flattened atom-lists, where the lists are terminated on both ends with the special sentinal atom 0. E.g. given x :- B. y :- B. a|b:- B. a|c:- B. would result in: [x,y,0,a,b,0,0,a,c,0]

Definition at line 179 of file dependency_graph.h.

Definition at line 180 of file dependency_graph.h.

Number of predecessors (counting external subgoals).

Definition at line 213 of file dependency_graph.h.

Increment to jump from one pred to the next.

Definition at line 202 of file dependency_graph.h.

uint32 Clasp::SharedDependencyGraph::BodyNode::pred_weight ( uint32  i,
bool  ext 
) const [inline]

Weight of ith subgoal.

Precondition:
i in [0, num_preds())

Definition at line 207 of file dependency_graph.h.

Predecessors from same SCC [a1,...an, idMax].

Note:
If extended() is true, the body stores all its subgoals and preds looks like this: [a1, [w1], ..., aj, [wj], idMax, l1, [w1], ..., lk, [wk], idMax], where each ai is an atom from the same SCC, each li is a literal of a subgoal from other SCCs and wi is an optional weight (only for weight rules).

Definition at line 190 of file dependency_graph.h.

Definition at line 165 of file dependency_graph.h.

Definition at line 166 of file dependency_graph.h.

Is the body a sum body?

Definition at line 226 of file dependency_graph.h.


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


clasp
Author(s): Benjamin Kaufmann
autogenerated on Thu Aug 27 2015 12:41:41