bool.hh gecode/int.hh gecode/int/bool/base.hpp gecode/int/bool/eq.hpp gecode/int/bool/lq.hpp gecode/int/bool/or.hpp gecode/int/bool/eqv.hpp gecode/int/bool/clause.hpp gecode/int/bool/ite.hpp /usr/include/gecode/int/linear/bool-int.hpp /usr/include/gecode/int/nvalues/bool-eq.hpp /usr/include/gecode/int/nvalues/bool-lq.hpp Gecode::Int::Bool::BoolBinary Gecode::Int::Bool::BoolTernary Gecode::Int::Bool::Eq Gecode::Int::Bool::NaryEq Gecode::Int::Bool::Lq Gecode::Int::Bool::NaryLq Gecode::Int::Bool::Le Gecode::Int::Bool::BinOrTrue Gecode::Int::Bool::TerOrTrue Gecode::Int::Bool::QuadOrTrue Gecode::Int::Bool::Or Gecode::Int::Bool::NaryOr Gecode::Int::Bool::NaryOrTrue Gecode::Int::Bool::Eqv Gecode::Int::Bool::NaryEqv Gecode::Int::Bool::Clause Gecode::Int::Bool::Clause::Tagged Gecode::Int::Bool::ClauseTrue Gecode::Int::Bool::IteBase Gecode::Int::Bool::IteBnd Gecode::Int::Bool::IteDom Gecode::Int::Bool Gecode Gecode::Int /*-*-mode:C++;c-basic-offset:2;indent-tabs-mode:nil-*-*/ /* *Mainauthors: *ChristianSchulte<schulte@gecode.org> *GuidoTack<tack@gecode.org> * *Copyright: *ChristianSchulte,2002 *GuidoTack,2004 * *Lastmodified: *$Date:2013-04-1717:17:53+0200(Wed,17Apr2013)$by$Author:schulte$ *$Revision:13580$ * *ThisfileispartofGecode,thegenericconstraint *developmentenvironment: *http://www.gecode.org * *Permissionisherebygranted,freeofcharge,toanypersonobtaining *acopyofthissoftwareandassociateddocumentationfiles(the *"Software"),todealintheSoftwarewithoutrestriction,including *withoutlimitationtherightstouse,copy,modify,merge,publish, *distribute,sublicense,and/orsellcopiesoftheSoftware,andto *permitpersonstowhomtheSoftwareisfurnishedtodoso,subjectto *thefollowingconditions: * *Theabovecopyrightnoticeandthispermissionnoticeshallbe *includedinallcopiesorsubstantialportionsoftheSoftware. * *THESOFTWAREISPROVIDED"ASIS",WITHOUTWARRANTYOFANYKIND, *EXPRESSORIMPLIED,INCLUDINGBUTNOTLIMITEDTOTHEWARRANTIESOF *MERCHANTABILITY,FITNESSFORAPARTICULARPURPOSEAND *NONINFRINGEMENT.INNOEVENTSHALLTHEAUTHORSORCOPYRIGHTHOLDERSBE *LIABLEFORANYCLAIM,DAMAGESOROTHERLIABILITY,WHETHERINANACTION *OFCONTRACT,TORTOROTHERWISE,ARISINGFROM,OUTOFORINCONNECTION *WITHTHESOFTWAREORTHEUSEOROTHERDEALINGSINTHESOFTWARE. * */ #ifndef__GECODE_INT_BOOL_HH__ #define__GECODE_INT_BOOL_HH__ #include<gecode/int.hh> namespaceGecode{namespaceInt{namespaceBool{ /* *BaseClasses * */ template<classBVA,classBVB> classBoolBinary:publicPropagator{ protected: BVAx0; BVBx1; BoolBinary(Homehome,BVAb0,BVBb1); BoolBinary(Space&home,boolshare,BoolBinary&p); BoolBinary(Space&home,boolshare,Propagator&p, BVAb0,BVBb1); public: virtualPropCostcost(constSpace&home,constModEventDelta&med)const; virtualsize_tdispose(Space&home); }; template<classBVA,classBVB,classBVC> classBoolTernary:publicPropagator{ protected: BVAx0; BVBx1; BVCx2; BoolTernary(Homehome,BVAb0,BVBb1,BVCb2); BoolTernary(Space&home,boolshare,BoolTernary&p); public: BoolTernary(Space&home,boolshare,Propagator&p, BVAb0,BVBb1,BVCb2); virtualPropCostcost(constSpace&home,constModEventDelta&med)const; virtualsize_tdispose(Space&home); }; template<classBVA,classBVB> classEq:publicBoolBinary<BVA,BVB>{ protected: usingBoolBinary<BVA,BVB>::x0; usingBoolBinary<BVA,BVB>::x1; Eq(Homehome,BVAb0,BVBb1); Eq(Space&home,boolshare,Eq&p); public: Eq(Space&home,boolshare,Propagator&p, BVAb0,BVBb1); virtualActor*copy(Space&home,boolshare); virtualExecStatuspropagate(Space&home,constModEventDelta&med); staticExecStatuspost(Homehome,BVAx0,BVBx1); }; template<classBV> classNaryEq:publicNaryPropagator<BV,PC_BOOL_VAL>{ protected: usingNaryPropagator<BV,PC_BOOL_VAL>::x; NaryEq(Homehome,ViewArray<BV>&x); NaryEq(Space&home,boolshare,NaryEq&p); public: virtualActor*copy(Space&home,boolshare); virtualPropCostcost(constSpace&home,constModEventDelta&med)const; virtualExecStatuspropagate(Space&home,constModEventDelta&med); staticExecStatuspost(Homehome,ViewArray<BV>&x); }; template<classBV> classLq:publicBoolBinary<BV,BV>{ protected: usingBoolBinary<BV,BV>::x0; usingBoolBinary<BV,BV>::x1; Lq(Homehome,BVb0,BVb1); Lq(Space&home,boolshare,Lq&p); public: virtualActor*copy(Space&home,boolshare); virtualExecStatuspropagate(Space&home,constModEventDelta&med); staticExecStatuspost(Homehome,BVb0,BVb1); }; template<classVX> classNaryLq:publicNaryPropagator<VX,PC_BOOL_NONE>{ protected: usingNaryPropagator<VX,PC_BOOL_NONE>::x; boolrun; intn_zero; intn_one; Council<Advisor>c; NaryLq(Homehome,ViewArray<VX>&x); NaryLq(Space&home,boolshare,NaryLq<VX>&p); public: virtualActor*copy(Space&home,boolshare); virtualExecStatusadvise(Space&home,Advisor&a,constDelta&d); virtualPropCostcost(constSpace&home,constModEventDelta&med)const; virtualExecStatuspropagate(Space&home,constModEventDelta&med); staticExecStatuspost(Homehome,ViewArray<VX>&x); virtualsize_tdispose(Space&home); }; template<classBV> classLe{ public: staticExecStatuspost(Homehome,BVb0,BVb1); }; template<classBVA,classBVB> classBinOrTrue:publicBoolBinary<BVA,BVB>{ protected: usingBoolBinary<BVA,BVB>::x0; usingBoolBinary<BVA,BVB>::x1; BinOrTrue(Homehome,BVAb0,BVBb1); BinOrTrue(Space&home,boolshare,BinOrTrue&p); public: BinOrTrue(Space&home,boolshare,Propagator&p, BVAb0,BVBb1); virtualActor*copy(Space&home,boolshare); virtualExecStatuspropagate(Space&home,constModEventDelta&med); staticExecStatuspost(Homehome,BVAb0,BVBb1); }; template<classBV> classTerOrTrue:publicBoolBinary<BV,BV>{ protected: usingBoolBinary<BV,BV>::x0; usingBoolBinary<BV,BV>::x1; BVx2; TerOrTrue(Homehome,BVb0,BVb1,BVb2); TerOrTrue(Space&home,boolshare,TerOrTrue&p); public: TerOrTrue(Space&home,boolshare,Propagator&p, BVb0,BVb1,BVb2); virtualActor*copy(Space&home,boolshare); virtualExecStatuspropagate(Space&home,constModEventDelta&med); staticExecStatuspost(Homehome,BVb0,BVb1,BVb2); virtualsize_tdispose(Space&home); }; template<classBV> classQuadOrTrue:publicBoolBinary<BV,BV>{ protected: usingBoolBinary<BV,BV>::x0; usingBoolBinary<BV,BV>::x1; BVx2; BVx3; QuadOrTrue(Homehome,BVb0,BVb1,BVb2,BVb3); QuadOrTrue(Space&home,boolshare,QuadOrTrue&p); public: QuadOrTrue(Space&home,boolshare,Propagator&p, BVb0,BVb1,BVb2,BVb3); virtualActor*copy(Space&home,boolshare); virtualExecStatuspropagate(Space&home,constModEventDelta&med); staticExecStatuspost(Homehome,BVb0,BVb1,BVb2,BVb3); virtualsize_tdispose(Space&home); }; template<classBVA,classBVB,classBVC> classOr:publicBoolTernary<BVA,BVB,BVC>{ protected: usingBoolTernary<BVA,BVB,BVC>::x0; usingBoolTernary<BVA,BVB,BVC>::x1; usingBoolTernary<BVA,BVB,BVC>::x2; Or(Homehome,BVAb0,BVBb1,BVCb2); Or(Space&home,boolshare,Or&p); public: Or(Space&home,boolshare,Propagator&p,BVAb0,BVBb1,BVCb2); virtualActor*copy(Space&home,boolshare); virtualExecStatuspropagate(Space&home,constModEventDelta&med); staticExecStatuspost(Homehome,BVAb0,BVBb1,BVCb2); }; template<classVX,classVY> classNaryOr :publicMixNaryOnePropagator<VX,PC_BOOL_NONE,VY,PC_BOOL_VAL>{ protected: usingMixNaryOnePropagator<VX,PC_BOOL_NONE,VY,PC_BOOL_VAL>::x; usingMixNaryOnePropagator<VX,PC_BOOL_NONE,VY,PC_BOOL_VAL>::y; intn_zero; Council<Advisor>c; NaryOr(Homehome,ViewArray<VX>&x,VYy); NaryOr(Space&home,boolshare,NaryOr<VX,VY>&p); public: virtualActor*copy(Space&home,boolshare); virtualExecStatusadvise(Space&home,Advisor&a,constDelta&d); virtualPropCostcost(constSpace&home,constModEventDelta&med)const; virtualExecStatuspropagate(Space&home,constModEventDelta&med); staticExecStatuspost(Homehome,ViewArray<VX>&x,VYy); virtualsize_tdispose(Space&home); }; template<classBV> classNaryOrTrue:publicBinaryPropagator<BV,PC_BOOL_VAL>{ protected: usingBinaryPropagator<BV,PC_BOOL_VAL>::x0; usingBinaryPropagator<BV,PC_BOOL_VAL>::x1; ViewArray<BV>x; ExecStatusresubscribe(Space&home,BV&x0,BVx1); NaryOrTrue(Homehome,ViewArray<BV>&x); NaryOrTrue(Space&home,boolshare,NaryOrTrue<BV>&p); public: virtualActor*copy(Space&home,boolshare); virtualPropCostcost(constSpace&home,constModEventDelta&med)const; virtualExecStatuspropagate(Space&home,constModEventDelta&med); staticExecStatuspost(Homehome,ViewArray<BV>&b); virtualsize_tdispose(Space&home); }; template<classBVA,classBVB,classBVC> classEqv:publicBoolTernary<BVA,BVB,BVC>{ protected: usingBoolTernary<BVA,BVB,BVC>::x0; usingBoolTernary<BVA,BVB,BVC>::x1; usingBoolTernary<BVA,BVB,BVC>::x2; Eqv(Space&home,boolshare,Eqv&p); Eqv(Homehome,BVAb0,BVBb1,BVCb2); public: virtualActor*copy(Space&home,boolshare); virtualExecStatuspropagate(Space&home,constModEventDelta&med); staticExecStatuspost(Homehome,BVAb0,BVBb1,BVCb2); }; classNaryEqv:publicBinaryPropagator<BoolView,PC_BOOL_VAL>{ protected: usingBinaryPropagator<BoolView,PC_BOOL_VAL>::x0; usingBinaryPropagator<BoolView,PC_BOOL_VAL>::x1; ViewArray<BoolView>x; intpm2; voidresubscribe(Space&home,BoolView&x0); NaryEqv(Homehome,ViewArray<BoolView>&x,intpm2); NaryEqv(Space&home,boolshare,NaryEqv&p); public: GECODE_INT_EXPORT virtualActor*copy(Space&home,boolshare); GECODE_INT_EXPORT virtualPropCostcost(constSpace&home,constModEventDelta&med)const; GECODE_INT_EXPORT virtualExecStatuspropagate(Space&home,constModEventDelta&med); GECODE_INT_EXPORT staticExecStatuspost(Homehome,ViewArray<BoolView>&x,intpm2); virtualsize_tdispose(Space&home); }; template<classVX,classVY> classClause:publicPropagator{ protected: ViewArray<VX>x; ViewArray<VY>y; VXz; intn_zero; classTagged:publicAdvisor{ public: constboolx; Tagged(Space&home,Propagator&p,Council<Tagged>&c,boolx); Tagged(Space&home,boolshare,Tagged&a); }; Council<Tagged>c; voidcancel(Space&home); Clause(Homehome,ViewArray<VX>&x,ViewArray<VY>&y,VXz); Clause(Space&home,boolshare,Clause<VX,VY>&p); public: virtualActor*copy(Space&home,boolshare); virtualExecStatusadvise(Space&home,Advisor&a,constDelta&d); virtualPropCostcost(constSpace&home,constModEventDelta&med)const; virtualExecStatuspropagate(Space&home,constModEventDelta&med); staticExecStatuspost(Homehome,ViewArray<VX>&x,ViewArray<VY>&y, VXz); virtualsize_tdispose(Space&home); }; template<classVX,classVY> classClauseTrue :publicMixBinaryPropagator<VX,PC_BOOL_VAL,VY,PC_BOOL_VAL>{ protected: usingMixBinaryPropagator<VX,PC_BOOL_VAL,VY,PC_BOOL_VAL>::x0; usingMixBinaryPropagator<VX,PC_BOOL_VAL,VY,PC_BOOL_VAL>::x1; ViewArray<VX>x; ViewArray<VY>y; ClauseTrue(Homehome,ViewArray<VX>&x,ViewArray<VY>&y); ClauseTrue(Space&home,boolshare,ClauseTrue<VX,VY>&p); public: virtualActor*copy(Space&home,boolshare); virtualPropCostcost(constSpace&home,constModEventDelta&med)const; virtualExecStatuspropagate(Space&home,constModEventDelta&med); staticExecStatuspost(Homehome,ViewArray<VX>&x,ViewArray<VY>&y); virtualsize_tdispose(Space&home); }; template<classView,PropCondpc> classIteBase:publicPropagator{ protected: BoolViewb; Viewx0,x1,x2; IteBase(Space&home,boolshare,IteBase&p); IteBase(Homehome,BoolViewb,Viewx0,Viewx1,Viewx2); public: virtualPropCostcost(constSpace&home,constModEventDelta&med)const; virtualsize_tdispose(Space&home); }; template<classView> classIteBnd:publicIteBase<View,PC_INT_BND>{ protected: usingIteBase<View,PC_INT_BND>::b; usingIteBase<View,PC_INT_BND>::x0; usingIteBase<View,PC_INT_BND>::x1; usingIteBase<View,PC_INT_BND>::x2; IteBnd(Space&home,boolshare,IteBnd&p); IteBnd(Homehome,BoolViewb,Viewx0,Viewx1,Viewx2); public: virtualActor*copy(Space&home,boolshare); virtualExecStatuspropagate(Space&home,constModEventDelta&med); staticExecStatuspost(Homehome,BoolViewb,Viewx0,Viewx1,Viewx2); }; template<classView> classIteDom:publicIteBase<View,PC_INT_DOM>{ protected: usingIteBase<View,PC_INT_DOM>::b; usingIteBase<View,PC_INT_DOM>::x0; usingIteBase<View,PC_INT_DOM>::x1; usingIteBase<View,PC_INT_DOM>::x2; IteDom(Space&home,boolshare,IteDom&p); IteDom(Homehome,BoolViewb,Viewx0,Viewx1,Viewx2); public: virtualActor*copy(Space&home,boolshare); virtualPropCostcost(constSpace&home,constModEventDelta&med)const; virtualExecStatuspropagate(Space&home,constModEventDelta&med); staticExecStatuspost(Homehome,BoolViewb,Viewx0,Viewx1,Viewx2); }; }}} #include<gecode/int/bool/base.hpp> #include<gecode/int/bool/eq.hpp> #include<gecode/int/bool/lq.hpp> #include<gecode/int/bool/or.hpp> #include<gecode/int/bool/eqv.hpp> #include<gecode/int/bool/clause.hpp> #include<gecode/int/bool/ite.hpp> #endif //STATISTICS:int-prop