Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
Clasp::Asp::Rule Class Reference

A rule of a logic program. More...

#include <logic_program_types.h>

List of all members.

Public Member Functions

RuleaddHead (Var v)
 Adds v as a head of this rule.
RuleaddToBody (Var v, bool pos, weight_t w=1)
 Adds v to the positive/negative body of the rule.
bool bodyHasBound () const
bool bodyHasWeights () const
bool bodyIsSet () const
weight_t bound () const
 Returns the lower bound of the rule.
void clear ()
 Resets the rule.
 Rule (RuleType t=ENDRULE)
RulesetBound (weight_t bound)
 Sets the lower bound of the rule.
RulesetType (RuleType t)
 Sets the type of the rule.
void swap (Rule &o)
 Swaps *this with o.
RuleType type () const
 Returns the rule's type.

Public Attributes

WeightLitVec body
VarVec heads

Private Member Functions

Ruleoperator= (const Rule &)
 Rule (const Rule &)

Private Attributes

weight_t bound_
RuleType type_

Detailed Description

A rule of a logic program.

Objects of this class represent one rule of a logic program.

Definition at line 135 of file logic_program_types.h.


Constructor & Destructor Documentation

Clasp::Asp::Rule::Rule ( RuleType  t = ENDRULE) [inline, explicit]

Definition at line 137 of file logic_program_types.h.

Clasp::Asp::Rule::Rule ( const Rule ) [private]

Member Function Documentation

Adds v as a head of this rule.

Definition at line 49 of file logic_program_types.cpp.

Rule & Clasp::Asp::Rule::addToBody ( Var  v,
bool  pos,
weight_t  w = 1 
)

Adds v to the positive/negative body of the rule.

Definition at line 57 of file logic_program_types.cpp.

bool Clasp::Asp::Rule::bodyHasBound ( ) const [inline]

Definition at line 176 of file logic_program_types.h.

bool Clasp::Asp::Rule::bodyHasWeights ( ) const [inline]

Definition at line 175 of file logic_program_types.h.

bool Clasp::Asp::Rule::bodyIsSet ( ) const [inline]

Definition at line 177 of file logic_program_types.h.

weight_t Clasp::Asp::Rule::bound ( ) const [inline]

Returns the lower bound of the rule.

Definition at line 173 of file logic_program_types.h.

Resets the rule.

Definition at line 41 of file logic_program_types.cpp.

Rule& Clasp::Asp::Rule::operator= ( const Rule ) [private]

Sets the lower bound of the rule.

Precondition:
bound >= 0
Note:
The bound is only used for constraint- and weight rules.

Definition at line 167 of file logic_program_types.h.

Sets the type of the rule.

Precondition:
t != ENDRULE

Definition at line 155 of file logic_program_types.h.

void Clasp::Asp::Rule::swap ( Rule o) [inline]

Swaps *this with o.

Definition at line 144 of file logic_program_types.h.

RuleType Clasp::Asp::Rule::type ( ) const [inline]

Returns the rule's type.

Definition at line 161 of file logic_program_types.h.


Member Data Documentation

Body literals of this rule.

Definition at line 184 of file logic_program_types.h.

Definition at line 188 of file logic_program_types.h.

List of rule heads.

Definition at line 183 of file logic_program_types.h.

Definition at line 189 of file logic_program_types.h.


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


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