Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes
Clasp::Asp::LogicProgram Class Reference

A class for defining a logic program. More...

#include <logic_program.h>

Inheritance diagram for Clasp::Asp::LogicProgram:
Inheritance graph
[legend]

List of all members.

Classes

struct  AspOptions
 Options for the Asp-Preprocessor. More...
struct  Incremental
struct  MinimizeRule

Public Types

enum  ExtendedRuleMode {
  mode_native = 0, mode_transform = 1, mode_transform_choice = 2, mode_transform_card = 3,
  mode_transform_weight = 4, mode_transform_scc = 5, mode_transform_nhcf = 6, mode_transform_integ = 7,
  mode_transform_dynamic = 8
}
 Defines the possible modes for handling extended rules, i.e. choice, cardinality, and weight rules. More...

Public Member Functions

 LogicProgram ()
 ~LogicProgram ()
Step control functions
LogicProgramstart (SharedContext &ctx, const AspOptions &opts=AspOptions())
 Starts the definition of a logic program.
void setExtendedRuleMode (ExtendedRuleMode m)
 Sets the mode for handling extended rules (default: mode_native).
void setOptions (const AspOptions &opts)
 Sets preprocessing options.
void setNonHcfConfiguration (Configuration *c)
 Sets the configuration to be used for checker solvers in disjunctive LP solving.
bool update ()
 Unfreezes a currently frozen program and starts an incremental step.
bool end ()
 Finishes the definition of the logic program (or its current increment).
void write (std::ostream &os)
 Writes the (possibly simplified) program in lparse-format to the given stream.
void dispose (bool forceFullDispose)
 Disposes (parts of) the internal representation of the logic program.
bool clone (SharedContext &ctx, bool shareSymbols=false)
 Clones the program and adds it to the given ctx.
Program mutating functions

Functions in this group shall only be called if the program is currently not frozen. That is, only between the call to start() (resp. update() if in incremental setting) and end(). A std::logic_error is raised if this precondition is violated.

Var newAtom ()
 Adds a new atom to the program.
LogicProgramsetAtomName (Var atomId, const char *name)
 Sets the name of the given atom and adds it to the program's symbol table.
LogicProgramsetCompute (Var atomId, bool value)
 Forces the atom's truth-value to value.
LogicProgramfreeze (Var atomId, ValueRep value=value_false)
 Protects an otherwise undefined atom from preprocessing.
LogicProgramunfreeze (Var atomId)
 Removes any protection from the given atom.
LogicProgramaddRule (const Rule &r)
 Adds the given rule to the program.
Rule creation functions

Functions in this group may be used to construct logic program rules. The construction of a rule must start with a call to startRule() and ends with a call to endRule(). Functions for adding elements to a rule shall only be called between calls to startRule()/endRule() and only one rule can be under construction at any one time.

LogicProgramstartRule (RuleType t=BASICRULE, weight_t bound=-1)
 Starts the construction of a rule.
LogicProgramsetBound (weight_t bound)
 Sets the bound (resp. min weight) of the currently active rule.
LogicProgramaddHead (Var atomId)
 Adds the atom with the given id as a head to the currently active rule.
LogicProgramaddToBody (Var atomId, bool pos, weight_t weight=1)
 Adds a subgoal to the currently active rule.
LogicProgramendRule ()
 Finishes the construction of the active rule and adds it to the program.

Private Types

typedef IndexMap::iterator IndexIter
typedef std::multimap< uint32,
uint32 > 
IndexMap
typedef std::pair< IndexIter,
IndexIter
IndexRange
typedef PodVector< Rule * >::type RuleList
typedef PodVector< uint8 >::type SccMap

Private Member Functions

