clingo
|
Interface for defining an input program. More...
#include <program_builder.h>
Public Types | |
typedef SharedMinimizeData | SharedMinimize |
typedef SingleOwnerPtr < SharedMinimize, ReleaseObject > | MinPtr |
Public Member Functions | |
ProgramBuilder () | |
virtual | ~ProgramBuilder () |
bool | startProgram (SharedContext &ctx) |
Starts the definition of a program. More... | |
bool | parseProgram (StreamSource &prg) |
Parses the given stream as a program of type() and adds it to this object. More... | |
bool | parseProgram (std::istream &prg) |
bool | updateProgram () |
Unfreezes a currently frozen program. More... | |
bool | endProgram () |
Loads the program into the shared context passed to startProgram(). More... | |
void | getAssumptions (LitVec &out) const |
Returns any assumptions that shall hold during solving. More... | |
SharedMinimize * | getMinimizeConstraint (SumVec *softBound=0) const |
Returns an optimized representation of the program's minimize statements (if any). More... | |
void | disposeMinimizeConstraint () |
Removes a previously created minimize constraint. More... | |
int | type () const |
Returns the type of program that is created by this builder. More... | |
bool | frozen () const |
Returns true if the program is currently frozen. More... | |
virtual bool | ok () const |
Returns true if the program is not conflicting. More... | |
SharedContext * | ctx () const |
Returns the stored context object. More... | |
Protected Member Functions | |
void | addMinLit (WeightLiteral x) |
void | addMinRule (const WeightLitVec &lits) |
void | disposeMin () |
void | setFrozen (bool frozen) |
void | setCtx (SharedContext *x) |
Interface for defining an input program.