Generated on Sat Jan 20 2018 22:21:11 for Gecode by doxygen 1.8.13
bool.cpp
Go to the documentation of this file.
1 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2 /*
3  * Main authors:
4  * Christian Schulte <schulte@gecode.org>
5  *
6  * Copyright:
7  * Christian Schulte, 2005
8  *
9  * Last modified:
10  * $Date: 2016-12-02 13:20:09 +0100 (Fri, 02 Dec 2016) $ by $Author: schulte $
11  * $Revision: 15304 $
12  *
13  * This file is part of Gecode, the generic constraint
14  * development environment:
15  * http://www.gecode.org
16  *
17  * Permission is hereby granted, free of charge, to any person obtaining
18  * a copy of this software and associated documentation files (the
19  * "Software"), to deal in the Software without restriction, including
20  * without limitation the rights to use, copy, modify, merge, publish,
21  * distribute, sublicense, and/or sell copies of the Software, and to
22  * permit persons to whom the Software is furnished to do so, subject to
23  * the following conditions:
24  *
25  * The above copyright notice and this permission notice shall be
26  * included in all copies or substantial portions of the Software.
27  *
28  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
30  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
32  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
33  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
34  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35  *
36  */
37 
38 #include "test/int.hh"
39 
40 #include <gecode/minimodel.hh>
41 
42 namespace Test { namespace Int {
43 
45  namespace Bool {
46 
47  inline int
48  check(int x0, Gecode::BoolOpType op, int x1) {
49  switch (op) {
50  case Gecode::BOT_AND: return x0 & x1;
51  case Gecode::BOT_OR: return x0 | x1;
52  case Gecode::BOT_IMP: return !x0 | x1;
53  case Gecode::BOT_EQV: return x0 == x1;
54  case Gecode::BOT_XOR: return x0 != x1;
55  default: GECODE_NEVER;
56  }
58  return 0;
59  }
60 
66  class BinXYZ : public Test {
68  protected:
71  public:
74  : Test("Bool::Bin::XYZ::"+str(op0),3,0,1), op(op0) {}
76  virtual bool solution(const Assignment& x) const {
77  return check(x[0],op,x[1]) == x[2];
78  }
80  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
81  using namespace Gecode;
82  rel(home,
83  channel(home,x[0]), op, channel(home,x[1]),
84  channel(home,x[2]));
85  }
86  };
87 
89  class BinXXY : public Test {
90  protected:
93  public:
96  : Test("Bool::Bin::XXY::"+str(op0),2,0,1), op(op0) {}
98  virtual bool solution(const Assignment& x) const {
99  return check(x[0],op,x[0]) == x[1];
100  }
102  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
103  using namespace Gecode;
104  BoolVar b = channel(home,x[0]);
105  rel(home, b, op, b, channel(home,x[1]));
106  }
107  };
108 
110  class BinXYX : public Test {
111  protected:
114  public:
117  : Test("Bool::Bin::XYX::"+str(op0),2,0,1), op(op0) {}
119  virtual bool solution(const Assignment& x) const {
120  return check(x[0],op,x[1]) == x[0];
121  }
123  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
124  using namespace Gecode;
125  BoolVar b = channel(home,x[0]);
126  rel(home, b, op, channel(home,x[1]), b);
127  }
128  };
129 
131  class BinXYY : public Test {
132  protected:
135  public:
138  : Test("Bool::Bin::XYY::"+str(op0),2,0,1), op(op0) {}
140  virtual bool solution(const Assignment& x) const {
141  return check(x[0],op,x[1]) == x[1];
142  }
144  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
145  using namespace Gecode;
146  BoolVar b = channel(home,x[1]);
147  rel(home, channel(home,x[0]), op, b, b);
148  }
149  };
150 
152  class BinXXX : public Test {
153  protected:
156  public:
159  : Test("Bool::Bin::XXX::"+str(op0),1,0,1), op(op0) {}
161  virtual bool solution(const Assignment& x) const {
162  return check(x[0],op,x[0]) == x[0];
163  }
165  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
166  using namespace Gecode;
167  BoolVar b = channel(home,x[0]);
168  rel(home, b, op, b, b);
169  }
170  };
171 
173  class BinConstXY : public Test {
174  protected:
178  int c;
179  public:
182  : Test("Bool::Bin::XY::"+str(op0)+"::"+str(c0),2,0,1),
183  op(op0), c(c0) {}
185  virtual bool solution(const Assignment& x) const {
186  return check(x[0],op,x[1]) == c;
187  }
189  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
190  using namespace Gecode;
191  rel(home, channel(home,x[0]), op, channel(home,x[1]), c);
192  }
193  };
194 
196  class BinConstXX : public Test {
197  protected:
201  int c;
202  public:
205  : Test("Bool::Bin::XX::"+str(op0)+"::"+str(c0),1,0,1),
206  op(op0), c(c0) {}
208  virtual bool solution(const Assignment& x) const {
209  return check(x[0],op,x[0]) == c;
210  }
212  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
213  using namespace Gecode;
214  BoolVar b = channel(home,x[0]);
215  rel(home, b, op, b, c);
216  }
217  };
218 
220  class Nary : public Test {
221  protected:
224  public:
227  : Test("Bool::Nary::"+str(op0)+"::"+str(n),n+1,0,1), op(op0) {}
229  virtual bool solution(const Assignment& x) const {
230  int n = x.size()-1;
231  int b = check(x[n-2],op,x[n-1]);
232  for (int i=0; i<n-2; i++)
233  b = check(x[i],op,b);
234  return b == x[n];
235  }
237  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
238  using namespace Gecode;
239  BoolVarArgs b(x.size()-1);
240  for (int i=x.size()-1; i--; )
241  b[i]=channel(home,x[i]);
242  rel(home, op, b, channel(home,x[x.size()-1]));
243  }
244  };
245 
247  class NaryShared : public Test {
248  protected:
251  public:
254  : Test("Bool::Nary::Shared::"+str(op0)+"::"+str(n),n,0,1),
255  op(op0) {
256  if ((op == Gecode::BOT_EQV) || (op == Gecode::BOT_XOR))
257  testfix = false;
258  }
260  virtual bool solution(const Assignment& x) const {
261  int n = x.size();
262  int b = check(x[n-2],op,x[n-1]);
263  for (int i=0; i<n-2; i++)
264  b = check(x[i],op,b);
265  return b == x[n-1];
266  }
268  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
269  using namespace Gecode;
270  BoolVarArgs b(x.size());
271  for (int i=x.size(); i--; )
272  b[i]=channel(home,x[i]);
273  rel(home, op, b, b[x.size()-1]);
274  }
275  };
276 
278  class NaryConst : public Test {
279  protected:
283  int c;
284  public:
286  NaryConst(Gecode::BoolOpType op0, int n, int c0)
287  : Test("Bool::Nary::"+str(op0)+"::"+str(n)+"::"+str(c0),n,0,1),
288  op(op0), c(c0) {}
290  virtual bool solution(const Assignment& x) const {
291  int n = x.size();
292  int b = check(x[n-2],op,x[n-1]);
293  for (int i=0; i<n-2; i++)
294  b = check(x[i],op,b);
295  return b == c;
296  }
298  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
299  using namespace Gecode;
300  BoolVarArgs b(x.size());
301  for (int i=x.size(); i--; )
302  b[i]=channel(home,x[i]);
303  rel(home, op, b, c);
304  }
305  };
306 
307 
309  class ClauseXYZ : public Test {
310  protected:
313  public:
316  : Test("Bool::Clause::XYZ::"+str(op0)+"::"+str(n),n+1,0,1), op(op0) {}
318  virtual bool solution(const Assignment& x) const {
319  int n = (x.size()-1) / 2;
320  int b;
321  if (n == 1) {
322  b = check(x[0],op,!x[1]);
323  } else {
324  b = check(x[0],op,!x[n]);
325  for (int i=1; i<n; i++)
326  b = check(b,op,check(x[i],op,!x[n+i]));
327  }
328  return b == x[x.size()-1];
329  }
331  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
332  using namespace Gecode;
333  int n = (x.size()-1) / 2;
334  BoolVarArgs a(n), b(n);
335  for (int i=n; i--; ) {
336  a[i]=channel(home,x[i]);
337  b[i]=channel(home,x[i+n]);
338  }
339  clause(home, op, a, b, channel(home,x[x.size()-1]));
340  }
341  };
342 
344  class ClauseXXYYX : public Test {
345  protected:
348  public:
351  : Test("Bool::Clause::XXYYX::"+str(op0)+"::"+str(n),n,0,1),
352  op(op0) {}
354  virtual bool solution(const Assignment& x) const {
355  int n = x.size() / 2;
356  int b;
357  if (n == 1) {
358  b = check(x[0],op,!x[1]);
359  } else {
360  b = check(x[0],op,!x[n]);
361  for (int i=1; i<n; i++)
362  b = check(b,op,check(x[i],op,!x[n+i]));
363  }
364  return b == x[0];
365  }
367  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
368  using namespace Gecode;
369  int n = x.size() / 2;
370  BoolVarArgs a(2*n), b(2*n);
371  for (int i=n; i--; ) {
372  a[i]=a[i+n]=channel(home,x[i]);
373  b[i]=b[i+n]=channel(home,x[i+n]);
374  }
375  clause(home, op, a, b, a[0]);
376  }
377  };
378 
380  class ClauseXXY : public Test {
381  protected:
384  public:
387  : Test("Bool::Clause::XXY::"+str(op0)+"::"+str(n),n,0,1),
388  op(op0) {}
390  virtual bool solution(const Assignment& x) const {
391  return (x[0] == 1) == (op == Gecode::BOT_OR);
392  }
394  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
395  using namespace Gecode;
396  int n = x.size() / 2;
397  BoolVarArgs a(2*n), b(2*n);
398  for (int i=n; i--; ) {
399  a[i]=b[i+n]=channel(home,x[i]);
400  b[i]=a[i+n]=channel(home,x[i+n]);
401  }
402  clause(home, op, a, b, a[0]);
403  }
404  };
405 
407  class ClauseConst : public Test {
408  protected:
412  int c;
413  public:
415  ClauseConst(Gecode::BoolOpType op0, int n, int c0)
416  : Test("Bool::Clause::"+str(op0)+"::"+str(n)+"::"+str(c0),n,0,1),
417  op(op0), c(c0) {}
419  virtual bool solution(const Assignment& x) const {
420  int n = x.size() / 2;
421  int b;
422  if (n == 1) {
423  b = check(x[0],op,!x[1]);
424  } else {
425  b = check(x[0],op,!x[n]);
426  for (int i=1; i<n; i++)
427  b = check(b,op,check(x[i],op,!x[n+i]));
428  }
429  return b == c;
430  }
432  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
433  using namespace Gecode;
434  int n = x.size() / 2;
435  BoolVarArgs a(n), b(n);
436  for (int i=n; i--; ) {
437  a[i]=channel(home,x[i]);
438  b[i]=channel(home,x[i+n]);
439  }
440  clause(home, op, a, b, c);
441  }
442  };
443 
445  class ITEInt : public Test {
446  public:
449  : Test("ITE::Int::"+str(ipl),4,-4,4,false,ipl) {}
451  virtual bool solution(const Assignment& x) const {
452  if ((x[0] < 0) || (x[0] > 1))
453  return false;
454  if (x[0] == 1)
455  return x[1] == x[3];
456  else
457  return x[2] == x[3];
458  }
460  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
461  using namespace Gecode;
462  if (Base::rand(2) != 0)
463  ite(home,channel(home,x[0]),x[1],x[2],x[3]);
464  else
465  rel(home, ite(channel(home,x[0]),x[1],x[2]) == x[3]);
466  }
467  };
468 
470  class ITEBool : public Test {
471  public:
473  ITEBool(void)
474  : Test("ITE::Bool",4,0,1,false) {}
476  virtual bool solution(const Assignment& x) const {
477  if (x[0] == 1)
478  return x[1] == x[3];
479  else
480  return x[2] == x[3];
481  }
483  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
484  using namespace Gecode;
485  ite(home,channel(home,x[0]),channel(home,x[1]),
486  channel(home,x[2]),channel(home,x[3]));
487  }
488  };
489 
491  class Create {
492  public:
494  Create(void) {
495  using namespace Gecode;
496  for (BoolOpTypes bots; bots(); ++bots) {
497  (void) new BinXYZ(bots.bot());
498  (void) new BinXXY(bots.bot());
499  (void) new BinXYX(bots.bot());
500  (void) new BinXYY(bots.bot());
501  (void) new BinXXX(bots.bot());
502  (void) new BinConstXY(bots.bot(),0);
503  (void) new BinConstXY(bots.bot(),1);
504  (void) new BinConstXX(bots.bot(),0);
505  (void) new BinConstXX(bots.bot(),1);
506  (void) new Nary(bots.bot(),2);
507  (void) new Nary(bots.bot(),6);
508  (void) new Nary(bots.bot(),10);
509  (void) new NaryShared(bots.bot(),2);
510  (void) new NaryShared(bots.bot(),6);
511  (void) new NaryShared(bots.bot(),10);
512  (void) new NaryConst(bots.bot(),2,0);
513  (void) new NaryConst(bots.bot(),6,0);
514  (void) new NaryConst(bots.bot(),10,0);
515  (void) new NaryConst(bots.bot(),2,1);
516  (void) new NaryConst(bots.bot(),6,1);
517  (void) new NaryConst(bots.bot(),10,1);
518  if ((bots.bot() == BOT_AND) || (bots.bot() == BOT_OR)) {
519  (void) new ClauseXYZ(bots.bot(),2);
520  (void) new ClauseXYZ(bots.bot(),6);
521  (void) new ClauseXYZ(bots.bot(),10);
522  (void) new ClauseXXYYX(bots.bot(),2);
523  (void) new ClauseXXYYX(bots.bot(),6);
524  (void) new ClauseXXYYX(bots.bot(),10);
525  (void) new ClauseXXY(bots.bot(),2);
526  (void) new ClauseXXY(bots.bot(),6);
527  (void) new ClauseXXY(bots.bot(),10);
528  (void) new ClauseConst(bots.bot(),2,0);
529  (void) new ClauseConst(bots.bot(),6,0);
530  (void) new ClauseConst(bots.bot(),10,0);
531  (void) new ClauseConst(bots.bot(),2,1);
532  (void) new ClauseConst(bots.bot(),6,1);
533  (void) new ClauseConst(bots.bot(),10,1);
534  }
535  }
536  }
537  };
538 
543 
545 
546  }
547 }}
548 
549 // STATISTICS: test-int
550 
Bounds propagation.
Definition: int.hh:959
BinConstXY(Gecode::BoolOpType op0, int c0)
Construct and register test.
Definition: bool.cpp:181
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition: bool.cpp:483
Test for Clause Boolean operation
Definition: bool.cpp:380
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition: bool.cpp:80
Gecode::BoolOpType op
Boolean operation type for test.
Definition: bool.cpp:223
int check(int x0, Gecode::BoolOpType op, int x1)
Definition: bool.cpp:48
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition: bool.cpp:165
Post propagator for SetVar SetOpType op
Definition: set.hh:784
static std::string str(Gecode::IntPropLevel ipl)
Map integer propagation level to string.
Definition: int.hpp:212
Gecode::BoolOpType op
Boolean operation type for test.
Definition: bool.cpp:410
ITEInt itebnd(Gecode::IPL_BND)
void ite(Home home, BoolVar b, SetVar x, SetVar y, SetVar z)
Post propagator for if-then-else constraint.
Definition: bool.cpp:43
BinConstXX(Gecode::BoolOpType op0, int c0)
Construct and register test.
Definition: bool.cpp:204
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition: bool.cpp:318
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
Definition: channel.cpp:45
int size(void) const
Return size of array (number of elements)
Definition: array.hpp:985
int size(void) const
Return number of variables.
Definition: int.hpp:50
Test for binary Boolean operation with shared variables
Definition: bool.cpp:89
Test for binary Boolean operation with shared variables
Definition: bool.cpp:110
static Gecode::Support::RandomGenerator rand
Random number generator.
Definition: test.hh:138
Test for Nary Boolean operation with constant
Definition: bool.cpp:278
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition: bool.cpp:208
BoolOpType
Operation types for Booleans.
Definition: int.hh:931
Nary(Gecode::BoolOpType op0, int n)
Construct and register test.
Definition: bool.cpp:226
BinXYX(Gecode::BoolOpType op0)
Construct and register test.
Definition: bool.cpp:116
void rel(Home home, BoolOpType o, const BoolVarArgs &x, int n, IntPropLevel)
Post domain consistent propagator for Boolean operation on x.
Definition: bool.cpp:841
Test for Clause Boolean operation
Definition: bool.cpp:344
Conjunction.
Definition: int.hh:932
Test for binary Boolean operation with constant
Definition: bool.cpp:173
int c
Integer constant.
Definition: bool.cpp:178
Test for Nary Boolean operation
Definition: bool.cpp:220
Implication.
Definition: int.hh:934
Create(void)
Perform creation and registration.
Definition: bool.cpp:494
Integer variable array.
Definition: int.hh:744
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition: bool.cpp:119
Gecode::BoolOpType op
Boolean operation type for test.
Definition: bool.cpp:176
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition: bool.cpp:237
NaryShared(Gecode::BoolOpType op0, int n)
Construct and register test.
Definition: bool.cpp:253
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition: bool.cpp:390
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition: bool.cpp:98
Computation spaces.
Definition: core.hpp:1748
Exclusive or.
Definition: int.hh:936
NaryConst(Gecode::BoolOpType op0, int n, int c0)
Construct and register test.
Definition: bool.cpp:286
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition: bool.cpp:212
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition: bool.cpp:460
Gecode::BoolOpType op
Boolean operation type for test.
Definition: bool.cpp:199
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition: bool.cpp:123
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition: bool.cpp:161
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
ClauseConst(Gecode::BoolOpType op0, int n, int c0)
Construct and register test.
Definition: bool.cpp:415
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:238
Test for binary Boolean operation with shared variables
Definition: bool.cpp:131
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
Gecode::BoolOpType op
Boolean operation type for test.
Definition: bool.cpp:134
BinXYZ(Gecode::BoolOpType op0)
Construct and register test.
Definition: bool.cpp:73
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition: bool.cpp:451
ITEInt(Gecode::IntPropLevel ipl)
Construct and register test.
Definition: bool.cpp:448
Gecode::BoolOpType op
Boolean operation type for test.
Definition: bool.cpp:383
ITEBool itebool
Definition: bool.cpp:542
ITEInt itedom(Gecode::IPL_DOM)
int c
Integer constant.
Definition: bool.cpp:412
BinXYY(Gecode::BoolOpType op0)
Construct and register test.
Definition: bool.cpp:137
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition: bool.cpp:144
int c
Integer constant.
Definition: bool.cpp:283
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition: bool.cpp:394
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition: bool.cpp:331
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition: bool.cpp:367
Test for Nary Boolean operation
Definition: bool.cpp:247
Disjunction.
Definition: int.hh:933
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition: bool.cpp:419
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition: bool.cpp:298
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition: bool.cpp:354
Gecode::IntPropLevel ipl
Propagation level.
Definition: int.hh:238
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition: bool.cpp:290
Passing Boolean variables.
Definition: int.hh:693
Test for if-then-else-constraint
Definition: bool.cpp:445
Gecode::BoolOpType op
Boolean operation type for test.
Definition: bool.cpp:155
Gecode::BoolOpType op
Boolean operation type for test.
Definition: bool.cpp:92
Boolean integer variables.
Definition: int.hh:494
bool testfix
Whether to perform fixpoint test.
Definition: int.hh:244
General test support.
Definition: afc.cpp:43
IntPropLevel
Propagation levels for integer propagators.
Definition: int.hh:955
Gecode::BoolOpType op
Boolean operation type for test.
Definition: bool.cpp:347
BinXXY(Gecode::BoolOpType op0)
Construct and register test.
Definition: bool.cpp:95
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition: bool.cpp:432
Test for Clause Boolean operation
Definition: bool.cpp:309
Node * x
Pointer to corresponding Boolean expression node.
Definition: bool-expr.cpp:253
Test for binary Boolean operation
Definition: bool.cpp:67
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition: bool.cpp:260
ClauseXYZ(Gecode::BoolOpType op0, int n)
Construct and register test.
Definition: bool.cpp:315
Base class for assignments
Definition: int.hh:63
ITEBool(void)
Construct and register test.
Definition: bool.cpp:473
Domain propagation Preferences: prefer speed or memory.
Definition: int.hh:960
Test for Clause Boolean operation with constant
Definition: bool.cpp:407
Equivalence.
Definition: int.hh:935
Help class to create and register tests.
Definition: bool.cpp:491
Test for binary Boolean operation with shared variables
Definition: bool.cpp:152
Gecode::BoolOpType op
Boolean operation type for test.
Definition: bool.cpp:113
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition: bool.cpp:185
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition: bool.cpp:229
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition: bool.cpp:268
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition: bool.cpp:102
BinXXX(Gecode::BoolOpType op0)
Construct and register test.
Definition: bool.cpp:158
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition: bool.cpp:140
Test for binary Boolean operation with shared variables and constant
Definition: bool.cpp:196
Iterator for Boolean operation types.
Definition: int.hh:390
Gecode toplevel namespace
ClauseXXY(Gecode::BoolOpType op0, int n)
Construct and register test.
Definition: bool.cpp:386
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint.
Definition: bool.cpp:189
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition: bool.cpp:76
ClauseXXYYX(Gecode::BoolOpType op0, int n)
Construct and register test.
Definition: bool.cpp:350
Gecode::BoolOpType op
Boolean operation type for test.
Definition: bool.cpp:312
Gecode::BoolOpType op
Boolean operation type for test.
Definition: bool.cpp:70
Test for if-then-else-constraint
Definition: bool.cpp:470
Gecode::BoolOpType op
Boolean operation type for test.
Definition: bool.cpp:281
int c
Integer constant.
Definition: bool.cpp:201
#define GECODE_NEVER
Assert that this command is never executed.
Definition: macros.hpp:60
Gecode::BoolOpType op
Boolean operation type for test.
Definition: bool.cpp:250
Create c
Definition: bool.cpp:539
virtual bool solution(const Assignment &x) const
Check whether x is solution.
Definition: bool.cpp:476
void clause(Home home, BoolOpType o, const BoolVarArgs &x, const BoolVarArgs &y, BoolVar z, IntPropLevel)
Post domain consistent propagator for Boolean clause with positive variables x and negative variables...
Definition: bool.cpp:961