bool addConstraints ()
void addRuleImpl (RuleType t, const VarVec &head, BodyInfo &body)
PrgBodyassignBodyFor (BodyInfo &body, EdgeType x, bool strongSimp)
bool doEndProgram ()
void doGetAssumptions (LitVec &out) const
bool doParse (StreamSource &prg)
bool doStartProgram ()
int doType () const
bool doUpdateProgram ()
uint32 equalBody (const IndexRange &range, BodyInfo &info) const
void finalizeDisjunctions (Preprocessor &p, uint32 numSccs)
uint32 findEqBody (PrgBody *b, uint32 hash)
Var findLpFalseAtom () const
PrgBodygetBodyFor (BodyInfo &body, bool addDeps=true)
PrgDisjgetDisjFor (const VarVec &heads, uint32 headHash)
Literal getEqAtomLit (Literal lit, const BodyList &supports, Preprocessor &p, const SccMap &x)
template<class C >
Var getEqNode (C &vec, Var id) const
PrgAtomgetFalseAtom () const
Var getFalseId () const
bool handleNatively (RuleType t, const BodyInfo &i) const
 LogicProgram (const LogicProgram &)
void normalize ()
LogicProgramoperator= (const LogicProgram &)
bool positiveLoopSafe (PrgBody *b, PrgBody *root) const
void prepareComponents ()
void prepareProgram (bool checkSccs)
uint32 removeBody (PrgBody *b, uint32 oldHash)
PrgAtomresize (Var atomId)
RuleType simplifyBody (const Rule &r, BodyInfo &info)
void simplifyMinimize ()
bool transform (const PrgBody &body, BodyInfo &out) const
void transform (const MinimizeRule &, BodyInfo &out) const
void transformExtended ()
void transformIntegrity (uint32 maxAux)
bool transformNoAux (RuleType t, const BodyInfo &i) const
void updateFrozenAtoms ()
void writeBody (const BodyInfo &body, std::ostream &) const

Private Attributes

BodyInfo activeBody_
VarVec activeHead_
AtomList atoms_
BodyList bodies_
IndexMap bodyIndex_
IndexMap disjIndex_
DisjList disjunctions_
RuleList extended_
struct
Clasp::Asp::LogicProgram::Incremental
incData_
VarVec initialSupp_
struct
Clasp::Asp::LogicProgram::MinimizeRule
minimize_
ConfigurationnonHcfCfg_
NonHcfSet nonHcfs_
AspOptions opts_
VarVec propQ_
Rule rule_
RuleState ruleState_
AtomList sccAtoms_

Query functions

Functions in this group are useful to query important information once the program is frozen, i.e. after end() was called.

LpStats stats
LpStatsaccu
bool hasMinimize () const
 Returns whether the program contains any minimize statements.
uint32 numAtoms () const
 Returns the number of atoms in the logic program.
uint32 numBodies () const
 Returns the number of bodies in the current (slice of the) logic program.
uint32 numDisjunctions () const
 Returns the number of disjunctive heads.
Var startAtom () const
 Returns the id of the first atom of the current step.
Literal getLiteral (Var atomId) const
 Returns the internal literal that is associated with the given atom.

Implementation functions

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

typedef VarVec::const_iterator VarIter
typedef PrgHead *const * HeadIter
typedef std::pair
< EdgeIterator, EdgeIterator
EdgeRange
typedef std::pair< HeadIter,
HeadIter
HeadRange
const AspOptionsoptions () const
bool hasConflict () const
bool ok () const
 Returns true if the program is not conflicting.
