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