void dependencies(Gecode::Space& home, MPG::CPRelVar installation, MPG::CPRelVar dependencies) { if (home.failed()) return; MPG::CPRel::CPRelView inst(installation); MPG::CPRel::CPRelView deps(dependencies); GECODE_ES_FAIL((Dependencies::post(home,inst,deps))); }
void exclude(Gecode::Space& home, CPRelVar A, GRelation r) { if (home.failed()) return; if (r.arity() != A.arity()) throw ArityMissmatch("Exclude constraint"); CPRelView a(A); auto me = a.exclude(home,r); if (me == Gecode::ES_FAILED) { home.fail(); } }
void projection(Gecode::Space& home, int p, CPRelVar A, CPRelVar B) { if (home.failed()) return; typedef boost::error_info<struct tag_proj_descriptor,std::string> proj_descriptor; if (p > A.arity()) throw InvalidProjection() << errno_code(errno) << proj_descriptor("Invalid projection description when posting projection constraint: p has to be valid for A"); CPRelView left(A); CPRelView right(B); GECODE_ES_FAIL((Project<CPRelView,CPRelView>::post(home,p,left,right))); }