PrgAtomgetAtom (Var atomId) const
PrgHeadgetHead (PrgEdge it) const
PrgNodegetSupp (PrgEdge it) const
Var getEqAtom (Var a) const
PrgBodygetBody (Var bodyId) const
Var getEqBody (Var b) const
PrgDisjgetDisj (Var disjId) const
bool isFact (PrgAtom *a) const
HeadIter disj_begin () const
HeadIter disj_end () const
HeadIter atom_begin () const
HeadIter atom_end () const
VarIter unfreeze_begin () const
VarIter unfreeze_end () const
const char * getAtomName (Var id) const
RuleType simplifyRule (const Rule &r, VarVec &head, BodyInfo &info)
VarVecgetSupportedBodies (bool sorted)
uint32 update (PrgBody *b, uint32 oldHash, uint32 newHash)
bool assignValue (PrgAtom *a, ValueRep v)
bool assignValue (PrgHead *h, ValueRep v)
bool propagate (bool backprop)
PrgAtommergeEqAtoms (PrgAtom *a, Var rootAtom)
PrgBodymergeEqBodies (PrgBody *b, Var rootBody, bool hashEq, bool atomsAssigned)
bool propagate ()
void setConflict ()
RuleStateruleState ()
void addMinimize ()
void upRules (RuleType r, int i)
void incTr (RuleType r, uint32 n)
void incTrAux (uint32 n)
void incEqs (VarType t)

Detailed Description

A class for defining a logic program.

Use this class to specify a logic program. Once the program is completly defined, call endProgram() to load the logic program into a SharedContext object.

Definition at line 77 of file logic_program.h.


Member Typedef Documentation

Definition at line 373 of file logic_program.h.

Definition at line 372 of file logic_program.h.

Definition at line 374 of file logic_program.h.

typedef IndexMap::iterator Clasp::Asp::LogicProgram::IndexIter [private]

Definition at line 418 of file logic_program.h.

typedef std::multimap<uint32, uint32> Clasp::Asp::LogicProgram::IndexMap [private]

Definition at line 417 of file logic_program.h.

Definition at line 419 of file logic_program.h.

Definition at line 416 of file logic_program.h.

typedef PodVector<uint8>::type Clasp::Asp::LogicProgram::SccMap [private]

Definition at line 420 of file logic_program.h.

typedef VarVec::const_iterator Clasp::Asp::LogicProgram::VarIter

Definition at line 371 of file logic_program.h.


Member Enumeration Documentation

Defines the possible modes for handling extended rules, i.e. choice, cardinality, and weight rules.

Enumerator:
mode_native 

Handle extended rules natively.

mode_transform 

Transform extended rules to normal rules.

mode_transform_choice 

Transform only choice rules to normal rules.

mode_transform_card 

Transform only cardinality rules to normal rules.

mode_transform_weight 

Transform cardinality- and weight rules to normal rules.

mode_transform_scc 

Transform recursive cardinality- and weight rules to normal rules.

mode_transform_nhcf 

Transform cardinality- and weight rules in non-hcf components to normal rules.

mode_transform_integ 

Transform cardinality-based integrity constraints.

mode_transform_dynamic 

Heuristically decide whether or not to transform a particular extended rule.

Definition at line 82 of file logic_program.h.


Constructor & Destructor Documentation

Definition at line 132 of file logic_program.cpp.

Definition at line 133 of file logic_program.cpp.


Member Function Documentation

Definition at line 913 of file logic_program.cpp.

Adds the atom with the given id as a head to the currently active rule.

Definition at line 306 of file logic_program.h.

Definition at line 282 of file logic_program.cpp.

Adds the given rule to the program.

Precondition:
The head of the rule does not contain an atom defined in a previous incremental step.

Simplifies the given rule and adds it to the program if it is neither tautological (e.g. a :- a) nor contradictory (e.g. a :- b, not b). Atoms in the simplified rule that are not yet known are implicitly created.

Exceptions:
RedefinitionErrorif the precondition is violated.
Note:
If the head of the simplified rule mentions an atom from a previous step, that atom shall either be frozen or false. In the former case, unfreeze() is implicitly called. In the latter case, the rule is interpreted as an integrity constraint.

Definition at line 449 of file logic_program.cpp.

void Clasp::Asp::LogicProgram::addRuleImpl ( RuleType  t,
const VarVec head,
BodyInfo body 
) [private]

Definition at line 499 of file logic_program.cpp.

LogicProgram& Clasp::Asp::LogicProgram::addToBody ( Var  atomId,
bool  pos,
weight_t  weight = 1 
) [inline]

Adds a subgoal to the currently active rule.

