Generated on Thu Mar 16 2017 03:24:18 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, 2002
8  *
9  * Last modified:
10  * $Date: 2016-06-17 15:43:08 +0200 (Fri, 17 Jun 2016) $ by $Author: schulte $
11  * $Revision: 15116 $
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 <gecode/int/bool.hh>
39 #include <gecode/int/rel.hh>
40 
41 namespace Gecode {
42 
43  void
45  using namespace Int;
47  switch (irt) {
48  case IRT_EQ:
50  ::post(home,x0,x1)));
51  break;
52  case IRT_NQ:
53  {
54  NegBoolView n1(x1);
56  ::post(home,x0,n1)));
57  }
58  break;
59  case IRT_GQ:
61  break;
62  case IRT_LQ:
64  break;
65  case IRT_GR:
67  break;
68  case IRT_LE:
70  break;
71  default:
72  throw UnknownRelation("Int::rel");
73  }
74  }
75 
76  void
77  rel(Home home, BoolVar x0, IntRelType irt, int n, IntPropLevel) {
78  using namespace Int;
80  BoolView x(x0);
81  if (n == 0) {
82  switch (irt) {
83  case IRT_LQ:
84  case IRT_EQ:
85  GECODE_ME_FAIL(x.zero(home)); break;
86  case IRT_NQ:
87  case IRT_GR:
88  GECODE_ME_FAIL(x.one(home)); break;
89  case IRT_LE:
90  home.fail(); break;
91  case IRT_GQ:
92  break;
93  default:
94  throw UnknownRelation("Int::rel");
95  }
96  } else if (n == 1) {
97  switch (irt) {
98  case IRT_GQ:
99  case IRT_EQ:
100  GECODE_ME_FAIL(x.one(home)); break;
101  case IRT_NQ:
102  case IRT_LE:
103  GECODE_ME_FAIL(x.zero(home)); break;
104  case IRT_GR:
105  home.fail(); break;
106  case IRT_LQ:
107  break;
108  default:
109  throw UnknownRelation("Int::rel");
110  }
111  } else {
112  throw NotZeroOne("Int::rel");
113  }
114  }
115 
116  void
117  rel(Home home, BoolVar x0, IntRelType irt, BoolVar x1, Reify r,
118  IntPropLevel) {
119  using namespace Int;
120  GECODE_POST;
121  switch (irt) {
122  case IRT_EQ:
123  switch (r.mode()) {
124  case RM_EQV:
126  ::post(home,x0,x1,r.var())));
127  break;
128  case RM_IMP:
130  ::post(home,x0,x1,r.var())));
131  break;
132  case RM_PMI:
134  ::post(home,x0,x1,r.var())));
135  break;
136  default: throw UnknownReifyMode("Int::rel");
137  }
138  break;
139  case IRT_NQ:
140  {
141  NegBoolView nr(r.var());
142  switch (r.mode()) {
143  case RM_EQV:
145  ::post(home,x0,x1,nr)));
146  break;
147  case RM_IMP:
149  ::post(home,x0,x1,nr)));
150  break;
151  case RM_PMI:
153  ::post(home,x0,x1,nr)));
154  break;
155  default: throw UnknownReifyMode("Int::rel");
156  }
157  }
158  break;
159  case IRT_GQ:
160  std::swap(x0,x1); // Fall through
161  case IRT_LQ:
162  switch (r.mode()) {
163  case RM_EQV:
164  {
165  NegBoolView n0(x0);
167  ::post(home,n0,x1,r.var())));
168  }
169  break;
170  case RM_IMP:
172  ::post(home,x0,x1,r.var())));
173  break;
174  case RM_PMI:
176  ::post(home,x0,x1,r.var())));
177  break;
178  default: throw UnknownReifyMode("Int::rel");
179  }
180  break;
181  case IRT_LE:
182  std::swap(x0,x1); // Fall through
183  case IRT_GR:
184  {
185  NegBoolView nr(r.var());
186  switch (r.mode()) {
187  case RM_EQV:
188  {
189  NegBoolView n0(x0);
191  ::post(home,n0,x1,nr)));
192  }
193  break;
194  case RM_IMP:
196  ::post(home,x0,x1,nr)));
197  break;
198  case RM_PMI:
200  ::post(home,x0,x1,nr)));
201  break;
202  default: throw UnknownReifyMode("Int::rel");
203  }
204  }
205  break;
206  default:
207  throw UnknownRelation("Int::rel");
208  }
209  }
210 
211  void
212  rel(Home home, BoolVar x0, IntRelType irt, int n, Reify r,
213  IntPropLevel) {
214  using namespace Int;
215  GECODE_POST;
216  BoolView x(x0);
217  BoolView y(r.var());
218  if (n == 0) {
219  switch (irt) {
220  case IRT_LQ:
221  case IRT_EQ:
222  switch (r.mode()) {
223  case RM_EQV:
224  {
225  NegBoolView ny(y);
227  ::post(home,x,ny)));
228  }
229  break;
230  case RM_IMP:
231  {
232  NegBoolView nx(x); NegBoolView ny(y);
234  ::post(home,nx,ny)));
235  }
236  break;
237  case RM_PMI:
239  ::post(home,x,y)));
240  break;
241  default: throw UnknownReifyMode("Int::rel");
242  }
243  break;
244  case IRT_NQ:
245  case IRT_GR:
246  switch (r.mode()) {
247  case RM_EQV:
249  ::post(home,x,y)));
250  break;
251  case RM_IMP:
252  {
253  NegBoolView ny(y);
255  ::post(home,x,ny)));
256  }
257  break;
258  case RM_PMI:
259  {
260  NegBoolView nx(x);
262  ::post(home,nx,y)));
263  }
264  break;
265  default: throw UnknownReifyMode("Int::rel");
266  }
267  break;
268  case IRT_LE:
269  switch (r.mode()) {
270  case RM_EQV:
271  case RM_IMP:
272  GECODE_ME_FAIL(y.zero(home));
273  break;
274  case RM_PMI:
275  break;
276  default: throw UnknownReifyMode("Int::rel");
277  }
278  break;
279  case IRT_GQ:
280  switch (r.mode()) {
281  case RM_EQV:
282  case RM_PMI:
283  GECODE_ME_FAIL(y.one(home));
284  break;
285  case RM_IMP:
286  break;
287  default: throw UnknownReifyMode("Int::rel");
288  }
289  break;
290  default:
291  throw UnknownRelation("Int::rel");
292  }
293  } else if (n == 1) {
294  switch (irt) {
295  case IRT_NQ:
296  case IRT_LE:
297  switch (r.mode()) {
298  case RM_EQV:
299  {
300  NegBoolView ny(y);
302  ::post(home,x,ny)));
303  }
304  break;
305  case RM_IMP:
306  {
307  NegBoolView nx(x); NegBoolView ny(y);
309  ::post(home,nx,ny)));
310  }
311  break;
312  case RM_PMI:
314  ::post(home,x,y)));
315  break;
316  default: throw UnknownReifyMode("Int::rel");
317  }
318  break;
319  case IRT_EQ:
320  case IRT_GQ:
321  switch (r.mode()) {
322  case RM_EQV:
324  ::post(home,x,y)));
325  break;
326  case RM_IMP:
327  {
328  NegBoolView ny(y);
330  ::post(home,x,ny)));
331  }
332  break;
333  case RM_PMI:
334  {
335  NegBoolView nx(x);
337  ::post(home,nx,y)));
338  }
339  break;
340  default: throw UnknownReifyMode("Int::rel");
341  }
342  break;
343  case IRT_GR:
344  switch (r.mode()) {
345  case RM_EQV:
346  case RM_IMP:
347  GECODE_ME_FAIL(y.zero(home));
348  break;
349  case RM_PMI:
350  break;
351  default: throw UnknownReifyMode("Int::rel");
352  }
353  break;
354  case IRT_LQ:
355  switch (r.mode()) {
356  case RM_EQV:
357  case RM_PMI:
358  GECODE_ME_FAIL(y.one(home));
359  break;
360  case RM_IMP:
361  break;
362  default: throw UnknownReifyMode("Int::rel");
363  }
364  break;
365  default:
366  throw UnknownRelation("Int::rel");
367  }
368  } else {
369  throw NotZeroOne("Int::rel");
370  }
371  }
372 
373  void
374  rel(Home home, const BoolVarArgs& x, IntRelType irt, BoolVar y,
375  IntPropLevel) {
376  using namespace Int;
377  GECODE_POST;
378  switch (irt) {
379  case IRT_EQ:
380  for (int i=x.size(); i--; ) {
382  ::post(home,x[i],y)));
383  }
384  break;
385  case IRT_NQ:
386  {
387  NegBoolView n(y);
388  for (int i=x.size(); i--; ) {
390  ::post(home,x[i],n)));
391  }
392  }
393  break;
394  case IRT_GQ:
395  for (int i=x.size(); i--; ) {
397  }
398  break;
399  case IRT_LQ:
400  for (int i=x.size(); i--; ) {
402  }
403  break;
404  case IRT_GR:
405  for (int i=x.size(); i--; ) {
407  }
408  break;
409  case IRT_LE:
410  for (int i=x.size(); i--; ) {
412  }
413  break;
414  default:
415  throw UnknownRelation("Int::rel");
416  }
417  }
418 
419  void
420  rel(Home home, const BoolVarArgs& x, IntRelType irt, int n,
421  IntPropLevel) {
422  using namespace Int;
423  GECODE_POST;
424  if (n == 0) {
425  switch (irt) {
426  case IRT_LQ:
427  case IRT_EQ:
428  for (int i=x.size(); i--; ) {
429  BoolView xi(x[i]); GECODE_ME_FAIL(xi.zero(home));
430  }
431  break;
432  case IRT_NQ:
433  case IRT_GR:
434  for (int i=x.size(); i--; ) {
435  BoolView xi(x[i]); GECODE_ME_FAIL(xi.one(home));
436  }
437  break;
438  case IRT_LE:
439  home.fail(); break;
440  case IRT_GQ:
441  break;
442  default:
443  throw UnknownRelation("Int::rel");
444  }
445  } else if (n == 1) {
446  switch (irt) {
447  case IRT_GQ:
448  case IRT_EQ:
449  for (int i=x.size(); i--; ) {
450  BoolView xi(x[i]); GECODE_ME_FAIL(xi.one(home));
451  }
452  break;
453  case IRT_NQ:
454  case IRT_LE:
455  for (int i=x.size(); i--; ) {
456  BoolView xi(x[i]); GECODE_ME_FAIL(xi.zero(home));
457  }
458  break;
459  case IRT_GR:
460  home.fail(); break;
461  case IRT_LQ:
462  break;
463  default:
464  throw UnknownRelation("Int::rel");
465  }
466  } else {
467  throw NotZeroOne("Int::rel");
468  }
469  }
470 
471  void
472  rel(Home home, const BoolVarArgs& x, IntRelType irt, IntPropLevel) {
473  using namespace Int;
474  GECODE_POST;
475  if ((irt != IRT_NQ) && (x.size() < 2))
476  return;
477 
478  switch (irt) {
479  case IRT_EQ:
480  {
481  ViewArray<BoolView> y(home,x);
483  }
484  break;
485  case IRT_NQ:
486  {
487  ViewArray<BoolView> y(home,x);
489  }
490  break;
491  case IRT_LE:
492  if (x.size() == 2) {
493  GECODE_ES_FAIL(Bool::Le<BoolView>::post(home,x[0],x[1]));
494  } else {
495  home.fail();
496  }
497  break;
498  case IRT_LQ:
499  {
500  ViewArray<BoolView> y(home,x);
502  }
503  break;
504  case IRT_GR:
505  if (x.size() == 2) {
506  GECODE_ES_FAIL(Bool::Le<BoolView>::post(home,x[1],x[0]));
507  } else {
508  home.fail();
509  }
510  break;
511  case IRT_GQ:
512  {
513  ViewArray<BoolView> y(home,x.size());
514  for (int i=x.size(); i--; )
515  y[i] = x[x.size()-1-i];
517  }
518  for (int i=x.size()-1; i--; )
520  break;
521  default:
522  throw UnknownRelation("Int::rel");
523  }
524  }
525 
526  void
527  rel(Home home, const BoolVarArgs& x, IntRelType irt, const BoolVarArgs& y,
528  IntPropLevel) {
529  using namespace Int;
530  if (x.size() != y.size())
531  throw ArgumentSizeMismatch("Int::rel");
532  GECODE_POST;
533 
534  switch (irt) {
535  case IRT_GR:
536  {
537  ViewArray<BoolView> xv(home,x), yv(home,y);
539  }
540  break;
541  case IRT_LE:
542  {
543  ViewArray<BoolView> xv(home,x), yv(home,y);
545  }
546  break;
547  case IRT_GQ:
548  {
549  ViewArray<BoolView> xv(home,x), yv(home,y);
550  GECODE_ES_FAIL(Rel::LexLqLe<BoolView>::post(home,yv,xv,false));
551  }
552  break;
553  case IRT_LQ:
554  {
555  ViewArray<BoolView> xv(home,x), yv(home,y);
556  GECODE_ES_FAIL(Rel::LexLqLe<BoolView>::post(home,xv,yv,false));
557  }
558  break;
559  case IRT_EQ:
560  for (int i=x.size(); i--; ) {
562  ::post(home,x[i],y[i])));
563  }
564  break;
565  case IRT_NQ:
566  {
567  ViewArray<BoolView> xv(home,x), yv(home,y);
569  }
570  break;
571  default:
572  throw UnknownRelation("Int::rel");
573  }
574  }
575 
576  void
577  rel(Home home, BoolVar x0, BoolOpType o, BoolVar x1, BoolVar x2,
578  IntPropLevel) {
579  using namespace Int;
580  GECODE_POST;
581  switch (o) {
582  case BOT_AND:
583  {
584  NegBoolView n0(x0); NegBoolView n1(x1); NegBoolView n2(x2);
586  ::post(home,n0,n1,n2)));
587  }
588  break;
589  case BOT_OR:
591  ::post(home,x0,x1,x2)));
592  break;
593  case BOT_IMP:
594  {
595  NegBoolView n0(x0);
597  ::post(home,n0,x1,x2)));
598  }
599  break;
600  case BOT_EQV:
602  ::post(home,x0,x1,x2)));
603  break;
604  case BOT_XOR:
605  {
606  NegBoolView n2(x2);
608  ::post(home,x0,x1,n2)));
609  }
610  break;
611  default:
612  throw UnknownOperation("Int::rel");
613  }
614  }
615 
616  void
617  rel(Home home, BoolVar x0, BoolOpType o, BoolVar x1, int n,
618  IntPropLevel) {
619  using namespace Int;
620  GECODE_POST;
621  if (n == 0) {
622  switch (o) {
623  case BOT_AND:
624  {
625  NegBoolView n0(x0); NegBoolView n1(x1);
627  ::post(home,n0,n1)));
628  }
629  break;
630  case BOT_OR:
631  {
632  BoolView b0(x0); BoolView b1(x1);
633  GECODE_ME_FAIL(b0.zero(home));
634  GECODE_ME_FAIL(b1.zero(home));
635  }
636  break;
637  case BOT_IMP:
638  {
639  BoolView b0(x0); BoolView b1(x1);
640  GECODE_ME_FAIL(b0.one(home));
641  GECODE_ME_FAIL(b1.zero(home));
642  }
643  break;
644  case BOT_EQV:
645  {
646  NegBoolView n0(x0);
648  }
649  break;
650  case BOT_XOR:
652  break;
653  default:
654  throw UnknownOperation("Int::rel");
655  }
656  } else if (n == 1) {
657  switch (o) {
658  case BOT_AND:
659  {
660  BoolView b0(x0); BoolView b1(x1);
661  GECODE_ME_FAIL(b0.one(home));
662  GECODE_ME_FAIL(b1.one(home));
663  }
664  break;
665  case BOT_OR:
667  break;
668  case BOT_IMP:
669  {
670  NegBoolView n0(x0);
672  ::post(home,n0,x1)));
673  }
674  break;
675  case BOT_EQV:
677  break;
678  case BOT_XOR:
679  {
680  NegBoolView n0(x0);
682  }
683  break;
684  default:
685  throw UnknownOperation("Int::rel");
686  }
687  } else {
688  throw NotZeroOne("Int::rel");
689  }
690  }
691 
692  void
693  rel(Home home, BoolOpType o, const BoolVarArgs& x, BoolVar y,
694  IntPropLevel) {
695  using namespace Int;
696  GECODE_POST;
697  int m = x.size();
698  Region r(home);
699  switch (o) {
700  case BOT_AND:
701  {
702  ViewArray<NegBoolView> b(home,m);
703  for (int i=m; i--; ) {
704  NegBoolView nb(x[i]); b[i]=nb;
705  }
706  NegBoolView ny(y);
707  b.unique(home);
709  ::post(home,b,ny)));
710  }
711  break;
712  case BOT_OR:
713  {
714  ViewArray<BoolView> b(home,x);
715  b.unique(home);
717  }
718  break;
719  case BOT_IMP:
720  if (m < 2) {
721  throw TooFewArguments("Int::rel");
722  } else {
723  ViewArray<NegBoolView> a(home,x.size()-1);
724  for (int i=x.size()-1; i--; )
725  a[i]=NegBoolView(x[i]);
726  ViewArray<BoolView> b(home,1);
727  b[0]=x[x.size()-1];
729  ::post(home,b,a,y)));
730  }
731  break;
732  case BOT_EQV:
733  {
734  ViewArray<BoolView> xy(home, x.size() + 1);
735  for (int i=x.size(); i--; )
736  xy[i] = x[i];
737  xy[x.size()] = y;
739  }
740  break;
741  case BOT_XOR:
742  {
743  ViewArray<BoolView> xy(home, x.size() + 1);
744  for (int i=x.size(); i--; )
745  xy[i] = x[i];
746  xy[x.size()] = y;
748  }
749  break;
750  default:
751  throw UnknownOperation("Int::rel");
752  }
753  }
754 
755  void
756  rel(Home home, BoolOpType o, const BoolVarArgs& x, int n,
757  IntPropLevel) {
758  using namespace Int;
759  if ((n < 0) || (n > 1))
760  throw NotZeroOne("Int::rel");
761  GECODE_POST;
762  int m = x.size();
763  Region r(home);
764  switch (o) {
765  case BOT_AND:
766  if (n == 0) {
767  ViewArray<NegBoolView> b(home,m);
768  for (int i=m; i--; ) {
769  NegBoolView nb(x[i]); b[i]=nb;
770  }
771  b.unique(home);
773  } else {
774  for (int i=m; i--; ) {
775  BoolView b(x[i]); GECODE_ME_FAIL(b.one(home));
776  }
777  }
778  break;
779  case BOT_OR:
780  if (n == 0) {
781  for (int i=m; i--; ) {
782  BoolView b(x[i]); GECODE_ME_FAIL(b.zero(home));
783  }
784  } else {
785  ViewArray<BoolView> b(home,x);
786  b.unique(home);
788  }
789  break;
790  case BOT_IMP:
791  if (m < 2) {
792  throw TooFewArguments("Int::rel");
793  } else if (n == 0) {
794  for (int i=m-1; i--; )
795  GECODE_ME_FAIL(BoolView(x[i]).one(home));
796  GECODE_ME_FAIL(BoolView(x[m-1]).zero(home));
797  } else {
798  ViewArray<NegBoolView> a(home,x.size()-1);
799  for (int i=x.size()-1; i--; )
800  a[i]=NegBoolView(x[i]);
801  ViewArray<BoolView> b(home,1);
802  b[0]=x[x.size()-1];
804  ::post(home,b,a)));
805  }
806  break;
807  case BOT_EQV:
808  {
809  ViewArray<BoolView> b(home,x);
811  }
812  break;
813  case BOT_XOR:
814  {
815  ViewArray<BoolView> b(home,x);
816  GECODE_ES_FAIL(Bool::NaryEqv::post(home,b,1^n));
817  }
818  break;
819  default:
820  throw UnknownOperation("Int::rel");
821  }
822  }
823 
824  void
825  clause(Home home, BoolOpType o, const BoolVarArgs& x, const BoolVarArgs& y,
826  int n, IntPropLevel) {
827  using namespace Int;
828  if ((n < 0) || (n > 1))
829  throw NotZeroOne("Int::rel");
830  GECODE_POST;
831  switch (o) {
832  case BOT_AND:
833  if (n == 0) {
834  ViewArray<NegBoolView> xv(home,x.size());
835  for (int i=x.size(); i--; ) {
836  NegBoolView nxi(x[i]); xv[i]=nxi;
837  }
838  ViewArray<BoolView> yv(home,y);
839  xv.unique(home); yv.unique(home);
841  ::post(home,xv,yv)));
842  } else {
843  for (int i=x.size(); i--; ) {
844  BoolView b(x[i]); GECODE_ME_FAIL(b.one(home));
845  }
846  for (int i=y.size(); i--; ) {
847  BoolView b(y[i]); GECODE_ME_FAIL(b.zero(home));
848  }
849  }
850  break;
851  case BOT_OR:
852  if (n == 0) {
853  for (int i=x.size(); i--; ) {
854  BoolView b(x[i]); GECODE_ME_FAIL(b.zero(home));
855  }
856  for (int i=y.size(); i--; ) {
857  BoolView b(y[i]); GECODE_ME_FAIL(b.one(home));
858  }
859  } else {
860  ViewArray<BoolView> xv(home,x);
861  ViewArray<NegBoolView> yv(home,y.size());
862  for (int i=y.size(); i--; ) {
863  NegBoolView nyi(y[i]); yv[i]=nyi;
864  }
865  xv.unique(home); yv.unique(home);
867  ::post(home,xv,yv)));
868  }
869  break;
870  default:
871  throw IllegalOperation("Int::clause");
872  }
873  }
874 
875  void
876  clause(Home home, BoolOpType o, const BoolVarArgs& x, const BoolVarArgs& y,
877  BoolVar z, IntPropLevel) {
878  using namespace Int;
879  GECODE_POST;
880  switch (o) {
881  case BOT_AND:
882  {
883  ViewArray<NegBoolView> xv(home,x.size());
884  for (int i=x.size(); i--; ) {
885  NegBoolView n(x[i]); xv[i]=n;
886  }
887  ViewArray<BoolView> yv(home,y);
888  xv.unique(home); yv.unique(home);
889  NegBoolView nz(z);
891  ::post(home,xv,yv,nz)));
892  }
893  break;
894  case BOT_OR:
895  {
896  ViewArray<BoolView> xv(home,x);
897  ViewArray<NegBoolView> yv(home,y.size());
898  for (int i=y.size(); i--; ) {
899  NegBoolView n(y[i]); yv[i]=n;
900  }
901  xv.unique(home); yv.unique(home);
903  ::post(home,xv,yv,z)));
904  }
905  break;
906  default:
907  throw IllegalOperation("Int::clause");
908  }
909  }
910 
911  void
913  IntPropLevel ipl) {
914  using namespace Int;
915  GECODE_POST;
916  if (vbd(ipl) == IPL_BND) {
918  ::post(home,b,x,y,z)));
919  } else {
921  ::post(home,b,x,y,z)));
922  }
923  }
924 
925 }
926 
927 // STATISTICS: int-post
Bounds propagation.
Definition: int.hh:945
If-then-else bounds-consistent propagator.
Definition: bool.hh:610
IntPropLevel vbd(IntPropLevel ipl)
Extract value, bounds, or domain propagation from propagation level.
Definition: ipl.hpp:41
bool zero(void) const
Test whether view is assigned to be zero.
Definition: bool.hpp:214
Inverse implication for reification.
Definition: int.hh:848
int size(void) const
Return size of array (number of elements)
Definition: array.hpp:1669
Boolean clause propagator (disjunctive, true)
Definition: bool.hh:550
ReifyMode mode(void) const
Return reification mode.
Definition: reify.hpp:60
Negated Boolean view.
Definition: view.hpp:1503
bool one(const Gecode::FloatValArgs &a)
Check whether has only one coefficients.
Definition: linear.cpp:50
BoolOpType
Operation types for Booleans.
Definition: int.hh:917
bool one(void) const
Test whether view is assigned to be one.
Definition: bool.hpp:218
Less or equal ( )
Definition: int.hh:907
Conjunction.
Definition: int.hh:918
Exception: Too few arguments available in argument array
Definition: exception.hpp:70
Exception: Unknown operation passed as argument
Definition: exception.hpp:98
Implication.
Definition: int.hh:920
Lexical disequality propagator.
Definition: rel.hh:662
Boolean clause propagator (disjunctive)
Definition: bool.hh:496
static ExecStatus post(Home home, ViewArray< BoolView > &x, int pm2)
Post propagator .
Definition: eqv.cpp:58
Handle to region.
Definition: region.hpp:61
Greater ( )
Definition: int.hh:910
void unique(const Space &home)
Remove all duplicate views from array (changes element order)
Definition: array.hpp:1505
Greater or equal ( )
Definition: int.hh:909
Exclusive or.
Definition: int.hh:922
Reified less or equal propagator.
Definition: rel.hh:554
Nary disequality propagator.
Definition: rel.hh:322
Exception: Unknown relation passed as argument
Definition: exception.hpp:91
struct Gecode::@554::NNF::@60::@62 a
For atomic nodes.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:238
Equality ( )
Definition: int.hh:905
n-ary Boolean equality propagator
Definition: bool.hh:137
Boolean equivalence propagator.
Definition: bool.hh:430
IntRelType
Relation types for integers.
Definition: int.hh:904
Exception: Illegal operation passed as argument
Definition: exception.hpp:105
NNF * r
Right subtree.
Definition: bool-expr.cpp:246
Boolean disjunction propagator.
Definition: bool.hh:332
Reification specification.
Definition: int.hh:855
Reified binary bounds consistent equality propagator.
Definition: rel.hh:376
Less ( )
Definition: int.hh:908
Boolean equality propagator.
Definition: bool.hh:109
void ite(Home home, BoolVar b, IntVar x, IntVar y, IntVar z, IntPropLevel ipl)
Post propagator for if-then-else constraint.
Definition: bool.cpp:912
Disjunction.
Definition: int.hh:919
Passing Boolean variables.
Definition: int.hh:691
Boolean less or equal propagator.
Definition: bool.hh:163
Boolean integer variables.
Definition: int.hh:492
If-then-else domain-consistent propagator.
Definition: bool.hh:636
Boolean n-ary disjunction propagator (true)
Definition: bool.hh:397
IntPropLevel
Propagation levels for integer propagators.
Definition: int.hh:941
Boolean less propagator.
Definition: bool.hh:227
Nary Boolean less or equal propagator.
Definition: bool.hh:187
Node * x
Pointer to corresponding Boolean expression node.
Definition: bool-expr.cpp:253
Lexical ordering propagator.
Definition: rel.hh:629
Boolean n-ary disjunction propagator.
Definition: bool.hh:359
Binary Boolean disjunction propagator (true)
Definition: bool.hh:241
Integer variables.
Definition: int.hh:351
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
Definition: rel.cpp:47
Equivalence.
Definition: int.hh:921
BoolVar var(void) const
Return Boolean control variable.
Definition: reify.hpp:52
Exception: Not 0/1 integer
Definition: exception.hpp:55
#define GECODE_ME_FAIL(me)
Check whether modification event me is failed, and fail space home.
Definition: macros.hpp:81
void fail(void)
Mark space as failed.
Definition: core.hpp:3958
Exception: Unknown reification mode passed as argument
Definition: exception.hpp:119
Gecode toplevel namespace
Implication for reification.
Definition: int.hh:841
Disequality ( )
Definition: int.hh:906
struct Gecode::@554::NNF::@60::@61 b
For binary nodes (and, or, eqv)
#define GECODE_POST
Check for failure in a constraint post function.
Definition: macros.hpp:44
Home class for posting propagators
Definition: core.hpp:905
Exception: Arguments are of different size
Definition: exception.hpp:77
#define GECODE_ES_FAIL(es)
Check whether execution status es is failed, and fail space home.
Definition: macros.hpp:107
TFE post(PropagatorGroup g)
Only post functions (but not propagators) from g are considered.
void clause(Home home, BoolOpType o, const BoolVarArgs &x, const BoolVarArgs &y, int n, IntPropLevel)
Post domain consistent propagator for Boolean clause with positive variables x and negative variables...
Definition: bool.cpp:825
Equivalence for reification (default)
Definition: int.hh:834
Boolean view for Boolean variables.
Definition: view.hpp:1315