Interpreter for the FlatZinc language. More...
Namespaces | |
| namespace | AST |
| Abstract syntax trees for the FlatZinc interpreter. | |
| namespace | Internal |
| namespace | RegistryDetail |
Classes | |
| class | Alias |
| Alias for a variable specification More... | |
| class | AuxVarBrancher |
| Branching on the introduced variables. More... | |
| class | BlackBoxAccess |
| Access to the model-local blackbox context while posting and searching. More... | |
| class | BlackBoxBackend |
| Backend for a deterministic FlatZinc blackbox function. More... | |
| struct | BlackBoxCall |
| Inputs and pre-sized output buffers for one backend call. More... | |
| class | BlackBoxContext |
| class | BlackBoxContextHandle |
| Model-local context shared by blackbox propagators and search support. More... | |
| class | BlackBoxExec |
| Persistent-process backend shared by equal executable configurations. More... | |
| class | BlackBoxLibrary |
| Dynamic-library backend owned by one blackbox constraint. More... | |
| class | BlackBoxProcessSession |
| Platform process session used by the executable blackbox backend. More... | |
| class | BoolVarSpec |
| Specification for Boolean variables. More... | |
| class | BranchInformation |
| class | BranchInformationO |
| class | Complete |
| class | ConExpr |
| Abstract representation of a constraint. More... | |
| class | Error |
| Exception class for FlatZinc errors More... | |
| class | FlatZincGetInfo |
| class | FlatZincOptions |
| Options for running FlatZinc models More... | |
| class | FlatZincSpace |
| A space that can be initialized with a FlatZinc model. More... | |
| class | FlatZincSpaceInitData |
| class | FlatZincStop |
| class | FloatVarSpec |
| Specification for floating point variables. More... | |
| class | FZPrintingComparator |
| class | FZPrintingInspector |
| An inspector for printing simple text output. More... | |
| class | GistEngine |
| Traits class for search engines. More... | |
| class | GistEngine< BAB< S > > |
| Specialization for BAB. More... | |
| class | GistEngine< DFS< S > > |
| Specialization for DFS. More... | |
| class | IntBoolBrancher |
| Brancher for integer and Boolean views. More... | |
| class | IntBoolBrancherBase |
| Base-class for brancher for integer and Boolean views. More... | |
| class | IntBoolVarBranch |
| Which integer or Boolean variable to select for branching. More... | |
| class | InterruptHandlerGuard |
| class | IntVarSpec |
| Specification for integer variables. More... | |
| class | LastVal |
| class | MeritMaxAction |
| Select by maximal Action. More... | |
| class | MeritMaxActionSize |
| Select by maximal Action over size. More... | |
| class | MeritMaxAFC |
| Select by maximal AFC. More... | |
| class | MeritMaxAFCSize |
| Select by maximal AFC over size. More... | |
| class | MeritMaxCHB |
| Select by maximal CHB. More... | |
| class | MeritMaxCHBSize |
| Select by maximal CHB over size. More... | |
| struct | Option |
| Optional value. More... | |
| class | OutputOrder |
| Strict weak ordering for output items. More... | |
| class | ParserState |
| State of the FlatZinc parser More... | |
| class | PosIntChoice |
| Choice storing position and value More... | |
| class | Printer |
| Output support class for FlatZinc interpreter. More... | |
| class | Registry |
| Map from constraint identifier to constraint posting functions. More... | |
| class | SetBoolLastVal |
| class | SetFloatLastVal |
| class | SetIntLastVal |
| class | SetIntSetLastVal |
| class | SetVarSpec |
| Specification for set variables. More... | |
| class | SymbolEntry |
| Entries in the symbol table. More... | |
| class | SymbolTable |
| Symbol table mapping identifiers (strings) to values. More... | |
| class | VarSpec |
| Base class for variable specifications. More... | |
Typedefs | |
| typedef LastVal< IntView, SetIntLastVal > | LastValInt |
| typedef LastVal< BoolView, SetBoolLastVal > | LastValBool |
| typedef LastVal< Float::FloatView, SetFloatLastVal > | LastValFloat |
| typedef LastVal< Set::SetView, SetIntSetLastVal > | LastValSet |
| typedef std::pair< std::string, Option< std::vector< int > * > > | intvartype |
| typedef std::pair< std::string, VarSpec * > | varspec |
Enumerations | |
| enum | SymbolType { ST_INTVAR , ST_BOOLVAR , ST_FLOATVAR , ST_SETVAR , ST_INTVARARRAY , ST_BOOLVARARRAY , ST_SETVARARRAY , ST_FLOATVARARRAY , ST_INTVALARRAY , ST_BOOLVALARRAY , ST_SETVALARRAY , ST_FLOATVALARRAY , ST_INT , ST_BOOL , ST_SET , ST_FLOAT } |
| Types of symbols. More... | |
Functions | |
| GECODE_FLATZINC_EXPORT FlatZincSpace * | parse (const std::string &fileName, Printer &p, std::ostream &err=std::cerr, FlatZincSpace *fzs=nullptr, Rnd &rnd=defrnd) |
| Parse FlatZinc file fileName into fzs and return it. | |
| GECODE_FLATZINC_EXPORT FlatZincSpace * | parse (std::istream &is, Printer &p, std::ostream &err=std::cerr, FlatZincSpace *fzs=nullptr, Rnd &rnd=defrnd) |
| Parse FlatZinc from is into fzs and return it. | |
| std::string | encode_blackbox_request (const BlackBoxCall &call) |
| Encode one request for the executable backend's line protocol. | |
| void | decode_blackbox_response (const std::string &response, BlackBoxCall &call) |
| Decode and validate one response from the executable backend. | |
| BlackBoxProcessSession * | create_blackbox_process (const std::string &program, const std::vector< std::string > &args) |
| Create the process implementation selected for the target platform. | |
| void | blackbox (Home home, BlackBoxContextHandle &context, const IntVarArgs &int_in, const IntVarArgs &int_out, const FloatVarArgs &float_in, const FloatVarArgs &float_out, const std::string &mode, const std::string &target, const std::vector< std::string > &args) |
| void | blackbox_bounds (Home home, BlackBoxContextHandle &context, const IntVarArgs &ivar, const FloatVarArgs &fvar, const std::string &mode, const std::string &target, const std::vector< std::string > &args, const std::vector< int > &reason) |
| void | branch (Home home, const IntVarArgs &x, const BoolVarArgs &y, IntBoolVarBranch vars, IntValBranch vals) |
| Branch function for integer and Boolean variables. | |
| IntBoolVarBranch | INTBOOL_VAR_AFC_MAX (double d=1.0) |
| Variable selection for both integer and Boolean variables. | |
| IntBoolVarBranch | INTBOOL_VAR_AFC_MAX (IntAFC ia, BoolAFC ba) |
| Select variable with largest accumulated failure count. | |
| IntBoolVarBranch | INTBOOL_VAR_ACTION_MAX (double d=1.0) |
| Select variable with highest action. | |
| IntBoolVarBranch | INTBOOL_VAR_ACTION_MAX (IntAction ia, BoolAction ba) |
| Select variable with highest action. | |
| IntBoolVarBranch | INTBOOL_VAR_CHB_MAX (double d=1.0) |
| Select variable with largest CHB Q-score. | |
| IntBoolVarBranch | INTBOOL_VAR_CHB_MAX (IntCHB ic, BoolCHB bc) |
| Select variable with largest CHB Q-score. | |
| IntBoolVarBranch | INTBOOL_VAR_AFC_SIZE_MAX (double d=1.0) |
| Select variable with largest accumulated failure count divided by domain size. | |
| IntBoolVarBranch | INTBOOL_VAR_AFC_SIZE_MAX (IntAFC ia, BoolAFC ba) |
| Select variable with largest accumulated failure count divided by domain size. | |
| IntBoolVarBranch | INTBOOL_VAR_ACTION_SIZE_MAX (double d=1.0) |
| Select variable with largest action divided by domain size. | |
| IntBoolVarBranch | INTBOOL_VAR_ACTION_SIZE_MAX (IntAction ia, BoolAction ba) |
| Select variable with largest action divided by domain size. | |
| IntBoolVarBranch | INTBOOL_VAR_CHB_SIZE_MAX (double d=1.0) |
| Select variable with largest CHB Q-score divided by domain size. | |
| IntBoolVarBranch | INTBOOL_VAR_CHB_SIZE_MAX (IntCHB ic, BoolCHB bc) |
| Select variable with largest CHB Q-score divided by domain size. | |
| BoolValBranch | i2b (const IntValBranch &ivb) |
| Map respective integer value selection to Boolean value selection. | |
| Rnd | defrnd (0) |
| template<class Var> | |
| void | varValPrint (const Space &home, const Brancher &b, unsigned int a, Var, int i, const int &n, std::ostream &o) |
| void | varValPrintF (const Space &home, const Brancher &b, unsigned int a, FloatVar, int i, const FloatNumBranch &nl, std::ostream &o) |
| IntSet | vs2is (IntVarSpec *vs) |
| int | vs2bsl (BoolVarSpec *bs) |
| int | vs2bsh (BoolVarSpec *bs) |
| TieBreak< IntVarBranch > | ann2ivarsel (AST::Node *ann, Rnd rnd, double decay) |
| IntValBranch | ann2ivalsel (AST::Node *ann, std::string &r0, std::string &r1, Rnd rnd) |
| IntAssign | ann2asnivalsel (AST::Node *ann, Rnd rnd) |
| TieBreak< BoolVarBranch > | ann2bvarsel (AST::Node *ann, Rnd rnd, double decay) |
| BoolValBranch | ann2bvalsel (AST::Node *ann, std::string &r0, std::string &r1, Rnd rnd) |
| BoolAssign | ann2asnbvalsel (AST::Node *ann, Rnd rnd) |
| SetVarBranch | ann2svarsel (AST::Node *ann, Rnd rnd, double decay) |
| SetValBranch | ann2svalsel (AST::Node *ann, std::string r0, std::string r1, Rnd rnd) |
| TieBreak< FloatVarBranch > | ann2fvarsel (AST::Node *ann, Rnd rnd, double decay) |
| FloatValBranch | ann2fvalsel (AST::Node *ann, std::string r0, std::string r1) |
| void | flattenAnnotations (AST::Array *ann, std::vector< AST::Node * > &out) |
| void | printIntVar (std::ostream &os, const std::string name, const Int::IntView &x) |
| void | printBoolVar (std::ostream &os, const std::string name, const BoolVar &b) |
| void | printFloatVar (std::ostream &os, const std::string name, const Float::FloatView &f) |
| SymbolEntry | se_iv (int i) |
| Construct integer variable entry. | |
| SymbolEntry | se_bv (int i) |
| Construct Boolean variable entry. | |
| SymbolEntry | se_fv (int i) |
| Construct float variable entry. | |
| SymbolEntry | se_sv (int i) |
| Construct set variable entry. | |
| SymbolEntry | se_iva (int i) |
| Construct integer variable array entry. | |
| SymbolEntry | se_bva (int i) |
| Construct Boolean variable array entry. | |
| SymbolEntry | se_fva (int i) |
| Construct float variable array entry. | |
| SymbolEntry | se_sva (int i) |
| Construct set variable array entry. | |
| SymbolEntry | se_i (int i) |
| Construct integer entry. | |
| SymbolEntry | se_b (bool b) |
| Construct Boolean entry. | |
| SymbolEntry | se_s (int i) |
| Construct set entry. | |
| SymbolEntry | se_f (int i) |
| Construct float entry. | |
| SymbolEntry | se_ia (int i) |
| Construct integer array entry. | |
| SymbolEntry | se_ba (int i) |
| Construct Boolean array entry. | |
| SymbolEntry | se_sa (int i) |
| Construct set array entry. | |
| SymbolEntry | se_fa (int i) |
| Construct float array entry. | |
| Registry & | registry (void) |
| Return global registry object. | |
Variables | |
| GECODE_FLATZINC_EXPORT Rnd | defrnd |
| Uninitialized default random number generator. | |
Detailed Description
Interpreter for the FlatZinc language.
The Gecode::FlatZinc namespace contains all functionality required to parse and solve constraint models written in the FlatZinc language.
Typedef Documentation
◆ LastValInt
Definition at line 133 of file lastval.hh.
◆ LastValBool
Definition at line 144 of file lastval.hh.
◆ LastValFloat
Definition at line 156 of file lastval.hh.
◆ LastValSet
Definition at line 171 of file lastval.hh.
◆ intvartype
| typedef std::pair<std::string,Option<std::vector<int>* > > Gecode::FlatZinc::intvartype |
◆ varspec
| typedef std::pair<std::string, VarSpec*> Gecode::FlatZinc::varspec |
Enumeration Type Documentation
◆ SymbolType
Function Documentation
◆ parse() [1/2]
| GECODE_FLATZINC_EXPORT FlatZincSpace * Gecode::FlatZinc::parse | ( | const std::string & | fileName, |
| Printer & | p, | ||
| std::ostream & | err = std::cerr, | ||
| FlatZincSpace * | fzs = nullptr, | ||
| Rnd & | rnd = defrnd ) |
Parse FlatZinc file fileName into fzs and return it.
Creates a new empty FlatZincSpace if fzs is nullptr. The caller owns the returned space. On failure or exception, only a space created by the parser is deleted; a supplied space remains caller-owned. A supplied space may then be partially initialized and should be deleted rather than reused.
◆ parse() [2/2]
| GECODE_FLATZINC_EXPORT FlatZincSpace * Gecode::FlatZinc::parse | ( | std::istream & | is, |
| Printer & | p, | ||
| std::ostream & | err = std::cerr, | ||
| FlatZincSpace * | fzs = nullptr, | ||
| Rnd & | rnd = defrnd ) |
Parse FlatZinc from is into fzs and return it.
Creates a new empty FlatZincSpace if fzs is nullptr. The caller owns the returned space. On failure or exception, only a space created by the parser is deleted; a supplied space remains caller-owned. A supplied space may then be partially initialized and should be deleted rather than reused.
◆ encode_blackbox_request()
| GECODE_FLATZINC_EXPORT std::string Gecode::FlatZinc::encode_blackbox_request | ( | const BlackBoxCall & | call | ) |
Encode one request for the executable backend's line protocol.
Definition at line 467 of file blackbox-backend.cpp.
◆ decode_blackbox_response()
| GECODE_FLATZINC_EXPORT void Gecode::FlatZinc::decode_blackbox_response | ( | const std::string & | response, |
| BlackBoxCall & | call ) |
Decode and validate one response from the executable backend.
Definition at line 491 of file blackbox-backend.cpp.
◆ create_blackbox_process()
| BlackBoxProcessSession * Gecode::FlatZinc::create_blackbox_process | ( | const std::string & | , |
| const std::vector< std::string > & | ) |
Create the process implementation selected for the target platform.
Definition at line 16 of file blackbox-process-none.cpp.
◆ blackbox()
| void Gecode::FlatZinc::blackbox | ( | Home | home, |
| BlackBoxContextHandle & | context, | ||
| const IntVarArgs & | int_in, | ||
| const IntVarArgs & | int_out, | ||
| const FloatVarArgs & | float_in, | ||
| const FloatVarArgs & | float_out, | ||
| const std::string & | mode, | ||
| const std::string & | target, | ||
| const std::vector< std::string > & | args ) |
Definition at line 573 of file blackbox-propagator.cpp.
◆ blackbox_bounds()
| void Gecode::FlatZinc::blackbox_bounds | ( | Home | home, |
| BlackBoxContextHandle & | context, | ||
| const IntVarArgs & | ivar, | ||
| const FloatVarArgs & | fvar, | ||
| const std::string & | mode, | ||
| const std::string & | target, | ||
| const std::vector< std::string > & | args, | ||
| const std::vector< int > & | reason ) |
Definition at line 681 of file blackbox-propagator.cpp.
◆ branch()
| GECODE_FLATZINC_EXPORT void Gecode::FlatZinc::branch | ( | Home | home, |
| const IntVarArgs & | x, | ||
| const BoolVarArgs & | y, | ||
| IntBoolVarBranch | vars, | ||
| IntValBranch | vals ) |
Branch function for integer and Boolean variables.
Definition at line 120 of file branch.cpp.
◆ INTBOOL_VAR_AFC_MAX() [1/2]
|
inline |
Variable selection for both integer and Boolean variables.
Select variable with largest accumulated failure count
Definition at line 114 of file branch.hpp.
◆ INTBOOL_VAR_AFC_MAX() [2/2]
|
inline |
Select variable with largest accumulated failure count.
Definition at line 118 of file branch.hpp.
◆ INTBOOL_VAR_ACTION_MAX() [1/2]
|
inline |
Select variable with highest action.
Definition at line 122 of file branch.hpp.
◆ INTBOOL_VAR_ACTION_MAX() [2/2]
|
inline |
Select variable with highest action.
Definition at line 126 of file branch.hpp.
◆ INTBOOL_VAR_CHB_MAX() [1/2]
|
inline |
Select variable with largest CHB Q-score.
Definition at line 130 of file branch.hpp.
◆ INTBOOL_VAR_CHB_MAX() [2/2]
|
inline |
Select variable with largest CHB Q-score.
Definition at line 134 of file branch.hpp.
◆ INTBOOL_VAR_AFC_SIZE_MAX() [1/2]
|
inline |
Select variable with largest accumulated failure count divided by domain size.
Definition at line 138 of file branch.hpp.
◆ INTBOOL_VAR_AFC_SIZE_MAX() [2/2]
|
inline |
Select variable with largest accumulated failure count divided by domain size.
Definition at line 142 of file branch.hpp.
◆ INTBOOL_VAR_ACTION_SIZE_MAX() [1/2]
|
inline |
Select variable with largest action divided by domain size.
Definition at line 146 of file branch.hpp.
◆ INTBOOL_VAR_ACTION_SIZE_MAX() [2/2]
|
inline |
Select variable with largest action divided by domain size.
Definition at line 150 of file branch.hpp.
◆ INTBOOL_VAR_CHB_SIZE_MAX() [1/2]
|
inline |
Select variable with largest CHB Q-score divided by domain size.
Definition at line 154 of file branch.hpp.
◆ INTBOOL_VAR_CHB_SIZE_MAX() [2/2]
|
inline |
Select variable with largest CHB Q-score divided by domain size.
Definition at line 158 of file branch.hpp.
◆ i2b()
|
inline |
Map respective integer value selection to Boolean value selection.
Definition at line 421 of file branch.hpp.
◆ defrnd()
| Rnd Gecode::FlatZinc::defrnd | ( | 0 | ) |
◆ varValPrint()
| void Gecode::FlatZinc::varValPrint | ( | const Space & | home, |
| const Brancher & | b, | ||
| unsigned int | a, | ||
| Var | , | ||
| int | i, | ||
| const int & | n, | ||
| std::ostream & | o ) |
Definition at line 345 of file flatzinc.cpp.
◆ varValPrintF()
| void Gecode::FlatZinc::varValPrintF | ( | const Space & | home, |
| const Brancher & | b, | ||
| unsigned int | a, | ||
| FloatVar | , | ||
| int | i, | ||
| const FloatNumBranch & | nl, | ||
| std::ostream & | o ) |
Definition at line 353 of file flatzinc.cpp.
◆ vs2is()
| IntSet Gecode::FlatZinc::vs2is | ( | IntVarSpec * | vs | ) |
Definition at line 361 of file flatzinc.cpp.
◆ vs2bsl()
| int Gecode::FlatZinc::vs2bsl | ( | BoolVarSpec * | bs | ) |
Definition at line 381 of file flatzinc.cpp.
◆ vs2bsh()
| int Gecode::FlatZinc::vs2bsh | ( | BoolVarSpec * | bs | ) |
Definition at line 393 of file flatzinc.cpp.
◆ ann2ivarsel()
| TieBreak< IntVarBranch > Gecode::FlatZinc::ann2ivarsel | ( | AST::Node * | ann, |
| Rnd | rnd, | ||
| double | decay ) |
Definition at line 405 of file flatzinc.cpp.
◆ ann2ivalsel()
| IntValBranch Gecode::FlatZinc::ann2ivalsel | ( | AST::Node * | ann, |
| std::string & | r0, | ||
| std::string & | r1, | ||
| Rnd | rnd ) |
Definition at line 454 of file flatzinc.cpp.
◆ ann2asnivalsel()
Definition at line 505 of file flatzinc.cpp.
◆ ann2bvarsel()
| TieBreak< BoolVarBranch > Gecode::FlatZinc::ann2bvarsel | ( | AST::Node * | ann, |
| Rnd | rnd, | ||
| double | decay ) |
Definition at line 523 of file flatzinc.cpp.
◆ ann2bvalsel()
| BoolValBranch Gecode::FlatZinc::ann2bvalsel | ( | AST::Node * | ann, |
| std::string & | r0, | ||
| std::string & | r1, | ||
| Rnd | rnd ) |
Definition at line 557 of file flatzinc.cpp.
◆ ann2asnbvalsel()
| BoolAssign Gecode::FlatZinc::ann2asnbvalsel | ( | AST::Node * | ann, |
| Rnd | rnd ) |
Definition at line 608 of file flatzinc.cpp.
◆ ann2svarsel()
| SetVarBranch Gecode::FlatZinc::ann2svarsel | ( | AST::Node * | ann, |
| Rnd | rnd, | ||
| double | decay ) |
Definition at line 626 of file flatzinc.cpp.
◆ ann2svalsel()
| SetValBranch Gecode::FlatZinc::ann2svalsel | ( | AST::Node * | ann, |
| std::string | r0, | ||
| std::string | r1, | ||
| Rnd | rnd ) |
Definition at line 664 of file flatzinc.cpp.
◆ ann2fvarsel()
| TieBreak< FloatVarBranch > Gecode::FlatZinc::ann2fvarsel | ( | AST::Node * | ann, |
| Rnd | rnd, | ||
| double | decay ) |
Definition at line 694 of file flatzinc.cpp.
◆ ann2fvalsel()
| FloatValBranch Gecode::FlatZinc::ann2fvalsel | ( | AST::Node * | ann, |
| std::string | r0, | ||
| std::string | r1 ) |
Definition at line 738 of file flatzinc.cpp.
◆ flattenAnnotations()
| void Gecode::FlatZinc::flattenAnnotations | ( | AST::Array * | ann, |
| std::vector< AST::Node * > & | out ) |
Definition at line 1050 of file flatzinc.cpp.
◆ printIntVar()
| void Gecode::FlatZinc::printIntVar | ( | std::ostream & | os, |
| const std::string | name, | ||
| const Int::IntView & | x ) |
Definition at line 1816 of file flatzinc.cpp.
◆ printBoolVar()
| void Gecode::FlatZinc::printBoolVar | ( | std::ostream & | os, |
| const std::string | name, | ||
| const BoolVar & | b ) |
Definition at line 1835 of file flatzinc.cpp.
◆ printFloatVar()
| void Gecode::FlatZinc::printFloatVar | ( | std::ostream & | os, |
| const std::string | name, | ||
| const Float::FloatView & | f ) |
Definition at line 1842 of file flatzinc.cpp.
◆ se_iv()
|
inline |
◆ se_bv()
|
inline |
◆ se_fv()
|
inline |
◆ se_sv()
|
inline |
◆ se_iva()
|
inline |
◆ se_bva()
|
inline |
◆ se_fva()
|
inline |
◆ se_sva()
|
inline |
◆ se_i()
|
inline |
◆ se_b()
|
inline |
◆ se_s()
|
inline |
◆ se_f()
|
inline |
◆ se_ia()
|
inline |
◆ se_ba()
|
inline |
◆ se_sa()
|
inline |
◆ se_fa()
|
inline |
◆ registry()
| GECODE_FLATZINC_EXPORT Registry & Gecode::FlatZinc::registry | ( | void | ) |
Return global registry object.
Definition at line 51 of file registry.cpp.
Variable Documentation
◆ defrnd
| Rnd Gecode::FlatZinc::defrnd(0) |
Uninitialized default random number generator.