Precondition:
atomId > 0 && weight >= 0
Parameters:
atomIdThe id of the atom to be added to the rule.
postrue if the atom is positive. Fals otherwise
weightThe weight the new predecessor should have in the rule.
Note:
The weight parameter is only used if the active rule is a weight or optimize rule.

Definition at line 320 of file logic_program.h.

PrgBody * Clasp::Asp::LogicProgram::assignBodyFor ( BodyInfo body,
EdgeType  x,
bool  strongSimp 
) [private]

Definition at line 1195 of file logic_program.cpp.

Definition at line 538 of file logic_program.cpp.

Definition at line 546 of file logic_program.cpp.

Definition at line 388 of file logic_program.h.

Definition at line 389 of file logic_program.h.

bool Clasp::Asp::LogicProgram::clone ( SharedContext ctx,
bool  shareSymbols = false 
)

Clones the program and adds it to the given ctx.

Definition at line 269 of file logic_program.cpp.

Definition at line 386 of file logic_program.h.

Definition at line 387 of file logic_program.h.

void Clasp::Asp::LogicProgram::dispose ( bool  forceFullDispose)

Disposes (parts of) the internal representation of the logic program.

Parameters:
forceFullDisposeIf set to true, the whole program is disposed. Otherwise, only the rules (of the current step) are disposed but atoms and any incremental control data remain.

Definition at line 135 of file logic_program.cpp.

bool Clasp::Asp::LogicProgram::doEndProgram ( ) [private, virtual]

Implements Clasp::ProgramBuilder.

Definition at line 260 of file logic_program.cpp.

void Clasp::Asp::LogicProgram::doGetAssumptions ( LitVec out) const [private]

Definition at line 489 of file logic_program.cpp.

bool Clasp::Asp::LogicProgram::doParse ( StreamSource prg) [private, virtual]

Implements Clasp::ProgramBuilder.

Definition at line 235 of file logic_program.cpp.

bool Clasp::Asp::LogicProgram::doStartProgram ( ) [private, virtual]

Implements Clasp::ProgramBuilder.

Definition at line 215 of file logic_program.cpp.

int Clasp::Asp::LogicProgram::doType ( ) const [inline, private, virtual]

Implements Clasp::ProgramBuilder.

Definition at line 429 of file logic_program.h.

bool Clasp::Asp::LogicProgram::doUpdateProgram ( ) [private, virtual]

Implements Clasp::ProgramBuilder.

Definition at line 236 of file logic_program.cpp.

bool Clasp::Asp::LogicProgram::end ( ) [inline]

Finishes the definition of the logic program (or its current increment).

Applies program mutating operations issued in the current step and transforms the new program into the solver's internal representation.

Returns:
false if the program is conflicting, true otherwise.
Postcondition:
  • If true is returned, the program is considered to be "frozen" and calling program mutating functions is invalid until the next call to update().
  • If false is returned, the state of the object is undefined and start() and dispose() are the only remaining valid operations.
Note:
The function is an alias for ProgramBuilder::endProgram().

Definition at line 165 of file logic_program.h.

Finishes the construction of the active rule and adds it to the program.

See also:
LogicProgram::addRule(Rule&);

Definition at line 329 of file logic_program.h.

uint32 Clasp::Asp::LogicProgram::equalBody ( const IndexRange range,
BodyInfo info 
) const [private]

Definition at line 1219 of file logic_program.cpp.

void Clasp::Asp::LogicProgram::finalizeDisjunctions ( Preprocessor p,
uint32  numSccs 
) [private]

Definition at line 734 of file logic_program.cpp.

uint32 Clasp::Asp::LogicProgram::findEqBody ( PrgBody b,
uint32  hash 
) [private]

Definition at line 1233 of file logic_program.cpp.

uint32 Clasp::Asp::LogicProgram::findLpFalseAtom ( ) const [private]

Definition at line 1356 of file logic_program.cpp.

Protects an otherwise undefined atom from preprocessing.

