// This is a generated file. Do not edit!
// Original source: UnsafeGecode.dsc

#include "UnsafeGecodeSpecial.hh"

DEFINE2(new_intvar) {
  DBGMSG("new_intvar");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfPairs1 = v1->GetLength();
  int pairs1[noOfPairs1][2];

  {
  int lastMax = Limits::Set::int_min-1;
  for (int j=0; j<noOfPairs1; j++) {
    DECLARE_TUPLE(tmp, v1->Sub(j));
    DECLARE_INT(tmp0, tmp->Sel(0));
    DECLARE_INT(tmp1, tmp->Sel(1));
    if (tmp0>tmp1 || tmp0<=lastMax)
      RAISE(UnsafeGecode::InvalidDomainConstructor);
    lastMax = tmp1;
    pairs1[j][0] = tmp0;
    pairs1[j][1] = tmp1;
  }
  }
  IntSet ds1(pairs1, noOfPairs1);
  try {
    RETURN_GECODE_VAR(s->new_intvar(ds1), stamp, pstamp);
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE1(new_boolvar) {
  DBGMSG("new_boolvar");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  try {
    RETURN_GECODE_VAR(s->new_boolvar(), stamp, pstamp);
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE1(new_setvar) {
  DBGMSG("new_setvar");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  try {
    RETURN_GECODE_VAR(s->new_setvar(), stamp, pstamp);
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE3(commit) {
  DBGMSG("commit");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_DESCRIPTION(desc1, x1);
  DECLARE_INT(i2, x2);
  try {
    s->commit(desc1,i2);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE2(int_getMin) {
  DBGMSG("int_getMin");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  try {
    DECLARE_INTVAR(var1, s, stamp, pstamp, x1);
    RETURN_INT(var1.min());
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE2(int_getMax) {
  DBGMSG("int_getMax");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  try {
    DECLARE_INTVAR(var1, s, stamp, pstamp, x1);
    RETURN_INT(var1.max());
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE2(int_getMed) {
  DBGMSG("int_getMed");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  try {
    DECLARE_INTVAR(var1, s, stamp, pstamp, x1);
    RETURN_INT(var1.med());
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE2(int_getDomainSize) {
  DBGMSG("int_getDomainSize");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  try {
    DECLARE_INTVAR(var1, s, stamp, pstamp, x1);
    RETURN_INT(var1.size());
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE2(int_isRange) {
  DBGMSG("int_isRange");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  try {
    DECLARE_INTVAR(var1, s, stamp, pstamp, x1);
    RETURN_BOOL(var1.range());
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE2(int_isAssigned) {
  DBGMSG("int_isAssigned");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  try {
    DECLARE_INTVAR(var1, s, stamp, pstamp, x1);
    RETURN_BOOL(var1.assigned());
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE2(set_getUpperBound) {
  DBGMSG("set_getUpperBound");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  try {
    DECLARE_SETVAR(var1, s, stamp, pstamp, x1);
    unsigned int retIterSize = 0;
    for(SetVarLubRanges iters(var1);
        iters(); ++iters) retIterSize++;
    SetVarLubRanges ret(var1);
    Vector *vret = Vector::New(retIterSize);
    if(retIterSize>0) {
      u_int count = 0;
      for (; ret(); ++ret) {
        Tuple *t = Tuple::New(2);
        t->Init(0, Store::IntToWord(ret.min()));
        t->Init(1, Store::IntToWord(ret.max()));
        vret->Init(count, t->ToWord());
        count++;
      }
    }
    RETURN(vret->ToWord());
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE2(set_getLowerBound) {
  DBGMSG("set_getLowerBound");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  try {
    DECLARE_SETVAR(var1, s, stamp, pstamp, x1);
    unsigned int retIterSize = 0;
    for(SetVarGlbRanges iters(var1);
        iters(); ++iters) retIterSize++;
    SetVarGlbRanges ret(var1);
    Vector *vret = Vector::New(retIterSize);
    if(retIterSize>0) {
      u_int count = 0;
      for (; ret(); ++ret) {
        Tuple *t = Tuple::New(2);
        t->Init(0, Store::IntToWord(ret.min()));
        t->Init(1, Store::IntToWord(ret.max()));
        vret->Init(count, t->ToWord());
        count++;
      }
    }
    RETURN(vret->ToWord());
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE2(set_getUpperBoundSize) {
  DBGMSG("set_getUpperBoundSize");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  try {
    DECLARE_SETVAR(var1, s, stamp, pstamp, x1);
    RETURN_INT(var1.lubSize());
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE2(set_getLowerBoundSize) {
  DBGMSG("set_getLowerBoundSize");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  try {
    DECLARE_SETVAR(var1, s, stamp, pstamp, x1);
    RETURN_INT(var1.glbSize());
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE2(set_getUnknownSize) {
  DBGMSG("set_getUnknownSize");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  try {
    DECLARE_SETVAR(var1, s, stamp, pstamp, x1);
    RETURN_INT(var1.unknownSize());
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE2(set_getUnknown) {
  DBGMSG("set_getUnknown");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  try {
    DECLARE_SETVAR(var1, s, stamp, pstamp, x1);
    unsigned int retIterSize = 0;
    for(SetVarUnknownRanges iters(var1);
        iters(); ++iters) retIterSize++;
    SetVarUnknownRanges ret(var1);
    Vector *vret = Vector::New(retIterSize);
    if(retIterSize>0) {
      u_int count = 0;
      for (; ret(); ++ret) {
        Tuple *t = Tuple::New(2);
        t->Init(0, Store::IntToWord(ret.min()));
        t->Init(1, Store::IntToWord(ret.max()));
        vret->Init(count, t->ToWord());
        count++;
      }
    }
    RETURN(vret->ToWord());
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE2(set_getCardinalityMin) {
  DBGMSG("set_getCardinalityMin");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  try {
    DECLARE_SETVAR(var1, s, stamp, pstamp, x1);
    RETURN_INT(var1.cardMin());
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE2(set_getCardinalityMax) {
  DBGMSG("set_getCardinalityMax");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  try {
    DECLARE_SETVAR(var1, s, stamp, pstamp, x1);
    RETURN_INT(var1.cardMax());
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE2(set_isAssigned) {
  DBGMSG("set_isAssigned");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  try {
    DECLARE_SETVAR(var1, s, stamp, pstamp, x1);
    RETURN_BOOL(var1.assigned());
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE3(int_dom) {
  DBGMSG("int_dom");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_INTVAR(var1, s, stamp, pstamp, x1);
  DECLARE_VECTOR(v2, x2);
  int noOfPairs2 = v2->GetLength();
  int pairs2[noOfPairs2][2];

  {
  int lastMax = Limits::Set::int_min-1;
  for (int j=0; j<noOfPairs2; j++) {
    DECLARE_TUPLE(tmp, v2->Sub(j));
    DECLARE_INT(tmp0, tmp->Sel(0));
    DECLARE_INT(tmp1, tmp->Sel(1));
    if (tmp0>tmp1 || tmp0<=lastMax)
      RAISE(UnsafeGecode::InvalidDomainConstructor);
    lastMax = tmp1;
    pairs2[j][0] = tmp0;
    pairs2[j][1] = tmp1;
  }
  }
  IntSet ds2(pairs2, noOfPairs2);
  try {
    dom(s,var1,ds2);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE4(int_domR) {
  DBGMSG("int_domR");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_INTVAR(var1, s, stamp, pstamp, x1);
  DECLARE_VECTOR(v2, x2);
  int noOfPairs2 = v2->GetLength();
  int pairs2[noOfPairs2][2];

  {
  int lastMax = Limits::Set::int_min-1;
  for (int j=0; j<noOfPairs2; j++) {
    DECLARE_TUPLE(tmp, v2->Sub(j));
    DECLARE_INT(tmp0, tmp->Sel(0));
    DECLARE_INT(tmp1, tmp->Sel(1));
    if (tmp0>tmp1 || tmp0<=lastMax)
      RAISE(UnsafeGecode::InvalidDomainConstructor);
    lastMax = tmp1;
    pairs2[j][0] = tmp0;
    pairs2[j][1] = tmp1;
  }
  }
  IntSet ds2(pairs2, noOfPairs2);
  DECLARE_BOOLVAR(var3, s, stamp, pstamp, x3);
  try {
    dom(s,var1,ds2,var3);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE4(int_rel) {
  DBGMSG("int_rel");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_INTVAR(var1, s, stamp, pstamp, x1);
  DECLARE_INT(intrel2, x2);
  DECLARE_INTVAR(var3, s, stamp, pstamp, x3);
  try {
    rel(s,var1,UnsafeGecode::int2intreltype[intrel2],var3);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE4(int_relI) {
  DBGMSG("int_relI");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_INTVAR(var1, s, stamp, pstamp, x1);
  DECLARE_INT(intrel2, x2);
  DECLARE_INT(i3, x3);
  try {
    rel(s,var1,UnsafeGecode::int2intreltype[intrel2],i3);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE5(int_relR) {
  DBGMSG("int_relR");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_INTVAR(var1, s, stamp, pstamp, x1);
  DECLARE_INT(intrel2, x2);
  DECLARE_INTVAR(var3, s, stamp, pstamp, x3);
  DECLARE_BOOLVAR(var4, s, stamp, pstamp, x4);
  try {
    rel(s,var1,UnsafeGecode::int2intreltype[intrel2],var3,var4);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE5(int_relIR) {
  DBGMSG("int_relIR");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_INTVAR(var1, s, stamp, pstamp, x1);
  DECLARE_INT(intrel2, x2);
  DECLARE_INT(i3, x3);
  DECLARE_BOOLVAR(var4, s, stamp, pstamp, x4);
  try {
    rel(s,var1,UnsafeGecode::int2intreltype[intrel2],i3,var4);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE4(int_eq) {
  DBGMSG("int_eq");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_INTVAR(var1, s, stamp, pstamp, x1);
  DECLARE_INTVAR(var2, s, stamp, pstamp, x2);
  DECLARE_INT(cl3, x3);
  try {
    eq(s,var1,var2,UnsafeGecode::int2cl[cl3]);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE3(int_eqV) {
  DBGMSG("int_eqV");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  IntVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  DECLARE_INT(cl2, x2);
  try {
    eq(s,vars1,UnsafeGecode::int2cl[cl2]);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE5(int_eqR) {
  DBGMSG("int_eqR");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_INTVAR(var1, s, stamp, pstamp, x1);
  DECLARE_INTVAR(var2, s, stamp, pstamp, x2);
  DECLARE_BOOLVAR(var3, s, stamp, pstamp, x3);
  DECLARE_INT(cl4, x4);
  try {
    eq(s,var1,var2,var3,UnsafeGecode::int2cl[cl4]);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE3(int_distinct) {
  DBGMSG("int_distinct");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  IntVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  DECLARE_INT(cl2, x2);
  try {
    distinct(s,vars1,UnsafeGecode::int2cl[cl2]);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE4(int_distinctI) {
  DBGMSG("int_distinctI");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfArgs1 = v1->GetLength();
  if (noOfArgs1==0) RETURN_UNIT;
  IntArgs args1(noOfArgs1);
  for (int i=noOfArgs1; i--;) {
    DECLARE_INT(tmp, v1->Sub(i));
    args1[i] = tmp;
  }
  DECLARE_VECTOR(v2, x2);
  int noOfVars2 = v2->GetLength();
  IntVarArgs vars2(noOfVars2);
  for (int i=noOfVars2; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v2->Sub(i));
    vars2[i] = tmp;
  }
  DECLARE_INT(cl3, x3);
  try {
    distinct(s,args1,vars2,UnsafeGecode::int2cl[cl3]);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE4(int_sortedness) {
  DBGMSG("int_sortedness");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  IntVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  DECLARE_VECTOR(v2, x2);
  int noOfVars2 = v2->GetLength();
  IntVarArgs vars2(noOfVars2);
  for (int i=noOfVars2; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v2->Sub(i));
    vars2[i] = tmp;
  }
  DECLARE_INT(cl3, x3);
  try {
    sortedness(s,vars1,vars2,UnsafeGecode::int2cl[cl3]);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE5(int_permsort) {
  DBGMSG("int_permsort");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  IntVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  DECLARE_VECTOR(v2, x2);
  int noOfVars2 = v2->GetLength();
  IntVarArgs vars2(noOfVars2);
  for (int i=noOfVars2; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v2->Sub(i));
    vars2[i] = tmp;
  }
  DECLARE_VECTOR(v3, x3);
  int noOfVars3 = v3->GetLength();
  IntVarArgs vars3(noOfVars3);
  for (int i=noOfVars3; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v3->Sub(i));
    vars3[i] = tmp;
  }
  DECLARE_INT(cl4, x4);
  try {
    sortedness(s,vars1,vars2,vars3,UnsafeGecode::int2cl[cl4]);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE8(int_gcc1) {
  DBGMSG("int_gcc1");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  IntVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  DECLARE_VECTOR(v2, x2);
  int noOfArgs2 = v2->GetLength();
  if (noOfArgs2==0) RETURN_UNIT;
  IntArgs args2(noOfArgs2);
  for (int i=noOfArgs2; i--;) {
    DECLARE_INT(tmp, v2->Sub(i));
    args2[i] = tmp;
  }
  DECLARE_INT(i3, x3);
  DECLARE_INT(i4, x4);
  DECLARE_INT(i5, x5);
  DECLARE_INT(i6, x6);
  DECLARE_INT(cl7, x7);
  try {
    gcc(s,vars1,args2,i3,i4,i5,i6,UnsafeGecode::int2cl[cl7]);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE9(int_gcc2) {
  DBGMSG("int_gcc2");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  IntVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  DECLARE_VECTOR(v2, x2);
  int noOfArgs2 = v2->GetLength();
  if (noOfArgs2==0) RETURN_UNIT;
  IntArgs args2(noOfArgs2);
  for (int i=noOfArgs2; i--;) {
    DECLARE_INT(tmp, v2->Sub(i));
    args2[i] = tmp;
  }
  DECLARE_INT(i3, x3);
  DECLARE_INT(i4, x4);
  DECLARE_INT(i5, x5);
  DECLARE_INT(i6, x6);
  DECLARE_INT(i7, x7);
  DECLARE_INT(cl8, x8);
  try {
    gcc(s,vars1,args2,i3,i4,i5,i6,i7,UnsafeGecode::int2cl[cl8]);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE4(int_gcc3) {
  DBGMSG("int_gcc3");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  IntVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  DECLARE_INT(i2, x2);
  DECLARE_INT(cl3, x3);
  try {
    gcc(s,vars1,i2,UnsafeGecode::int2cl[cl3]);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE5(int_gcc4) {
  DBGMSG("int_gcc4");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  IntVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  DECLARE_INT(i2, x2);
  DECLARE_INT(i3, x3);
  DECLARE_INT(cl4, x4);
  try {
    gcc(s,vars1,i2,i3,UnsafeGecode::int2cl[cl4]);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE6(int_gcc5) {
  DBGMSG("int_gcc5");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  IntVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  DECLARE_VECTOR(v2, x2);
  int noOfVars2 = v2->GetLength();
  IntVarArgs vars2(noOfVars2);
  for (int i=noOfVars2; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v2->Sub(i));
    vars2[i] = tmp;
  }
  DECLARE_INT(i3, x3);
  DECLARE_INT(i4, x4);
  DECLARE_INT(cl5, x5);
  try {
    gcc(s,vars1,vars2,i3,i4,UnsafeGecode::int2cl[cl5]);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE10(int_gcc6) {
  DBGMSG("int_gcc6");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  IntVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  DECLARE_VECTOR(v2, x2);
  int noOfArgs2 = v2->GetLength();
  if (noOfArgs2==0) RETURN_UNIT;
  IntArgs args2(noOfArgs2);
  for (int i=noOfArgs2; i--;) {
    DECLARE_INT(tmp, v2->Sub(i));
    args2[i] = tmp;
  }
  DECLARE_VECTOR(v3, x3);
  int noOfVars3 = v3->GetLength();
  IntVarArgs vars3(noOfVars3);
  for (int i=noOfVars3; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v3->Sub(i));
    vars3[i] = tmp;
  }
  DECLARE_INT(i4, x4);
  DECLARE_INT(i5, x5);
  DECLARE_BOOL(i6, x6);
  DECLARE_INT(i7, x7);
  DECLARE_INT(i8, x8);
  DECLARE_INT(cl9, x9);
  try {
    gcc(s,vars1,args2,vars3,i4,i5,i6,i7,i8,UnsafeGecode::int2cl[cl9]);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE11(int_gcc7) {
  DBGMSG("int_gcc7");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  IntVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  DECLARE_VECTOR(v2, x2);
  int noOfArgs2 = v2->GetLength();
  if (noOfArgs2==0) RETURN_UNIT;
  IntArgs args2(noOfArgs2);
  for (int i=noOfArgs2; i--;) {
    DECLARE_INT(tmp, v2->Sub(i));
    args2[i] = tmp;
  }
  DECLARE_VECTOR(v3, x3);
  int noOfVars3 = v3->GetLength();
  IntVarArgs vars3(noOfVars3);
  for (int i=noOfVars3; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v3->Sub(i));
    vars3[i] = tmp;
  }
  DECLARE_INT(i4, x4);
  DECLARE_INT(i5, x5);
  DECLARE_INT(i6, x6);
  DECLARE_BOOL(i7, x7);
  DECLARE_INT(i8, x8);
  DECLARE_INT(i9, x9);
  DECLARE_INT(cl10, x10);
  try {
    gcc(s,vars1,args2,vars3,i4,i5,i6,i7,i8,i9,UnsafeGecode::int2cl[cl10]);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE6(int_linear) {
  DBGMSG("int_linear");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfArgs1 = v1->GetLength();
  if (noOfArgs1==0) RETURN_UNIT;
  IntArgs args1(noOfArgs1);
  for (int i=noOfArgs1; i--;) {
    DECLARE_INT(tmp, v1->Sub(i));
    args1[i] = tmp;
  }
  DECLARE_VECTOR(v2, x2);
  int noOfVars2 = v2->GetLength();
  IntVarArgs vars2(noOfVars2);
  for (int i=noOfVars2; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v2->Sub(i));
    vars2[i] = tmp;
  }
  DECLARE_INT(intrel3, x3);
  DECLARE_INT(i4, x4);
  DECLARE_INT(cl5, x5);
  try {
    linear(s,args1,vars2,UnsafeGecode::int2intreltype[intrel3],i4,UnsafeGecode::int2cl[cl5]);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE7(int_linearR) {
  DBGMSG("int_linearR");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfArgs1 = v1->GetLength();
  if (noOfArgs1==0) RETURN_UNIT;
  IntArgs args1(noOfArgs1);
  for (int i=noOfArgs1; i--;) {
    DECLARE_INT(tmp, v1->Sub(i));
    args1[i] = tmp;
  }
  DECLARE_VECTOR(v2, x2);
  int noOfVars2 = v2->GetLength();
  IntVarArgs vars2(noOfVars2);
  for (int i=noOfVars2; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v2->Sub(i));
    vars2[i] = tmp;
  }
  DECLARE_INT(intrel3, x3);
  DECLARE_INT(i4, x4);
  DECLARE_BOOLVAR(var5, s, stamp, pstamp, x5);
  DECLARE_INT(cl6, x6);
  try {
    linear(s,args1,vars2,UnsafeGecode::int2intreltype[intrel3],i4,var5,UnsafeGecode::int2cl[cl6]);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE5(int_countII) {
  DBGMSG("int_countII");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  IntVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  DECLARE_INT(i2, x2);
  DECLARE_INT(intrel3, x3);
  DECLARE_INT(i4, x4);
  try {
    count(s,vars1,i2,UnsafeGecode::int2intreltype[intrel3],i4);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE5(int_countIV) {
  DBGMSG("int_countIV");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  IntVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  DECLARE_INT(i2, x2);
  DECLARE_INT(intrel3, x3);
  DECLARE_INTVAR(var4, s, stamp, pstamp, x4);
  try {
    count(s,vars1,i2,UnsafeGecode::int2intreltype[intrel3],var4);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE5(int_countVI) {
  DBGMSG("int_countVI");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  IntVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  DECLARE_INTVAR(var2, s, stamp, pstamp, x2);
  DECLARE_INT(intrel3, x3);
  DECLARE_INT(i4, x4);
  try {
    count(s,vars1,var2,UnsafeGecode::int2intreltype[intrel3],i4);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE5(int_countVV) {
  DBGMSG("int_countVV");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  IntVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  DECLARE_INTVAR(var2, s, stamp, pstamp, x2);
  DECLARE_INT(intrel3, x3);
  DECLARE_INTVAR(var4, s, stamp, pstamp, x4);
  try {
    count(s,vars1,var2,UnsafeGecode::int2intreltype[intrel3],var4);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE4(int_element) {
  DBGMSG("int_element");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  IntVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  DECLARE_INTVAR(var2, s, stamp, pstamp, x2);
  DECLARE_INTVAR(var3, s, stamp, pstamp, x3);
  try {
    element(s,vars1,var2,var3);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE4(int_elementI) {
  DBGMSG("int_elementI");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfArgs1 = v1->GetLength();
  if (noOfArgs1==0) RETURN_UNIT;
  IntArgs args1(noOfArgs1);
  for (int i=noOfArgs1; i--;) {
    DECLARE_INT(tmp, v1->Sub(i));
    args1[i] = tmp;
  }
  DECLARE_INTVAR(var2, s, stamp, pstamp, x2);
  DECLARE_INTVAR(var3, s, stamp, pstamp, x3);
  try {
    element(s,args1,var2,var3);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE4(int_lex) {
  DBGMSG("int_lex");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  IntVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  DECLARE_INT(intrel2, x2);
  DECLARE_VECTOR(v3, x3);
  int noOfVars3 = v3->GetLength();
  IntVarArgs vars3(noOfVars3);
  for (int i=noOfVars3; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v3->Sub(i));
    vars3[i] = tmp;
  }
  try {
    rel(s,vars1,UnsafeGecode::int2intreltype[intrel2],vars3);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE3(int_bool_not) {
  DBGMSG("int_bool_not");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_BOOLVAR(var1, s, stamp, pstamp, x1);
  DECLARE_BOOLVAR(var2, s, stamp, pstamp, x2);
  try {
    bool_not(s,var1,var2);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE4(int_bool_and) {
  DBGMSG("int_bool_and");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_BOOLVAR(var1, s, stamp, pstamp, x1);
  DECLARE_BOOLVAR(var2, s, stamp, pstamp, x2);
  DECLARE_BOOLVAR(var3, s, stamp, pstamp, x3);
  try {
    bool_and(s,var1,var2,var3);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE4(int_bool_or) {
  DBGMSG("int_bool_or");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_BOOLVAR(var1, s, stamp, pstamp, x1);
  DECLARE_BOOLVAR(var2, s, stamp, pstamp, x2);
  DECLARE_BOOLVAR(var3, s, stamp, pstamp, x3);
  try {
    bool_or(s,var1,var2,var3);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE4(int_bool_imp) {
  DBGMSG("int_bool_imp");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_BOOLVAR(var1, s, stamp, pstamp, x1);
  DECLARE_BOOLVAR(var2, s, stamp, pstamp, x2);
  DECLARE_BOOLVAR(var3, s, stamp, pstamp, x3);
  try {
    bool_imp(s,var1,var2,var3);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE4(int_bool_eq) {
  DBGMSG("int_bool_eq");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_BOOLVAR(var1, s, stamp, pstamp, x1);
  DECLARE_BOOLVAR(var2, s, stamp, pstamp, x2);
  DECLARE_BOOLVAR(var3, s, stamp, pstamp, x3);
  try {
    bool_eqv(s,var1,var2,var3);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE4(int_bool_xor) {
  DBGMSG("int_bool_xor");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_BOOLVAR(var1, s, stamp, pstamp, x1);
  DECLARE_BOOLVAR(var2, s, stamp, pstamp, x2);
  DECLARE_BOOLVAR(var3, s, stamp, pstamp, x3);
  try {
    bool_xor(s,var1,var2,var3);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE3(int_bool_andV) {
  DBGMSG("int_bool_andV");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  BoolVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_BOOLVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  DECLARE_BOOLVAR(var2, s, stamp, pstamp, x2);
  try {
    bool_and(s,vars1,var2);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE3(int_bool_orV) {
  DBGMSG("int_bool_orV");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  BoolVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_BOOLVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  DECLARE_BOOLVAR(var2, s, stamp, pstamp, x2);
  try {
    bool_or(s,vars1,var2);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE3(int_min) {
  DBGMSG("int_min");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  IntVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  DECLARE_INTVAR(var2, s, stamp, pstamp, x2);
  try {
    min(s,vars1,var2);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE3(int_max) {
  DBGMSG("int_max");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  IntVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  DECLARE_INTVAR(var2, s, stamp, pstamp, x2);
  try {
    max(s,vars1,var2);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE4(int_abs) {
  DBGMSG("int_abs");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_INTVAR(var1, s, stamp, pstamp, x1);
  DECLARE_INTVAR(var2, s, stamp, pstamp, x2);
  DECLARE_INT(cl3, x3);
  try {
    abs(s,var1,var2,UnsafeGecode::int2cl[cl3]);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE5(int_mult) {
  DBGMSG("int_mult");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_INTVAR(var1, s, stamp, pstamp, x1);
  DECLARE_INTVAR(var2, s, stamp, pstamp, x2);
  DECLARE_INTVAR(var3, s, stamp, pstamp, x3);
  DECLARE_INT(cl4, x4);
  try {
    mult(s,var1,var2,var3,UnsafeGecode::int2cl[cl4]);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE3(int_assign) {
  DBGMSG("int_assign");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  IntVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  DECLARE_INT(varValSel2, x2);
  try {
    assign(s,vars1,UnsafeGecode::int2avalsel[varValSel2]);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE4(int_branch) {
  DBGMSG("int_branch");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  IntVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  DECLARE_INT(varValSel2, x2);
  DECLARE_INT(varValSel3, x3);
  try {
    branch(s,vars1,UnsafeGecode::int2bvarsel[varValSel2],UnsafeGecode::int2bvalsel[varValSel3]);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE4(set_dom) {
  DBGMSG("set_dom");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_SETVAR(var1, s, stamp, pstamp, x1);
  DECLARE_INT(setrel2, x2);
  DECLARE_VECTOR(v3, x3);
  int noOfPairs3 = v3->GetLength();
  int pairs3[noOfPairs3][2];

  {
  int lastMax = Limits::Set::int_min-1;
  for (int j=0; j<noOfPairs3; j++) {
    DECLARE_TUPLE(tmp, v3->Sub(j));
    DECLARE_INT(tmp0, tmp->Sel(0));
    DECLARE_INT(tmp1, tmp->Sel(1));
    if (tmp0>tmp1 || tmp0<=lastMax)
      RAISE(UnsafeGecode::InvalidDomainConstructor);
    lastMax = tmp1;
    pairs3[j][0] = tmp0;
    pairs3[j][1] = tmp1;
  }
  }
  IntSet ds3(pairs3, noOfPairs3);
  try {
    dom(s,var1,UnsafeGecode::int2setreltype[setrel2],ds3);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE5(set_domR) {
  DBGMSG("set_domR");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_SETVAR(var1, s, stamp, pstamp, x1);
  DECLARE_INT(setrel2, x2);
  DECLARE_VECTOR(v3, x3);
  int noOfPairs3 = v3->GetLength();
  int pairs3[noOfPairs3][2];

  {
  int lastMax = Limits::Set::int_min-1;
  for (int j=0; j<noOfPairs3; j++) {
    DECLARE_TUPLE(tmp, v3->Sub(j));
    DECLARE_INT(tmp0, tmp->Sel(0));
    DECLARE_INT(tmp1, tmp->Sel(1));
    if (tmp0>tmp1 || tmp0<=lastMax)
      RAISE(UnsafeGecode::InvalidDomainConstructor);
    lastMax = tmp1;
    pairs3[j][0] = tmp0;
    pairs3[j][1] = tmp1;
  }
  }
  IntSet ds3(pairs3, noOfPairs3);
  DECLARE_BOOLVAR(var4, s, stamp, pstamp, x4);
  try {
    dom(s,var1,UnsafeGecode::int2setreltype[setrel2],ds3,var4);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE4(set_cardRange) {
  DBGMSG("set_cardRange");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_SETVAR(var1, s, stamp, pstamp, x1);
  DECLARE_INT(i2, x2);
  if (i2<0) RAISE(PrimitiveTable::General_Domain);
  DECLARE_INT(i3, x3);
  if (i3<0) RAISE(PrimitiveTable::General_Domain);
  try {
    cardinality(s,var1,i2,i3);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE4(set_rel) {
  DBGMSG("set_rel");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_SETVAR(var1, s, stamp, pstamp, x1);
  DECLARE_INT(setrel2, x2);
  DECLARE_SETVAR(var3, s, stamp, pstamp, x3);
  try {
    rel(s,var1,UnsafeGecode::int2setreltype[setrel2],var3);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE5(set_relR) {
  DBGMSG("set_relR");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_SETVAR(var1, s, stamp, pstamp, x1);
  DECLARE_INT(setrel2, x2);
  DECLARE_SETVAR(var3, s, stamp, pstamp, x3);
  DECLARE_BOOLVAR(var4, s, stamp, pstamp, x4);
  try {
    rel(s,var1,UnsafeGecode::int2setreltype[setrel2],var3,var4);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE6(set_relOp) {
  DBGMSG("set_relOp");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_SETVAR(var1, s, stamp, pstamp, x1);
  DECLARE_INT(setop2, x2);
  DECLARE_SETVAR(var3, s, stamp, pstamp, x3);
  DECLARE_INT(setrel4, x4);
  DECLARE_SETVAR(var5, s, stamp, pstamp, x5);
  try {
    rel(s,var1,UnsafeGecode::int2setoptype[setop2],var3,UnsafeGecode::int2setreltype[setrel4],var5);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE4(set_relI) {
  DBGMSG("set_relI");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_SETVAR(var1, s, stamp, pstamp, x1);
  DECLARE_INT(setrel2, x2);
  DECLARE_INTVAR(var3, s, stamp, pstamp, x3);
  try {
    rel(s,var1,UnsafeGecode::int2setreltype[setrel2],var3);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE5(set_relIR) {
  DBGMSG("set_relIR");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_SETVAR(var1, s, stamp, pstamp, x1);
  DECLARE_INT(setrel2, x2);
  DECLARE_INTVAR(var3, s, stamp, pstamp, x3);
  DECLARE_BOOLVAR(var4, s, stamp, pstamp, x4);
  try {
    rel(s,var1,UnsafeGecode::int2setreltype[setrel2],var3,var4);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE4(set_relII) {
  DBGMSG("set_relII");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_SETVAR(var1, s, stamp, pstamp, x1);
  DECLARE_INT(intrel2, x2);
  DECLARE_INTVAR(var3, s, stamp, pstamp, x3);
  try {
    rel(s,var1,UnsafeGecode::int2intreltype[intrel2],var3);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE4(set_relN) {
  DBGMSG("set_relN");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_INT(setop1, x1);
  DECLARE_VECTOR(v2, x2);
  int noOfVars2 = v2->GetLength();
  SetVarArgs vars2(noOfVars2);
  for (int i=noOfVars2; i--;) {
    DECLARE_SETVAR(tmp, s, stamp, pstamp, v2->Sub(i));
    vars2[i] = tmp;
  }
  DECLARE_SETVAR(var3, s, stamp, pstamp, x3);
  try {
    rel(s,UnsafeGecode::int2setoptype[setop1],vars2,var3);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE4(set_relNI) {
  DBGMSG("set_relNI");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_INT(setop1, x1);
  DECLARE_VECTOR(v2, x2);
  int noOfVars2 = v2->GetLength();
  IntVarArgs vars2(noOfVars2);
  for (int i=noOfVars2; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v2->Sub(i));
    vars2[i] = tmp;
  }
  DECLARE_SETVAR(var3, s, stamp, pstamp, x3);
  try {
    rel(s,UnsafeGecode::int2setoptype[setop1],vars2,var3);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE6(set_relCSS) {
  DBGMSG("set_relCSS");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfPairs1 = v1->GetLength();
  int pairs1[noOfPairs1][2];

  {
  int lastMax = Limits::Set::int_min-1;
  for (int j=0; j<noOfPairs1; j++) {
    DECLARE_TUPLE(tmp, v1->Sub(j));
    DECLARE_INT(tmp0, tmp->Sel(0));
    DECLARE_INT(tmp1, tmp->Sel(1));
    if (tmp0>tmp1 || tmp0<=lastMax)
      RAISE(UnsafeGecode::InvalidDomainConstructor);
    lastMax = tmp1;
    pairs1[j][0] = tmp0;
    pairs1[j][1] = tmp1;
  }
  }
  IntSet ds1(pairs1, noOfPairs1);
  DECLARE_INT(setop2, x2);
  DECLARE_SETVAR(var3, s, stamp, pstamp, x3);
  DECLARE_INT(setrel4, x4);
  DECLARE_SETVAR(var5, s, stamp, pstamp, x5);
  try {
    rel(s,ds1,UnsafeGecode::int2setoptype[setop2],var3,UnsafeGecode::int2setreltype[setrel4],var5);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE6(set_relSCS) {
  DBGMSG("set_relSCS");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_SETVAR(var1, s, stamp, pstamp, x1);
  DECLARE_INT(setop2, x2);
  DECLARE_VECTOR(v3, x3);
  int noOfPairs3 = v3->GetLength();
  int pairs3[noOfPairs3][2];

  {
  int lastMax = Limits::Set::int_min-1;
  for (int j=0; j<noOfPairs3; j++) {
    DECLARE_TUPLE(tmp, v3->Sub(j));
    DECLARE_INT(tmp0, tmp->Sel(0));
    DECLARE_INT(tmp1, tmp->Sel(1));
    if (tmp0>tmp1 || tmp0<=lastMax)
      RAISE(UnsafeGecode::InvalidDomainConstructor);
    lastMax = tmp1;
    pairs3[j][0] = tmp0;
    pairs3[j][1] = tmp1;
  }
  }
  IntSet ds3(pairs3, noOfPairs3);
  DECLARE_INT(setrel4, x4);
  DECLARE_SETVAR(var5, s, stamp, pstamp, x5);
  try {
    rel(s,var1,UnsafeGecode::int2setoptype[setop2],ds3,UnsafeGecode::int2setreltype[setrel4],var5);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE6(set_relSSC) {
  DBGMSG("set_relSSC");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_SETVAR(var1, s, stamp, pstamp, x1);
  DECLARE_INT(setop2, x2);
  DECLARE_SETVAR(var3, s, stamp, pstamp, x3);
  DECLARE_INT(setrel4, x4);
  DECLARE_VECTOR(v5, x5);
  int noOfPairs5 = v5->GetLength();
  int pairs5[noOfPairs5][2];

  {
  int lastMax = Limits::Set::int_min-1;
  for (int j=0; j<noOfPairs5; j++) {
    DECLARE_TUPLE(tmp, v5->Sub(j));
    DECLARE_INT(tmp0, tmp->Sel(0));
    DECLARE_INT(tmp1, tmp->Sel(1));
    if (tmp0>tmp1 || tmp0<=lastMax)
      RAISE(UnsafeGecode::InvalidDomainConstructor);
    lastMax = tmp1;
    pairs5[j][0] = tmp0;
    pairs5[j][1] = tmp1;
  }
  }
  IntSet ds5(pairs5, noOfPairs5);
  try {
    rel(s,var1,UnsafeGecode::int2setoptype[setop2],var3,UnsafeGecode::int2setreltype[setrel4],ds5);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE6(set_relCCS) {
  DBGMSG("set_relCCS");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfPairs1 = v1->GetLength();
  int pairs1[noOfPairs1][2];

  {
  int lastMax = Limits::Set::int_min-1;
  for (int j=0; j<noOfPairs1; j++) {
    DECLARE_TUPLE(tmp, v1->Sub(j));
    DECLARE_INT(tmp0, tmp->Sel(0));
    DECLARE_INT(tmp1, tmp->Sel(1));
    if (tmp0>tmp1 || tmp0<=lastMax)
      RAISE(UnsafeGecode::InvalidDomainConstructor);
    lastMax = tmp1;
    pairs1[j][0] = tmp0;
    pairs1[j][1] = tmp1;
  }
  }
  IntSet ds1(pairs1, noOfPairs1);
  DECLARE_INT(setop2, x2);
  DECLARE_VECTOR(v3, x3);
  int noOfPairs3 = v3->GetLength();
  int pairs3[noOfPairs3][2];

  {
  int lastMax = Limits::Set::int_min-1;
  for (int j=0; j<noOfPairs3; j++) {
    DECLARE_TUPLE(tmp, v3->Sub(j));
    DECLARE_INT(tmp0, tmp->Sel(0));
    DECLARE_INT(tmp1, tmp->Sel(1));
    if (tmp0>tmp1 || tmp0<=lastMax)
      RAISE(UnsafeGecode::InvalidDomainConstructor);
    lastMax = tmp1;
    pairs3[j][0] = tmp0;
    pairs3[j][1] = tmp1;
  }
  }
  IntSet ds3(pairs3, noOfPairs3);
  DECLARE_INT(setrel4, x4);
  DECLARE_SETVAR(var5, s, stamp, pstamp, x5);
  try {
    rel(s,ds1,UnsafeGecode::int2setoptype[setop2],ds3,UnsafeGecode::int2setreltype[setrel4],var5);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE6(set_relCSC) {
  DBGMSG("set_relCSC");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfPairs1 = v1->GetLength();
  int pairs1[noOfPairs1][2];

  {
  int lastMax = Limits::Set::int_min-1;
  for (int j=0; j<noOfPairs1; j++) {
    DECLARE_TUPLE(tmp, v1->Sub(j));
    DECLARE_INT(tmp0, tmp->Sel(0));
    DECLARE_INT(tmp1, tmp->Sel(1));
    if (tmp0>tmp1 || tmp0<=lastMax)
      RAISE(UnsafeGecode::InvalidDomainConstructor);
    lastMax = tmp1;
    pairs1[j][0] = tmp0;
    pairs1[j][1] = tmp1;
  }
  }
  IntSet ds1(pairs1, noOfPairs1);
  DECLARE_INT(setop2, x2);
  DECLARE_SETVAR(var3, s, stamp, pstamp, x3);
  DECLARE_INT(setrel4, x4);
  DECLARE_VECTOR(v5, x5);
  int noOfPairs5 = v5->GetLength();
  int pairs5[noOfPairs5][2];

  {
  int lastMax = Limits::Set::int_min-1;
  for (int j=0; j<noOfPairs5; j++) {
    DECLARE_TUPLE(tmp, v5->Sub(j));
    DECLARE_INT(tmp0, tmp->Sel(0));
    DECLARE_INT(tmp1, tmp->Sel(1));
    if (tmp0>tmp1 || tmp0<=lastMax)
      RAISE(UnsafeGecode::InvalidDomainConstructor);
    lastMax = tmp1;
    pairs5[j][0] = tmp0;
    pairs5[j][1] = tmp1;
  }
  }
  IntSet ds5(pairs5, noOfPairs5);
  try {
    rel(s,ds1,UnsafeGecode::int2setoptype[setop2],var3,UnsafeGecode::int2setreltype[setrel4],ds5);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE6(set_relSCC) {
  DBGMSG("set_relSCC");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_SETVAR(var1, s, stamp, pstamp, x1);
  DECLARE_INT(setop2, x2);
  DECLARE_VECTOR(v3, x3);
  int noOfPairs3 = v3->GetLength();
  int pairs3[noOfPairs3][2];

  {
  int lastMax = Limits::Set::int_min-1;
  for (int j=0; j<noOfPairs3; j++) {
    DECLARE_TUPLE(tmp, v3->Sub(j));
    DECLARE_INT(tmp0, tmp->Sel(0));
    DECLARE_INT(tmp1, tmp->Sel(1));
    if (tmp0>tmp1 || tmp0<=lastMax)
      RAISE(UnsafeGecode::InvalidDomainConstructor);
    lastMax = tmp1;
    pairs3[j][0] = tmp0;
    pairs3[j][1] = tmp1;
  }
  }
  IntSet ds3(pairs3, noOfPairs3);
  DECLARE_INT(setrel4, x4);
  DECLARE_VECTOR(v5, x5);
  int noOfPairs5 = v5->GetLength();
  int pairs5[noOfPairs5][2];

  {
  int lastMax = Limits::Set::int_min-1;
  for (int j=0; j<noOfPairs5; j++) {
    DECLARE_TUPLE(tmp, v5->Sub(j));
    DECLARE_INT(tmp0, tmp->Sel(0));
    DECLARE_INT(tmp1, tmp->Sel(1));
    if (tmp0>tmp1 || tmp0<=lastMax)
      RAISE(UnsafeGecode::InvalidDomainConstructor);
    lastMax = tmp1;
    pairs5[j][0] = tmp0;
    pairs5[j][1] = tmp1;
  }
  }
  IntSet ds5(pairs5, noOfPairs5);
  try {
    rel(s,var1,UnsafeGecode::int2setoptype[setop2],ds3,UnsafeGecode::int2setreltype[setrel4],ds5);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE2(set_convex) {
  DBGMSG("set_convex");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_SETVAR(var1, s, stamp, pstamp, x1);
  try {
    convex(s,var1);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE3(set_convexHull) {
  DBGMSG("set_convexHull");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_SETVAR(var1, s, stamp, pstamp, x1);
  DECLARE_SETVAR(var2, s, stamp, pstamp, x2);
  try {
    convexHull(s,var1,var2);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE2(set_seq) {
  DBGMSG("set_seq");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  SetVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_SETVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  try {
    sequence(s,vars1);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE3(set_seqU) {
  DBGMSG("set_seqU");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  SetVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_SETVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  DECLARE_SETVAR(var2, s, stamp, pstamp, x2);
  try {
    sequentialUnion(s,vars1,var2);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE3(set_min) {
  DBGMSG("set_min");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_SETVAR(var1, s, stamp, pstamp, x1);
  DECLARE_INTVAR(var2, s, stamp, pstamp, x2);
  try {
    min(s,var1,var2);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE3(set_max) {
  DBGMSG("set_max");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_SETVAR(var1, s, stamp, pstamp, x1);
  DECLARE_INTVAR(var2, s, stamp, pstamp, x2);
  try {
    max(s,var1,var2);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE3(set_match) {
  DBGMSG("set_match");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_SETVAR(var1, s, stamp, pstamp, x1);
  DECLARE_VECTOR(v2, x2);
  int noOfVars2 = v2->GetLength();
  IntVarArgs vars2(noOfVars2);
  for (int i=noOfVars2; i--;) {
    DECLARE_INTVAR(tmp, s, stamp, pstamp, v2->Sub(i));
    vars2[i] = tmp;
  }
  try {
    match(s,var1,vars2);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE3(set_cardinality) {
  DBGMSG("set_cardinality");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_SETVAR(var1, s, stamp, pstamp, x1);
  DECLARE_INTVAR(var2, s, stamp, pstamp, x2);
  try {
    cardinality(s,var1,var2);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE4(set_selectUnion) {
  DBGMSG("set_selectUnion");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  SetVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_SETVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  DECLARE_SETVAR(var2, s, stamp, pstamp, x2);
  DECLARE_SETVAR(var3, s, stamp, pstamp, x3);
  try {
    selectUnion(s,vars1,var2,var3);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE4(set_selectInter) {
  DBGMSG("set_selectInter");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  SetVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_SETVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  DECLARE_SETVAR(var2, s, stamp, pstamp, x2);
  DECLARE_SETVAR(var3, s, stamp, pstamp, x3);
  try {
    selectInter(s,vars1,var2,var3);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE5(set_selectInterIn) {
  DBGMSG("set_selectInterIn");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  SetVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_SETVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  DECLARE_SETVAR(var2, s, stamp, pstamp, x2);
  DECLARE_SETVAR(var3, s, stamp, pstamp, x3);
  DECLARE_VECTOR(v4, x4);
  int noOfPairs4 = v4->GetLength();
  int pairs4[noOfPairs4][2];

  {
  int lastMax = Limits::Set::int_min-1;
  for (int j=0; j<noOfPairs4; j++) {
    DECLARE_TUPLE(tmp, v4->Sub(j));
    DECLARE_INT(tmp0, tmp->Sel(0));
    DECLARE_INT(tmp1, tmp->Sel(1));
    if (tmp0>tmp1 || tmp0<=lastMax)
      RAISE(UnsafeGecode::InvalidDomainConstructor);
    lastMax = tmp1;
    pairs4[j][0] = tmp0;
    pairs4[j][1] = tmp1;
  }
  }
  IntSet ds4(pairs4, noOfPairs4);
  try {
    selectInterIn(s,vars1,var2,var3,ds4);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE3(set_selectDisjoint) {
  DBGMSG("set_selectDisjoint");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  SetVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_SETVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  DECLARE_SETVAR(var2, s, stamp, pstamp, x2);
  try {
    selectDisjoint(s,vars1,var2);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE4(set_selectSets) {
  DBGMSG("set_selectSets");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  SetVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_SETVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  DECLARE_INTVAR(var2, s, stamp, pstamp, x2);
  DECLARE_SETVAR(var3, s, stamp, pstamp, x3);
  try {
    selectSet(s,vars1,var2,var3);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

DEFINE4(set_branch) {
  DBGMSG("set_branch");
  DECLARE_SPACE(s, stamp, pstamp, x0);
  CHECK_SPACE(s);
  DECLARE_VECTOR(v1, x1);
  int noOfVars1 = v1->GetLength();
  SetVarArgs vars1(noOfVars1);
  for (int i=noOfVars1; i--;) {
    DECLARE_SETVAR(tmp, s, stamp, pstamp, v1->Sub(i));
    vars1[i] = tmp;
  }
  DECLARE_INT(varValSel2, x2);
  DECLARE_INT(varValSel3, x3);
  try {
    branch(s,vars1,UnsafeGecode::int2fsbvarsel[varValSel2],UnsafeGecode::int2fsbvalsel[varValSel3]);
    RETURN_UNIT;
  } catch (Exception e) {
    RAISE(UnsafeGecode::InternalExceptionConstructor);
  }
} END

word InitComponent() {
  UnsafeGecode::init();
  Record *record = Record::New(110);
  record->Init("'InvalidSpace", UnsafeGecode::InvalidSpaceConstructor);
  record->Init("InvalidSpace", UnsafeGecode::InvalidSpaceConstructor);
  record->Init("'InvalidVar", UnsafeGecode::InvalidVarConstructor);
  record->Init("InvalidVar", UnsafeGecode::InvalidVarConstructor);
  record->Init("'InvalidDomain", UnsafeGecode::InvalidDomainConstructor);
  record->Init("InvalidDomain", UnsafeGecode::InvalidDomainConstructor);
  record->Init("'Description", UnsafeGecode::DescriptionConstructor);
  record->Init("Description", UnsafeGecode::DescriptionConstructor);
  record->Init("'InternalException", UnsafeGecode::InternalExceptionConstructor);
  record->Init("InternalException", UnsafeGecode::InternalExceptionConstructor);
  INIT_STRUCTURE(record, "UnsafeGecode", "makespace",
                 makespace, 0);
  INIT_STRUCTURE(record, "UnsafeGecode", "status",
                 status, 1);
  INIT_STRUCTURE(record, "UnsafeGecode", "clone",
                 clone, 1);
  INIT_STRUCTURE(record, "UnsafeGecode", "discard",
                 discard, 1);
  INIT_STRUCTURE(record, "UnsafeGecode", "alive",
                 alive, 1);
  INIT_STRUCTURE(record, "UnsafeGecode", "fail",
                 fail, 1);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_getRanges",
                 int_getRanges, 2);
  INIT_STRUCTURE(record, "UnsafeGecode", "new_intvar",
                 new_intvar, 2);
  INIT_STRUCTURE(record, "UnsafeGecode", "new_boolvar",
                 new_boolvar, 1);
  INIT_STRUCTURE(record, "UnsafeGecode", "new_setvar",
                 new_setvar, 1);
  INIT_STRUCTURE(record, "UnsafeGecode", "commit",
                 commit, 3);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_getMin",
                 int_getMin, 2);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_getMax",
                 int_getMax, 2);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_getMed",
                 int_getMed, 2);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_getDomainSize",
                 int_getDomainSize, 2);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_isRange",
                 int_isRange, 2);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_isAssigned",
                 int_isAssigned, 2);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_getUpperBound",
                 set_getUpperBound, 2);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_getLowerBound",
                 set_getLowerBound, 2);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_getUpperBoundSize",
                 set_getUpperBoundSize, 2);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_getLowerBoundSize",
                 set_getLowerBoundSize, 2);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_getUnknownSize",
                 set_getUnknownSize, 2);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_getUnknown",
                 set_getUnknown, 2);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_getCardinalityMin",
                 set_getCardinalityMin, 2);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_getCardinalityMax",
                 set_getCardinalityMax, 2);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_isAssigned",
                 set_isAssigned, 2);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_dom",
                 int_dom, 3);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_domR",
                 int_domR, 4);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_rel",
                 int_rel, 4);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_relI",
                 int_relI, 4);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_relR",
                 int_relR, 5);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_relIR",
                 int_relIR, 5);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_eq",
                 int_eq, 4);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_eqV",
                 int_eqV, 3);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_eqR",
                 int_eqR, 5);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_distinct",
                 int_distinct, 3);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_distinctI",
                 int_distinctI, 4);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_sortedness",
                 int_sortedness, 4);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_permsort",
                 int_permsort, 5);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_gcc1",
                 int_gcc1, 8);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_gcc2",
                 int_gcc2, 9);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_gcc3",
                 int_gcc3, 4);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_gcc4",
                 int_gcc4, 5);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_gcc5",
                 int_gcc5, 6);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_gcc6",
                 int_gcc6, 10);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_gcc7",
                 int_gcc7, 11);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_linear",
                 int_linear, 6);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_linearR",
                 int_linearR, 7);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_countII",
                 int_countII, 5);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_countIV",
                 int_countIV, 5);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_countVI",
                 int_countVI, 5);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_countVV",
                 int_countVV, 5);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_element",
                 int_element, 4);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_elementI",
                 int_elementI, 4);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_lex",
                 int_lex, 4);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_bool_not",
                 int_bool_not, 3);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_bool_and",
                 int_bool_and, 4);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_bool_or",
                 int_bool_or, 4);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_bool_imp",
                 int_bool_imp, 4);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_bool_eq",
                 int_bool_eq, 4);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_bool_xor",
                 int_bool_xor, 4);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_bool_andV",
                 int_bool_andV, 3);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_bool_orV",
                 int_bool_orV, 3);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_min",
                 int_min, 3);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_max",
                 int_max, 3);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_abs",
                 int_abs, 4);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_mult",
                 int_mult, 5);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_assign",
                 int_assign, 3);
  INIT_STRUCTURE(record, "UnsafeGecode", "int_branch",
                 int_branch, 4);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_dom",
                 set_dom, 4);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_domR",
                 set_domR, 5);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_cardRange",
                 set_cardRange, 4);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_rel",
                 set_rel, 4);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_relR",
                 set_relR, 5);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_relOp",
                 set_relOp, 6);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_relI",
                 set_relI, 4);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_relIR",
                 set_relIR, 5);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_relII",
                 set_relII, 4);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_relN",
                 set_relN, 4);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_relNI",
                 set_relNI, 4);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_relCSS",
                 set_relCSS, 6);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_relSCS",
                 set_relSCS, 6);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_relSSC",
                 set_relSSC, 6);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_relCCS",
                 set_relCCS, 6);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_relCSC",
                 set_relCSC, 6);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_relSCC",
                 set_relSCC, 6);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_convex",
                 set_convex, 2);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_convexHull",
                 set_convexHull, 3);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_seq",
                 set_seq, 2);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_seqU",
                 set_seqU, 3);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_min",
                 set_min, 3);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_max",
                 set_max, 3);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_match",
                 set_match, 3);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_cardinality",
                 set_cardinality, 3);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_selectUnion",
                 set_selectUnion, 4);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_selectInter",
                 set_selectInter, 4);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_selectInterIn",
                 set_selectInterIn, 5);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_selectDisjoint",
                 set_selectDisjoint, 3);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_selectSets",
                 set_selectSets, 4);
  INIT_STRUCTURE(record, "UnsafeGecode", "set_branch",
                 set_branch, 4);
  RETURN_STRUCTURE("UnsafeGecode$", record);
}
