| 37 | namespace Gecode { |
| 38 | |
| 39 | void |
| 40 | rel(Home home, BoolVar x0, IntRelType irt, BoolVar x1, IntPropLevel) { |
| 41 | using namespace Int; |
| 42 | GECODE_POST; |
| 43 | switch (irt) { |
| 44 | case IRT_EQ: |
| 45 | GECODE_ES_FAIL((Bool::Eq<BoolView,BoolView> |
| 46 | ::post(home,x0,x1))); |
| 47 | break; |
| 48 | case IRT_NQ: |
| 49 | { |
| 50 | NegBoolView n1(x1); |
| 51 | GECODE_ES_FAIL((Bool::Eq<BoolView,NegBoolView> |
| 52 | ::post(home,x0,n1))); |
| 53 | } |
| 54 | break; |
| 55 | case IRT_GQ: |
| 56 | GECODE_ES_FAIL(Bool::Lq<BoolView>::post(home,x1,x0)); |
| 57 | break; |
| 58 | case IRT_LQ: |
| 59 | GECODE_ES_FAIL(Bool::Lq<BoolView>::post(home,x0,x1)); |
| 60 | break; |
| 61 | case IRT_GR: |
| 62 | GECODE_ES_FAIL(Bool::Le<BoolView>::post(home,x1,x0)); |
| 63 | break; |
| 64 | case IRT_LE: |
| 65 | GECODE_ES_FAIL(Bool::Le<BoolView>::post(home,x0,x1)); |
| 66 | break; |
| 67 | default: |
| 68 | throw UnknownRelation("Int::rel"); |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | void |
| 73 | rel(Home home, BoolVar x0, IntRelType irt, int n, IntPropLevel) { |