If the atom is defined in this or a previous step, the operation has no effect.

Note:
If atomId is not yet known, an atom with the given id is implicitly created.
The second parameter defines the value that is assumed for the given atom while it is frozen. It shall be either value_false or value_true.

Definition at line 423 of file logic_program.cpp.

PrgAtom* Clasp::Asp::LogicProgram::getAtom ( Var  atomId) const [inline]

Definition at line 378 of file logic_program.h.

const char * Clasp::Asp::LogicProgram::getAtomName ( Var  id) const

Definition at line 1365 of file logic_program.cpp.

PrgBody* Clasp::Asp::LogicProgram::getBody ( Var  bodyId) const [inline]

Definition at line 382 of file logic_program.h.

PrgBody * Clasp::Asp::LogicProgram::getBodyFor ( BodyInfo body,
bool  addDeps = true 
) [private]

Definition at line 1179 of file logic_program.cpp.

PrgDisj* Clasp::Asp::LogicProgram::getDisj ( Var  disjId) const [inline]

Definition at line 384 of file logic_program.h.

PrgDisj * Clasp::Asp::LogicProgram::getDisjFor ( const VarVec heads,
uint32  headHash 
) [private]

Definition at line 1250 of file logic_program.cpp.

Definition at line 381 of file logic_program.h.

Literal Clasp::Asp::LogicProgram::getEqAtomLit ( Literal  lit,
const BodyList supports,
Preprocessor p,
const SccMap x 
) [private]

Definition at line 1143 of file logic_program.cpp.

Definition at line 383 of file logic_program.h.

template<class C >
Var Clasp::Asp::LogicProgram::getEqNode ( C &  vec,
Var  id 
) const [inline, private]

Definition at line 450 of file logic_program.h.

PrgAtom* Clasp::Asp::LogicProgram::getFalseAtom ( ) const [inline, private]

Definition at line 474 of file logic_program.h.

Var Clasp::Asp::LogicProgram::getFalseId ( ) const [inline, private]

Definition at line 473 of file logic_program.h.

Definition at line 379 of file logic_program.h.

Returns the internal literal that is associated with the given atom.

Precondition:
atomId is a known atom
Returns:
A literal that is valid in the current solving context.
Note:
Untill end() is called, atoms from the current step are associated with the always-false literal negLit(0).
Exceptions:
std::logic_errorif precondition is violated.

Definition at line 485 of file logic_program.cpp.

Definition at line 380 of file logic_program.h.

Definition at line 1371 of file logic_program.cpp.

bool Clasp::Asp::LogicProgram::handleNatively ( RuleType  t,
const BodyInfo i 
) const [private]

Definition at line 550 of file logic_program.cpp.

bool Clasp::Asp::LogicProgram::hasConflict ( ) const [inline]

Definition at line 376 of file logic_program.h.

bool Clasp::Asp::LogicProgram::hasMinimize ( ) const [inline]

Returns whether the program contains any minimize statements.

Definition at line 343 of file logic_program.h.

Definition at line 410 of file logic_program.h.

void Clasp::Asp::LogicProgram::incTr ( RuleType  r,
uint32  n 
) [inline]

Definition at line 408 of file logic_program.h.

void Clasp::Asp::LogicProgram::incTrAux ( uint32  n) [inline]

Definition at line 409 of file logic_program.h.

bool Clasp::Asp::LogicProgram::isFact ( PrgAtom a) const [inline]

Definition at line 385 of file logic_program.h.

Definition at line 1312 of file logic_program.cpp.

PrgBody * Clasp::Asp::LogicProgram::mergeEqBodies ( PrgBody b,
Var  rootBody,
bool  hashEq,
bool  atomsAssigned 
)

Definition at line 1332 of file logic_program.cpp.

Adds a new atom to the program.

Returns:
The new atom's id.

Definition at line 399 of file logic_program.cpp.

uint32 Clasp::Asp::LogicProgram::numAtoms ( ) const [inline]

Returns the number of atoms in the logic program.

Definition at line 345 of file logic_program.h.

uint32 Clasp::Asp::LogicProgram::numBodies ( ) const [inline]

Returns the number of bodies in the current (slice of the) logic program.

Definition at line 347 of file logic_program.h.

uint32 Clasp::Asp::LogicProgram::numDisjunctions ( ) const [inline]

Returns the number of disjunctive heads.

Definition at line 349 of file logic_program.h.

bool Clasp::Asp::LogicProgram::ok ( ) const [inline, virtual]

Returns true if the program is not conflicting.

Reimplemented from Clasp::ProgramBuilder.

Definition at line 377 of file logic_program.h.

LogicProgram& Clasp::Asp::LogicProgram::operator= ( const LogicProgram ) [private]
const AspOptions& Clasp::Asp::LogicProgram::options ( ) const [inline]

Definition at line 375 of file logic_program.h.

bool Clasp::Asp::LogicProgram::positiveLoopSafe ( PrgBody b,
PrgBody root 
) const [private]

Definition at line 1326 of file logic_program.cpp.

Definition at line 832 of file logic_program.cpp.

void Clasp::Asp::LogicProgram::prepareProgram ( bool  checkSccs) [private]

Definition at line 691 of file logic_program.cpp.

bool Clasp::Asp::LogicProgram::propagate ( bool  backprop)

Definition at line 969 of file logic_program.cpp.

Definition at line 401 of file logic_program.h.

uint32 Clasp::Asp::LogicProgram::removeBody ( PrgBody b,
uint32  oldHash 
) [private]

Definition at line 1299 of file logic_program.cpp.

PrgAtom * Clasp::Asp::LogicProgram::resize ( Var  atomId) [private]

Definition at line 962 of file logic_program.cpp.

Definition at line 403 of file logic_program.h.

LogicProgram & Clasp::Asp::LogicProgram::setAtomName ( Var  atomId,
const char *  name 
)

Sets the name of the given atom and adds it to the program's symbol table.

Precondition:
  • The atom is either not yet known or was added in the current step (atomId >= startAtom()).
  • The atom was not yet added to the symbol table, i.e. setAtomName() is called at most once for an atom.
Parameters:
atomIdThe id of the atom for which a name should be set
nameThe new name of the atom with the given id.
Note:
If atomId is not yet known, an atom with the given id is implicitly created.
Exceptions:
RedefinitionErrorprecondition is violated.
std::logic_errorprogram is frozen.

Definition at line 406 of file logic_program.cpp.

Sets the bound (resp. min weight) of the currently active rule.

Parameters:
boundThe lower bound (resp. min weight) of the rule to be created.
Precondition:
The rule under construction is either a constraint or weight rule.

Definition at line 300 of file logic_program.h.

LogicProgram & Clasp::Asp::LogicProgram::setCompute ( Var  atomId,
bool  value 
)

Forces the atom's truth-value to value.

Precondition:
The atom is either not yet known, false, or an atom from the current step.
Parameters:
atomIdId of the Atom for which a truth-value should be set.
posIf true, atom is set to true (forced to be in every answer set). Otherwise atom is set to false (not part of any answer set).
Note:
If atomId is not yet known, an atom with the given id is implicitly created.

Definition at line 414 of file logic_program.cpp.

Definition at line 402 of file logic_program.h.

Sets the mode for handling extended rules (default: mode_native).

Definition at line 127 of file logic_program.h.

Sets the configuration to be used for checker solvers in disjunctive LP solving.

Definition at line 131 of file logic_program.h.

Sets preprocessing options.

Definition at line 227 of file logic_program.cpp.

RuleType Clasp::Asp::LogicProgram::simplifyBody ( const Rule r,
BodyInfo info 
) [private]

Definition at line 1002 of file logic_program.cpp.

Definition at line 650 of file logic_program.cpp.

RuleType Clasp::Asp::LogicProgram::simplifyRule ( const Rule r,
VarVec head,
BodyInfo info 
)

Definition at line 1090 of file logic_program.cpp.

Starts the definition of a logic program.

Definition at line 121 of file logic_program.h.

Returns the id of the first atom of the current step.

Definition at line 351 of file logic_program.h.

Starts the construction of a rule.

Parameters:
tThe type of the new rule.
boundThe lower bound (resp. min weight) of the rule to be created.
Note:
the bound-parameter is only interpreted if the rule to be created is either a constraint- or a weight-rule.

Definition at line 286 of file logic_program.h.

bool Clasp::Asp::LogicProgram::transform ( const PrgBody body,
BodyInfo out 
) const [private]

Definition at line 1378 of file logic_program.cpp.

void Clasp::Asp::LogicProgram::transform ( const MinimizeRule body,
BodyInfo out 
) const [private]

Definition at line 1401 of file logic_program.cpp.

Definition at line 582 of file logic_program.cpp.

void Clasp::Asp::LogicProgram::transformIntegrity ( uint32  maxAux) [private]

Definition at line 598 of file logic_program.cpp.

bool Clasp::Asp::LogicProgram::transformNoAux ( RuleType  t,
const BodyInfo i 
) const [private]

Definition at line 578 of file logic_program.cpp.

Removes any protection from the given atom.

If the atom is defined in this or a previous step, the operation has no effect.

Note:
  • The effect is logically equivalent to adding a rule atomId :- false.
  • A call to unfreeze() always overwrites a call to freeze() even if the latter comes after the former

Definition at line 437 of file logic_program.cpp.

Definition at line 390 of file logic_program.h.

Definition at line 391 of file logic_program.h.

Unfreezes a currently frozen program and starts an incremental step.

If a program is to be defined incrementally, this function must be called exactly once for each step before any new rules or atoms are added.

Note:
Program update only works correctly under the following assumptions:
  • Atoms introduced in step i are either:
    • solely defined in step i OR,
    • marked as frozen in step i and solely defined in step i+k OR,
    • forced to false by a acompute statement in step 0
Precondition:
The program is either frozen or at step 0.
Postcondition:
The program is no longer frozen and calling program mutating functions is valid again.
Exceptions:
std::logic_errorprecondition is violated.
Note:
The function is an alias for ProgramBuilder::updateProgram().

Definition at line 148 of file logic_program.h.

uint32 Clasp::Asp::LogicProgram::update ( PrgBody b,
uint32  oldHash,
uint32  newHash 
)

Definition at line 1284 of file logic_program.cpp.

Definition at line 659 of file logic_program.cpp.

void Clasp::Asp::LogicProgram::upRules ( RuleType  r,
int  i 
) [inline]

Definition at line 407 of file logic_program.h.

void Clasp::Asp::LogicProgram::write ( std::ostream &  os)

Writes the (possibly simplified) program in lparse-format to the given stream.

Definition at line 298 of file logic_program.cpp.

void Clasp::Asp::LogicProgram::writeBody ( const BodyInfo body,
std::ostream &  out 
) const [private]

Definition at line 1418 of file logic_program.cpp.


Member Data Documentation

Definition at line 362 of file logic_program.h.

Definition at line 477 of file logic_program.h.

Definition at line 478 of file logic_program.h.

Definition at line 484 of file logic_program.h.

Definition at line 483 of file logic_program.h.

Definition at line 481 of file logic_program.h.

Definition at line 482 of file logic_program.h.

Definition at line 486 of file logic_program.h.

Definition at line 480 of file logic_program.h.

Definition at line 487 of file logic_program.h.

Definition at line 490 of file logic_program.h.

Definition at line 489 of file logic_program.h.

Definition at line 503 of file logic_program.h.

Definition at line 488 of file logic_program.h.

Definition at line 476 of file logic_program.h.

Definition at line 479 of file logic_program.h.

Definition at line 485 of file logic_program.h.

Definition at line 361 of file logic_program.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