From 1739529c8b43e08fe05d0af18c6a54465e8862b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Wed, 10 Apr 2019 18:51:40 +0100 Subject: [PATCH 01/29] recursuve_calling --- C/absmi.c | 3 +- C/absmi_insts.h | 5 +- C/c_interface.c | 150 +++++++++++++-------------------------- C/control_absmi_insts.h | 2 +- C/errors.c | 2 +- C/exec.c | 153 ++++++++++++++++++++++------------------ H/Yapproto.h | 2 +- info/build.sh | 2 +- 8 files changed, 140 insertions(+), 179 deletions(-) diff --git a/C/absmi.c b/C/absmi.c index 1ec017858..0f07a5186 100755 --- a/C/absmi.c +++ b/C/absmi.c @@ -1323,11 +1323,10 @@ Int Yap_absmi(int inp) { #endif /* USE_THREADED_CODE */ #if PUSH_REGS - old_regs = &Yap_REGS; + old_regs = Yap_regp; /* done, let us now initialize this space */ init_absmi_regs(&absmi_regs); - /* the registers are all set up, let's swap */ #ifdef THREADS pthread_setspecific(Yap_yaamregs_key, (const void *)&absmi_regs); diff --git a/C/absmi_insts.h b/C/absmi_insts.h index 5499274c2..abc14b919 100644 --- a/C/absmi_insts.h +++ b/C/absmi_insts.h @@ -9,7 +9,7 @@ #endif /* INDENT_CODE */ BOp(Ystop, l); - LOCAL_CBorder = 0; + // LOCAL_CBorder = 0; SET_ASP(YREG, E_CB * sizeof(CELL)); /* make sure ASP is initialized */ saveregs(); @@ -23,9 +23,10 @@ LOCAL_CBorder = 0; return 1; ENDBOp(); - + BOp(Nstop, e); SET_ASP(YREG, E_CB * sizeof(CELL)); + B = B->cp_b; saveregs(); #if PUSH_REGS restore_absmi_regs(old_regs); diff --git a/C/c_interface.c b/C/c_interface.c index 6d8c8549f..286e6ad61 100755 --- a/C/c_interface.c +++ b/C/c_interface.c @@ -1154,6 +1154,10 @@ static uintptr_t complete_exit(choiceptr ptr, int has_cp, X_API Int YAP_Execute(PredEntry *pe, CPredicate exec_code) { CACHE_REGS Int ret; + yamop *saved_p =P, *saved_cp = CP; + yhandle_t s0; + + Int saved_b = LCL0-(CELL*)B, saved_e = LCL0-ENV; Int OASP = LCL0 - (CELL *)B; // Term omod = CurrentModule; // if (pe->PredFlags & CArgsPredFlag) { @@ -1164,21 +1168,25 @@ X_API Int YAP_Execute(PredEntry *pe, CPredicate exec_code) { struct foreign_context ctx; ctx.engine = NULL; - yhandle_t s0 = Yap_InitSlots(pe->ArityOfPE, &ARG1); + s0 = Yap_InitSlots(pe->ArityOfPE, &ARG1); PP = pe; ret = codev(s0, 0, &ctx); } else if (pe->PredFlags & CArgsPredFlag) { PP = pe; + s0 = Yap_CurrentHandle(); ret = execute_cargs(pe, exec_code PASS_REGS); } else { + s0 = Yap_CurrentHandle(); PP = pe; ret = (exec_code)(PASS_REGS1); } PP = NULL; // check for junk: open frames, etc */ + Yap_closeGoal( ret, saved_p, saved_cp, saved_e, saved_b, s0, true); + return ret; if (ret) - complete_exit(((choiceptr)(LCL0 - OASP)), FALSE, FALSE PASS_REGS); - else + complete_exit(((choiceptr)(LCL0 - OASP)), FALSE, FALSE PASS_REGS); + else complete_fail(((choiceptr)(LCL0 - OASP)), FALSE PASS_REGS); // CurrentModule = omod; if (!ret) { @@ -1195,7 +1203,8 @@ X_API Int YAP_Execute(PredEntry *pe, CPredicate exec_code) { X_API Int YAP_ExecuteFirst(PredEntry *pe, CPredicate exec_code) { CACHE_REGS CELL ocp = LCL0 - (CELL *)B; - /* for slots to work */ + + /* for slots to work */ Int CurSlot = Yap_StartSlots(); if (pe->PredFlags & (SWIEnvPredFlag | CArgsPredFlag | ModuleTransparentPredFlag)) { @@ -1213,30 +1222,29 @@ X_API Int YAP_ExecuteFirst(PredEntry *pe, CPredicate exec_code) { } else { val = codev(Yap_InitSlots(pe->ArityOfPE, &ARG1), 0, ctx); } - Yap_CloseSlots(CurSlot); PP = NULL; - if (val == 0) { - if (Yap_RaiseException()) { - return false; + if (val == 0) { + if (Yap_RaiseException()) { + return false; + } + return complete_fail(((choiceptr)(LCL0 - ocp)), TRUE PASS_REGS); + } else if (val == 1) { /* TRUE */ + return complete_exit(((choiceptr)(LCL0 - ocp)), TRUE, FALSE PASS_REGS); + } else { + if ((val & REDO_PTR) == REDO_PTR) + ctx->context = (uintptr_t)(val & ~REDO_PTR); + else + ctx->context = (uintptr_t)((val & ~REDO_PTR) >> FRG_REDO_BITS); + /* fix dropped cps */ + return complete_exit(((choiceptr)(LCL0 - ocp)), FALSE, FALSE PASS_REGS); } - return complete_fail(((choiceptr)(LCL0 - ocp)), TRUE PASS_REGS); - } else if (val == 1) { /* TRUE */ - return complete_exit(((choiceptr)(LCL0 - ocp)), TRUE, FALSE PASS_REGS); - } else { - if ((val & REDO_PTR) == REDO_PTR) - ctx->context = (uintptr_t)(val & ~REDO_PTR); - else - ctx->context = (uintptr_t)((val & ~REDO_PTR) >> FRG_REDO_BITS); - /* fix dropped cps */ - return complete_exit(((choiceptr)(LCL0 - ocp)), FALSE, FALSE PASS_REGS); - } } else { - Int ret = (exec_code)(PASS_REGS1); - Yap_CloseSlots(CurSlot); - if (!ret) { - Yap_RaiseException(); - } - return ret; + Int ret = (exec_code)(PASS_REGS1); + Yap_CloseSlots(CurSlot); + if (!ret) { + Yap_RaiseException(); + } + return ret; } } @@ -1756,8 +1764,8 @@ X_API bool YAP_EnterGoal(YAP_PredEntryPtr ape, CELL *ptr, YAP_dogoalinfo *dgi) { CACHE_REGS PredEntry *pe = ape; bool out; - fprintf(stderr,"EnterGoal: H=%ld ENV=%ld B=%ld TR=%ld P=%p CP=%p, Slots=%ld\n",HR-H0,LCL0-ENV,LCL0-(CELL*)B,(CELL*)TR-LCL0, P, CP, - LOCAL_CurSlot); +// fprintf(stderr,"EnterGoal: H=%ld ENV=%ld B=%ld TR=%ld P=%p CP=%p, Slots=%ld\n",HR-H0,LCL0-ENV,LCL0-(CELL*)B,(CELL*)TR-LCL0, P, CP, +// LOCAL_CurSlot); BACKUP_MACHINE_REGS(); LOCAL_ActiveError->errorNo = YAP_NO_ERROR; @@ -1822,7 +1830,7 @@ X_API bool YAP_RetryGoal(YAP_dogoalinfo *dgi) { out = Yap_exec_absmi(true, true ); if (out) { dgi->EndSlot = LOCAL_CurSlot; - dgi->b = myB; + dgi->b = LCL0-(CELL*)myB; } else { LOCAL_CurSlot = dgi->CurSlot; // ignore any slots created within the called goal @@ -1833,45 +1841,16 @@ X_API bool YAP_RetryGoal(YAP_dogoalinfo *dgi) { X_API bool YAP_LeaveGoal(bool successful, YAP_dogoalinfo *dgi) { CACHE_REGS - choiceptr myB, handler; // fprintf(stderr,"LeaveGoal success=%ld: H=%d ENV=%p B=%ldd myB=%ldd TR=%ld // P=%p CP=%p Slots=%ld\n", // successful,HR-H0,LCL0-ENV,LCL0-(CELL*)B,dgi->b0,(CELL*)TR-LCL0, P, CP, // LOCAL_CurSlot); BACKUP_MACHINE_REGS(); - myB = (choiceptr)(LCL0 - dgi->b); - if (LOCAL_PrologMode & AsyncIntMode) { - Yap_signal(YAP_FAIL_SIGNAL); - } - handler = B; - while (handler && - LCL0 - LOCAL_CBorder > (CELL *)handler - //&& handler->cp_ap != NOCODE - && handler->cp_b != NULL && handler != myB) { - if (handler < myB) { - handler->cp_ap = TRUSTFAILCODE; - } - B = handler; - handler = handler->cp_b; - if (successful) { - Yap_TrimTrail(); - } else if (!(LOCAL_PrologMode & AsyncIntMode)) { - P = FAILCODE; - Yap_exec_absmi(true, YAP_EXEC_ABSMI); - } - } - if (LOCAL_PrologMode & AsyncIntMode) { - Yap_signal(YAP_FAIL_SIGNAL); - } - P = dgi->p; - CP = dgi->cp; - ENV = LCL0-dgi->e; - ASP = LCL0-dgi->a; - B = (choiceptr)(LCL0-dgi->b) + Yap_closeGoal(successful, dgi->p, dgi->cp, dgi->b, dgi->e, dgi->CurSlot, true); RECOVER_MACHINE_REGS(); - fprintf(stderr,"LeftGoal success=%ld: H=%ld ENV=%ld B=%ld TR=%ld P=%p CP=%p, Slots=%ld\n", successful,HR-H0,LCL0-ENV,LCL0-(CELL*)B,(CELL*)TR-LCL0, P, - CP, LOCAL_CurSlot); +// fprintf(stderr,"LeftGoal success=%d: H=%ld ENV=%ld B=%ld TR=%ld P=%p CP=%p, Slots=%ld\n", successful,HR-H0,LCL0-ENV,LCL0-(CELL*)B,(CELL*)TR-LCL0, P, +// CP, LOCAL_CurSlot); return TRUE; } @@ -1963,12 +1942,15 @@ X_API Int YAP_RunGoalOnce(Term t) { CACHE_REGS Term out; yamop *old_CP = CP; + yamop *old_P = P; + Int old_ENV = LCL0-ENV; + Int old_B =LCL0-(CELL*) B; + /* Int old_B = LCL0-(CELL*)B */; Int oldPrologMode = LOCAL_PrologMode; - yhandle_t CSlot; + yhandle_t h = Yap_CurrentHandle(); BACKUP_MACHINE_REGS(); - CSlot = Yap_StartSlots(); - LOCAL_PrologMode = UserMode; + LOCAL_PrologMode = UserMode; // Yap_heap_regs->yap_do_low_level_trace=true; out = Yap_RunTopGoal(t, true); LOCAL_PrologMode = oldPrologMode; @@ -1979,47 +1961,13 @@ X_API Int YAP_RunGoalOnce(Term t) { RECOVER_MACHINE_REGS(); return out; } - // should we catch the exception or pass it through? - // We'll pass it through - // Yap_RaiseException(); - if (out) { - choiceptr cut_pt, ob; - - ob = NULL; - cut_pt = B; - while (cut_pt->cp_ap != NOCODE) { - /* make sure we prune C-choicepoints */ - if (POP_CHOICE_POINT(cut_pt->cp_b)) { - POP_EXECUTE(); - } - ob = cut_pt; - cut_pt = cut_pt->cp_b; - } -#ifdef YAPOR - CUT_prune_to(cut_pt); -#endif - if (ob) { - B = ob; - Yap_TrimTrail(); - } - B = cut_pt; - } else { - Yap_CloseSlots(CSlot); - } - ASP = B->cp_env; - ENV = (CELL *)ASP[E_E]; - B = (choiceptr)ASP[E_CB]; -#ifdef DEPTH_LIMITxs - DEPTH = ASP[E_DEPTH]; -#endif - P = (yamop *)ASP[E_CP]; - CP = old_CP; - LOCAL_AllowRestart = FALSE; - RECOVER_MACHINE_REGS(); + Yap_closeGoal( out, old_P, old_CP, old_ENV, old_B, h, true); return out; } -X_API bool YAP_RestartGoal(void) { + + X_API +bool YAP_RestartGoal(void) { CACHE_REGS BACKUP_MACHINE_REGS(); bool out; diff --git a/C/control_absmi_insts.h b/C/control_absmi_insts.h index 59469248e..483609e1b 100644 --- a/C/control_absmi_insts.h +++ b/C/control_absmi_insts.h @@ -1,4 +1,4 @@ -/************************************************************************\ +/************************************************************************ \ * Cut & Commit Inst ructions * diff --git a/C/errors.c b/C/errors.c index 791113072..dae0a41bb 100755 --- a/C/errors.c +++ b/C/errors.c @@ -1254,7 +1254,7 @@ static Int is_callable(USES_REGS1) { // Term Context = Deref(ARG2); while (true) { if (IsVarTerm(G)) { - Yap_ThrowError(INSTANTIATION_ERROR, G, NULL); + //Yap_ThrowError(INSTANTIATION_ERROR, G, NULL); return false; } if (IsApplTerm(G)) { diff --git a/C/exec.c b/C/exec.c index f332fd307..2f10a7794 100755 --- a/C/exec.c +++ b/C/exec.c @@ -831,6 +831,7 @@ static void prune_inner_computation(choiceptr parent) { * @method complete_inner_computation */ static void complete_inner_computation(choiceptr old_B) { + return; choiceptr myB = B; if (myB == NULL) { return; @@ -1062,9 +1063,7 @@ static Int cleanup_on_exit(USES_REGS1) { complete_pt[0] = TermExit; } Yap_ignore(cleanup, false); - if (B0->cp_ap == NOCODE) - B0->cp_ap = TRUSTFAILCODE; - if (Yap_RaiseException()) { + if (Yap_RaiseException()) { return false; } return true; @@ -1097,7 +1096,7 @@ static Int _user_expand_goal(USES_REGS1) { pe->OpcodeOfPred != FAIL_OPCODE && pe->OpcodeOfPred != UNDEF_OPCODE && Yap_execute_pred(pe, NULL, false PASS_REGS)) { return complete_ge(true , omod, sl, creeping); - } + }; /* system:goal_expansion(A,B) */ mg_args[0] = cmod; mg_args[1] = Yap_GetFromSlot(h1); @@ -1567,11 +1566,9 @@ static bool exec_absmi(bool top, yap_reset_t reset_mode USES_REGS) { /* can be called from anywhere, must reset registers, */ // LOCAL_ActiveError = err_info; - while (B) { + if (B) { LOCAL_ActiveError->errorNo = ABORT_EVENT; - pop_text_stack(i + 1); - Yap_CloseSlots(sls); - Yap_JumpToEnv(); + Yap_JumpToEnv(); } LOCAL_PrologMode = UserMode; LOCAL_DoingUndefp = false; @@ -1739,20 +1736,7 @@ void Yap_fail_all(choiceptr bb USES_REGS) { P = saved_p; } -bool Yap_execute_pred(PredEntry *ppe, CELL *pt, bool pass_ex USES_REGS) { - yamop *saved_p, *saved_cp; - yamop *CodeAdr; - bool out; - - saved_p = P; - saved_cp = CP; - LOCAL_PrologMode |= TopGoalMode; - - PELOCK(81, ppe); - CodeAdr = ppe->CodeOfPred; - UNLOCK(ppe->PELock); - out = do_goal(CodeAdr, ppe->ArityOfPE, pt, false PASS_REGS); - +void Yap_closeGoal(bool out, yamop *saved_p, yamop * saved_cp, Int saved_e, Int saved_b, yhandle_t bnd, bool pass_ex) { if (out) { choiceptr cut_B; /* we succeeded, let's prune */ @@ -1764,69 +1748,89 @@ bool Yap_execute_pred(PredEntry *ppe, CELL *pt, bool pass_ex USES_REGS) { #endif /* YAPOR */ #ifdef TABLING if (B != cut_B) { + while (B->cp_b < cut_B) { - B = B->cp_b; - } + if (B->cp_ap == NOCODE) + break; + B = B->cp_b; #ifdef TABLING abolish_incomplete_subgoals(B); #endif } + } #endif /* TABLING */ - B = cut_B; + B = (choiceptr)(LCL0-saved_b); CP = saved_cp; P = saved_p; ASP = ENV; + ENV = LCL0-saved_e; #ifdef DEPTH_LIMIT DEPTH = ENV[E_DEPTH]; #endif - ENV = (CELL *)(ENV[E_E]); /* we have failed, and usually we would backtrack to this B, trouble is, we may also have a delayed cut to do */ - if (B != NULL) - HB = B->cp_h; + if (B != NULL) { + HB = B->cp_h; + Yap_TrimTrail(); + } YENV = ENV; + } else if (out == 0) { + /* ASP should be set to the top of the local stack when we + did the call */ + choiceptr b0 =(choiceptr)(LCL0-saved_b); + while (B && B < b0 && B->cp_ap !=NOCODE) { + B->cp_ap = TRUSTFAILCODE; + B = B->cp_b; + } + if (Bcp_depth; +#endif + P = saved_p; + CP = saved_cp; + + /* YENV should be set to the current environment */ + YENV = ENV = LCL0-saved_e; + SET_BB(B); + HB = PROTECT_FROZEN_H(B); + } else { + Yap_ThrowError(SYSTEM_ERROR_INTERNAL, TermNil, "emulator crashed"); + } // should we catch the exception or pass it through? // We'll pass it through if ( Yap_HasException()) { - if (pass_ex && - ((LOCAL_PrologMode & BootMode) || !CurrentModule )) { - Yap_ResetException(LOCAL_ActiveError); - } else { - Yap_RaiseException(); - } - return false; + if (pass_ex) { + if ((LOCAL_PrologMode & BootMode) || !CurrentModule) { + Yap_ResetException(LOCAL_ActiveError); + } else { + Yap_RaiseException(); + } + } else { + Yap_ResetException(LOCAL_ActiveError); + } } - return true; - } else if (out == 0) { - P = saved_p; - CP = saved_cp; - HR = B->cp_h; -#ifdef DEPTH_LIMIT - DEPTH = B->cp_depth; -#endif - /* ASP should be set to the top of the local stack when we - did the call */ - ASP = B->cp_env; - /* YENV should be set to the current environment */ - YENV = ENV = (CELL *)((B->cp_env)[E_E]); - B = B->cp_b; - SET_BB(B); - HB = PROTECT_FROZEN_H(B); - // should we catch the exception or pass it through? - // We'll pass it through - if ( Yap_HasException()) { - if (pass_ex && - ((LOCAL_PrologMode & BootMode) || !CurrentModule )) { - Yap_ResetException(LOCAL_ActiveError); - } else { - Yap_RaiseException(); - } - } - return false; - } else { - Yap_ThrowError(SYSTEM_ERROR_INTERNAL, TermNil, "emulator crashed"); - return false; - } +} + +bool Yap_execute_pred(PredEntry *ppe, CELL *pt, bool pass_ex USES_REGS) { + yamop *saved_p, *saved_cp; + yamop *CodeAdr; + + yhandle_t curh = Yap_CurrentHandle( ); + Int saved_b = LCL0-(CELL*)B, saved_e = LCL0-ENV; + saved_p = P; + saved_cp = CP; + LOCAL_PrologMode |= TopGoalMode; + + PELOCK(81, ppe); + CodeAdr = ppe->CodeOfPred; + UNLOCK(ppe->PELock); + bool out = do_goal(CodeAdr, ppe->ArityOfPE, pt, false PASS_REGS); + Yap_closeGoal( out, saved_p, saved_cp, saved_e, saved_b, curh, pass_ex); + return out; } bool Yap_execute_goal(Term t, int nargs, Term mod, bool pass_ex) { @@ -2078,7 +2082,7 @@ static Int clean_ifcp(USES_REGS1) { } B = B->cp_b; HB = B->cp_h; - } else { + } else if (pt0->cp_ap != NOCODE){ pt0->cp_ap = (yamop *)TRUSTFAILCODE; } return TRUE; @@ -2129,11 +2133,18 @@ bool Yap_Reset(yap_reset_t mode, bool hard) { Yap_ResetException(worker_id); /* first, backtrack to the root */ + choiceptr ob; + while (B) { - P = FAILCODE; - Yap_exec_absmi(true, mode); + ob = B; B = B->cp_b; } + + if (ob) { + B = ob; + P = FAILCODE; + Yap_exec_absmi(true, mode); + } /* reinitialize the engine */ Yap_InitYaamRegs(worker_id, false); GLOBAL_Initialised = true; @@ -2166,6 +2177,8 @@ bool is_cleanup_cp(choiceptr cp_b) { static Int JumpToEnv(USES_REGS1) { choiceptr handler = B; + if (B->cp_ap == NOCODE) + return false; /* just keep the throwm object away, we don't need to care about it */ /* careful, previous step may have caused a stack shift, @@ -2175,7 +2188,7 @@ static Int JumpToEnv(USES_REGS1) { while (handler && Yap_PredForChoicePt(handler, NULL) != PredDollarCatch && LOCAL_CBorder < LCL0 - (CELL *)handler && handler->cp_ap != NOCODE && handler->cp_b != NULL) { - handler->cp_ap = TRUSTFAILCODE; + handler->cp_ap = FAILCODE; handler = handler->cp_b; } if (LOCAL_PrologMode & AsyncIntMode) { diff --git a/H/Yapproto.h b/H/Yapproto.h index 1d2a87302..5e1999050 100755 --- a/H/Yapproto.h +++ b/H/Yapproto.h @@ -207,7 +207,7 @@ extern Term Yap_RunTopGoal(Term, bool); extern bool Yap_execute_goal(Term, int, Term, bool); extern bool Yap_exec_absmi(bool, yap_reset_t); extern void Yap_trust_last(void); - +extern void Yap_closeGoal(bool out, yamop *saved_p, yamop * saved_cp, Int saved_e, Int saved_b, yhandle_t hdl, bool pass_ex); extern void Yap_PrepGoal(UInt, CELL *, choiceptr USES_REGS); extern bool Yap_execute_pred(struct pred_entry *ppe, CELL *pt, bool pass_exception USES_REGS); diff --git a/info/build.sh b/info/build.sh index 98ccbf15e..bba74fa52 100644 --- a/info/build.sh +++ b/info/build.sh @@ -15,7 +15,7 @@ cd $PREFIX/conda $CMAKE --build=. --target=install \ -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_INSTALL_PREFIX="$PREFIX" \ - $RECIPE_DIR/.. + $RECIPE_DIR/.. -DWITH_CUDD=NO -DWITH_GECODE=NO -DWITH_JAVA=NO -DWITH_RAPTOR=NO make -j install From e7a2195af69e94e5a63384a3b9b8a03e57422ccc Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Fri, 12 Apr 2019 10:44:17 +0100 Subject: [PATCH 02/29] 6.1.1 --- packages/gecode/6.1.1/gecode-version.txt | 1 + .../6.1.1/gecode_yap_auto_generated.yap | 3685 +++++++++++ .../gecode_yap_cc_forward_auto_generated.icc | 28 + .../gecode_yap_cc_impl_auto_generated.icc | 5458 +++++++++++++++++ .../gecode_yap_cc_init_auto_generated.icc | 679 ++ packages/gecode/dev/extractor/Makefile | 1 - 6 files changed, 9851 insertions(+), 1 deletion(-) create mode 100644 packages/gecode/6.1.1/gecode-version.txt create mode 100644 packages/gecode/6.1.1/gecode_yap_auto_generated.yap create mode 100644 packages/gecode/6.1.1/gecode_yap_cc_forward_auto_generated.icc create mode 100644 packages/gecode/6.1.1/gecode_yap_cc_impl_auto_generated.icc create mode 100644 packages/gecode/6.1.1/gecode_yap_cc_init_auto_generated.icc diff --git a/packages/gecode/6.1.1/gecode-version.txt b/packages/gecode/6.1.1/gecode-version.txt new file mode 100644 index 000000000..f3b5af39e --- /dev/null +++ b/packages/gecode/6.1.1/gecode-version.txt @@ -0,0 +1 @@ +6.1.1 diff --git a/packages/gecode/6.1.1/gecode_yap_auto_generated.yap b/packages/gecode/6.1.1/gecode_yap_auto_generated.yap new file mode 100644 index 000000000..776541ba8 --- /dev/null +++ b/packages/gecode/6.1.1/gecode_yap_auto_generated.yap @@ -0,0 +1,3685 @@ +%% -*- prolog -*- +%%============================================================================= +%% Copyright (C) 2011 by Denys Duchier +%% +%% This program is free software: you can redistribute it and/or modify it +%% under the terms of the GNU Lesser General Public License as published by the +%% Free Software Foundation, either version 3 of the License, or (at your +%% option) any later version. +%% +%% This program is distributed in the hope that it will be useful, but WITHOUT +%% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +%% FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +%% more details. +%% +%% You should have received a copy of the GNU Lesser General Public License +%% along with this program. If not, see . +%%============================================================================= + +is_RestartMode_('RM_NONE'). +is_RestartMode_('RM_CONSTANT'). +is_RestartMode_('RM_LINEAR'). +is_RestartMode_('RM_LUBY'). +is_RestartMode_('RM_GEOMETRIC'). + + +is_RestartMode_('RM_NONE','RM_NONE'). +is_RestartMode_('RM_CONSTANT','RM_CONSTANT'). +is_RestartMode_('RM_LINEAR','RM_LINEAR'). +is_RestartMode_('RM_LUBY','RM_LUBY'). +is_RestartMode_('RM_GEOMETRIC','RM_GEOMETRIC'). + + +is_RestartMode(X,Y) :- nonvar(X), is_RestartMode_(X,Y). +is_RestartMode(X) :- is_RestartMode_(X,_). + + +is_FloatRelType_('FRT_EQ'). +is_FloatRelType_('FRT_NQ'). +is_FloatRelType_('FRT_LQ'). +is_FloatRelType_('FRT_LE'). +is_FloatRelType_('FRT_GQ'). +is_FloatRelType_('FRT_GR'). + + +is_FloatRelType_('FRT_EQ','FRT_EQ'). +is_FloatRelType_('FRT_NQ','FRT_NQ'). +is_FloatRelType_('FRT_LQ','FRT_LQ'). +is_FloatRelType_('FRT_LE','FRT_LE'). +is_FloatRelType_('FRT_GQ','FRT_GQ'). +is_FloatRelType_('FRT_GR','FRT_GR'). + + +is_FloatRelType(X,Y) :- nonvar(X), is_FloatRelType_(X,Y). +is_FloatRelType(X) :- is_FloatRelType_(X,_). + + +is_ReifyMode_('RM_EQV'). +is_ReifyMode_('RM_IMP'). +is_ReifyMode_('RM_PMI'). + + +is_ReifyMode_('RM_EQV','RM_EQV'). +is_ReifyMode_('RM_IMP','RM_IMP'). +is_ReifyMode_('RM_PMI','RM_PMI'). + + +is_ReifyMode(X,Y) :- nonvar(X), is_ReifyMode_(X,Y). +is_ReifyMode(X) :- is_ReifyMode_(X,_). + + +is_IntRelType_('IRT_EQ'). +is_IntRelType_('IRT_NQ'). +is_IntRelType_('IRT_LQ'). +is_IntRelType_('IRT_LE'). +is_IntRelType_('IRT_GQ'). +is_IntRelType_('IRT_GR'). + + +is_IntRelType_('IRT_EQ','IRT_EQ'). +is_IntRelType_('IRT_NQ','IRT_NQ'). +is_IntRelType_('IRT_LQ','IRT_LQ'). +is_IntRelType_('IRT_LE','IRT_LE'). +is_IntRelType_('IRT_GQ','IRT_GQ'). +is_IntRelType_('IRT_GR','IRT_GR'). + + +is_IntRelType(X,Y) :- nonvar(X), is_IntRelType_(X,Y). +is_IntRelType(X) :- is_IntRelType_(X,_). + + +is_BoolOpType_('BOT_AND'). +is_BoolOpType_('BOT_OR'). +is_BoolOpType_('BOT_IMP'). +is_BoolOpType_('BOT_EQV'). +is_BoolOpType_('BOT_XOR'). + + +is_BoolOpType_('BOT_AND','BOT_AND'). +is_BoolOpType_('BOT_OR','BOT_OR'). +is_BoolOpType_('BOT_IMP','BOT_IMP'). +is_BoolOpType_('BOT_EQV','BOT_EQV'). +is_BoolOpType_('BOT_XOR','BOT_XOR'). + + +is_BoolOpType(X,Y) :- nonvar(X), is_BoolOpType_(X,Y). +is_BoolOpType(X) :- is_BoolOpType_(X,_). + + +is_IntPropLevel_('IPL_DEF'). +is_IntPropLevel_('IPL_VAL'). +is_IntPropLevel_('IPL_BND'). +is_IntPropLevel_('IPL_DOM'). +is_IntPropLevel_('IPL_BASIC'). +is_IntPropLevel_('IPL_ADVANCED'). +is_IntPropLevel_('IPL_BASIC_ADVANCED'). + + +is_IntPropLevel_('IPL_DEF','IPL_DEF'). +is_IntPropLevel_('IPL_VAL','IPL_VAL'). +is_IntPropLevel_('IPL_BND','IPL_BND'). +is_IntPropLevel_('IPL_DOM','IPL_DOM'). +is_IntPropLevel_('IPL_BASIC','IPL_BASIC'). +is_IntPropLevel_('IPL_ADVANCED','IPL_ADVANCED'). +is_IntPropLevel_('IPL_BASIC_ADVANCED','IPL_BASIC_ADVANCED'). + + +is_IntPropLevel(X,Y) :- nonvar(X), is_IntPropLevel_(X,Y). +is_IntPropLevel(X) :- is_IntPropLevel_(X,_). + + +is_TaskType_('TT_FIXP'). +is_TaskType_('TT_FIXS'). +is_TaskType_('TT_FIXE'). + + +is_TaskType_('TT_FIXP','TT_FIXP'). +is_TaskType_('TT_FIXS','TT_FIXS'). +is_TaskType_('TT_FIXE','TT_FIXE'). + + +is_TaskType(X,Y) :- nonvar(X), is_TaskType_(X,Y). +is_TaskType(X) :- is_TaskType_(X,_). + + +is_TraceEvent_('TE_INIT'). +is_TraceEvent_('TE_PRUNE'). +is_TraceEvent_('TE_FIX'). +is_TraceEvent_('TE_FAIL'). +is_TraceEvent_('TE_DONE'). +is_TraceEvent_('TE_PROPAGATE'). +is_TraceEvent_('TE_COMMIT'). + + +is_TraceEvent_('TE_INIT','TE_INIT'). +is_TraceEvent_('TE_PRUNE','TE_PRUNE'). +is_TraceEvent_('TE_FIX','TE_FIX'). +is_TraceEvent_('TE_FAIL','TE_FAIL'). +is_TraceEvent_('TE_DONE','TE_DONE'). +is_TraceEvent_('TE_PROPAGATE','TE_PROPAGATE'). +is_TraceEvent_('TE_COMMIT','TE_COMMIT'). + + +is_TraceEvent(X,Y) :- nonvar(X), is_TraceEvent_(X,Y). +is_TraceEvent(X) :- is_TraceEvent_(X,_). + + +is_SetRelType_('SRT_EQ'). +is_SetRelType_('SRT_NQ'). +is_SetRelType_('SRT_SUB'). +is_SetRelType_('SRT_SUP'). +is_SetRelType_('SRT_DISJ'). +is_SetRelType_('SRT_CMPL'). +is_SetRelType_('SRT_LQ'). +is_SetRelType_('SRT_LE'). +is_SetRelType_('SRT_GQ'). +is_SetRelType_('SRT_GR'). + + +is_SetRelType_('SRT_EQ','SRT_EQ'). +is_SetRelType_('SRT_NQ','SRT_NQ'). +is_SetRelType_('SRT_SUB','SRT_SUB'). +is_SetRelType_('SRT_SUP','SRT_SUP'). +is_SetRelType_('SRT_DISJ','SRT_DISJ'). +is_SetRelType_('SRT_CMPL','SRT_CMPL'). +is_SetRelType_('SRT_LQ','SRT_LQ'). +is_SetRelType_('SRT_LE','SRT_LE'). +is_SetRelType_('SRT_GQ','SRT_GQ'). +is_SetRelType_('SRT_GR','SRT_GR'). + + +is_SetRelType(X,Y) :- nonvar(X), is_SetRelType_(X,Y). +is_SetRelType(X) :- is_SetRelType_(X,_). + + +is_SetOpType_('SOT_UNION'). +is_SetOpType_('SOT_DUNION'). +is_SetOpType_('SOT_INTER'). +is_SetOpType_('SOT_MINUS'). + + +is_SetOpType_('SOT_UNION','SOT_UNION'). +is_SetOpType_('SOT_DUNION','SOT_DUNION'). +is_SetOpType_('SOT_INTER','SOT_INTER'). +is_SetOpType_('SOT_MINUS','SOT_MINUS'). + + +is_SetOpType(X,Y) :- nonvar(X), is_SetOpType_(X,Y). +is_SetOpType(X) :- is_SetOpType_(X,_). + + +branch(X0,X1) :- + (is_Space_or_Clause(X0,Y0) + -> (is_std_function(X1,Y1) + -> gecode_constraint_branch_1(Y0,Y1) + ; throw(error(type_error('std::function'(X1)),gecode_argument_error(branch(X0,X1),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(branch(X0,X1),arg=1)))). + +convex(X0,X1) :- + (is_Space_or_Clause(X0,Y0) + -> (is_SetVar(X1,Y1) + -> gecode_constraint_convex_2(Y0,Y1) + ; throw(error(type_error('SetVar'(X1)),gecode_argument_error(convex(X0,X1),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(convex(X0,X1),arg=1)))). + +convex(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_SetVar(X1,Y1) + -> (is_SetVar(X2,Y2) + -> gecode_constraint_convex_3(Y0,Y1,Y2) + ; throw(error(type_error('SetVar'(X2)),gecode_argument_error(convex(X0,X1,X2),arg=3)))) + ; throw(error(type_error('SetVar'(X1)),gecode_argument_error(convex(X0,X1,X2),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(convex(X0,X1,X2),arg=1)))). + +abs(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_FloatVar(X1,Y1) + -> (is_FloatVar(X2,Y2) + -> gecode_constraint_abs_4(Y0,Y1,Y2) + ; throw(error(type_error('FloatVar'(X2)),gecode_argument_error(abs(X0,X1,X2),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> gecode_constraint_abs_5(Y0,Y1,Y2) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(abs(X0,X1,X2),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(abs(X0,X1,X2),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(abs(X0,X1,X2),arg=1)))). + +abs(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_abs_6(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(abs(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(abs(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(abs(X0,X1,X2,X3),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(abs(X0,X1,X2,X3),arg=1)))). + +argmax(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> gecode_constraint_argmax_7(Y0,Y1,Y2) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(argmax(X0,X1,X2),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(argmax(X0,X1,X2),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(argmax(X0,X1,X2),arg=1)))). + +argmax(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_bool(X3,Y3) + -> gecode_constraint_argmax_8(Y0,Y1,Y2,Y3) + ; throw(error(type_error(bool(X3)),gecode_argument_error(argmax(X0,X1,X2,X3),arg=4)))) + ; (is_int(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_argmax_10(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(argmax(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(argmax(X0,X1,X2,X3),arg=3))))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(argmax(X0,X1,X2,X3),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(argmax(X0,X1,X2,X3),arg=1)))). + +argmax(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_bool(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_argmax_9(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(argmax(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error(bool(X3)),gecode_argument_error(argmax(X0,X1,X2,X3,X4),arg=4)))) + ; (is_int(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_bool(X4,Y4) + -> gecode_constraint_argmax_11(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error(bool(X4)),gecode_argument_error(argmax(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(argmax(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(argmax(X0,X1,X2,X3,X4),arg=3))))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(argmax(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(argmax(X0,X1,X2,X3,X4),arg=1)))). + +argmax(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_bool(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_argmax_12(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(argmax(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error(bool(X4)),gecode_argument_error(argmax(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(argmax(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(argmax(X0,X1,X2,X3,X4,X5),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(argmax(X0,X1,X2,X3,X4,X5),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(argmax(X0,X1,X2,X3,X4,X5),arg=1)))). + +argmin(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> gecode_constraint_argmin_13(Y0,Y1,Y2) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(argmin(X0,X1,X2),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(argmin(X0,X1,X2),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(argmin(X0,X1,X2),arg=1)))). + +argmin(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_bool(X3,Y3) + -> gecode_constraint_argmin_14(Y0,Y1,Y2,Y3) + ; throw(error(type_error(bool(X3)),gecode_argument_error(argmin(X0,X1,X2,X3),arg=4)))) + ; (is_int(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_argmin_16(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(argmin(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(argmin(X0,X1,X2,X3),arg=3))))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(argmin(X0,X1,X2,X3),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(argmin(X0,X1,X2,X3),arg=1)))). + +argmin(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_bool(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_argmin_15(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(argmin(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error(bool(X3)),gecode_argument_error(argmin(X0,X1,X2,X3,X4),arg=4)))) + ; (is_int(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_bool(X4,Y4) + -> gecode_constraint_argmin_17(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error(bool(X4)),gecode_argument_error(argmin(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(argmin(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(argmin(X0,X1,X2,X3,X4),arg=3))))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(argmin(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(argmin(X0,X1,X2,X3,X4),arg=1)))). + +argmin(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_bool(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_argmin_18(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(argmin(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error(bool(X4)),gecode_argument_error(argmin(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(argmin(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(argmin(X0,X1,X2,X3,X4,X5),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(argmin(X0,X1,X2,X3,X4,X5),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(argmin(X0,X1,X2,X3,X4,X5),arg=1)))). + +assign(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVar(X1,Y1) + -> (is_BoolAssign(X2,Y2) + -> gecode_constraint_assign_19(Y0,Y1,Y2) + ; throw(error(type_error('BoolAssign'(X2)),gecode_argument_error(assign(X0,X1,X2),arg=3)))) + ; (is_FloatVar(X1,Y1) + -> (is_FloatAssign(X2,Y2) + -> gecode_constraint_assign_21(Y0,Y1,Y2) + ; throw(error(type_error('FloatAssign'(X2)),gecode_argument_error(assign(X0,X1,X2),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_IntAssign(X2,Y2) + -> gecode_constraint_assign_23(Y0,Y1,Y2) + ; throw(error(type_error('IntAssign'(X2)),gecode_argument_error(assign(X0,X1,X2),arg=3)))) + ; (is_SetVar(X1,Y1) + -> (is_SetAssign(X2,Y2) + -> gecode_constraint_assign_25(Y0,Y1,Y2) + ; throw(error(type_error('SetAssign'(X2)),gecode_argument_error(assign(X0,X1,X2),arg=3)))) + ; (is_BoolVarArgs(X1,Y1) + -> (is_BoolAssign(X2,Y2) + -> gecode_constraint_assign_27(Y0,Y1,Y2) + ; throw(error(type_error('BoolAssign'(X2)),gecode_argument_error(assign(X0,X1,X2),arg=3)))) + ; (is_FloatVarArgs(X1,Y1) + -> (is_FloatAssign(X2,Y2) + -> gecode_constraint_assign_30(Y0,Y1,Y2) + ; throw(error(type_error('FloatAssign'(X2)),gecode_argument_error(assign(X0,X1,X2),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntAssign(X2,Y2) + -> gecode_constraint_assign_33(Y0,Y1,Y2) + ; throw(error(type_error('IntAssign'(X2)),gecode_argument_error(assign(X0,X1,X2),arg=3)))) + ; (is_SetVarArgs(X1,Y1) + -> (is_SetAssign(X2,Y2) + -> gecode_constraint_assign_36(Y0,Y1,Y2) + ; throw(error(type_error('SetAssign'(X2)),gecode_argument_error(assign(X0,X1,X2),arg=3)))) + ; throw(error(type_error('SetVarArgs'(X1)),gecode_argument_error(assign(X0,X1,X2),arg=2))))))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(assign(X0,X1,X2),arg=1)))). + +assign(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVar(X1,Y1) + -> (is_BoolAssign(X2,Y2) + -> (is_BoolVarValPrint(X3,Y3) + -> gecode_constraint_assign_20(Y0,Y1,Y2,Y3) + ; throw(error(type_error('BoolVarValPrint'(X3)),gecode_argument_error(assign(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('BoolAssign'(X2)),gecode_argument_error(assign(X0,X1,X2,X3),arg=3)))) + ; (is_FloatVar(X1,Y1) + -> (is_FloatAssign(X2,Y2) + -> (is_FloatVarValPrint(X3,Y3) + -> gecode_constraint_assign_22(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatVarValPrint'(X3)),gecode_argument_error(assign(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('FloatAssign'(X2)),gecode_argument_error(assign(X0,X1,X2,X3),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_IntAssign(X2,Y2) + -> (is_IntVarValPrint(X3,Y3) + -> gecode_constraint_assign_24(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVarValPrint'(X3)),gecode_argument_error(assign(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntAssign'(X2)),gecode_argument_error(assign(X0,X1,X2,X3),arg=3)))) + ; (is_SetVar(X1,Y1) + -> (is_SetAssign(X2,Y2) + -> (is_SetVarValPrint(X3,Y3) + -> gecode_constraint_assign_26(Y0,Y1,Y2,Y3) + ; throw(error(type_error('SetVarValPrint'(X3)),gecode_argument_error(assign(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('SetAssign'(X2)),gecode_argument_error(assign(X0,X1,X2,X3),arg=3)))) + ; (is_BoolVarArgs(X1,Y1) + -> (is_BoolAssign(X2,Y2) + -> (is_BoolBranchFilter(X3,Y3) + -> gecode_constraint_assign_28(Y0,Y1,Y2,Y3) + ; throw(error(type_error('BoolBranchFilter'(X3)),gecode_argument_error(assign(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('BoolAssign'(X2)),gecode_argument_error(assign(X0,X1,X2,X3),arg=3)))) + ; (is_FloatVarArgs(X1,Y1) + -> (is_FloatAssign(X2,Y2) + -> (is_FloatBranchFilter(X3,Y3) + -> gecode_constraint_assign_31(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatBranchFilter'(X3)),gecode_argument_error(assign(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('FloatAssign'(X2)),gecode_argument_error(assign(X0,X1,X2,X3),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntAssign(X2,Y2) + -> (is_IntBranchFilter(X3,Y3) + -> gecode_constraint_assign_34(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntBranchFilter'(X3)),gecode_argument_error(assign(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntAssign'(X2)),gecode_argument_error(assign(X0,X1,X2,X3),arg=3)))) + ; (is_SetVarArgs(X1,Y1) + -> (is_SetAssign(X2,Y2) + -> (is_SetBranchFilter(X3,Y3) + -> gecode_constraint_assign_37(Y0,Y1,Y2,Y3) + ; throw(error(type_error('SetBranchFilter'(X3)),gecode_argument_error(assign(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('SetAssign'(X2)),gecode_argument_error(assign(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('SetVarArgs'(X1)),gecode_argument_error(assign(X0,X1,X2,X3),arg=2))))))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(assign(X0,X1,X2,X3),arg=1)))). + +assign(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_BoolAssign(X2,Y2) + -> (is_BoolBranchFilter(X3,Y3) + -> (is_BoolVarValPrint(X4,Y4) + -> gecode_constraint_assign_29(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('BoolVarValPrint'(X4)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('BoolBranchFilter'(X3)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('BoolAssign'(X2)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=3)))) + ; (is_FloatVarArgs(X1,Y1) + -> (is_FloatAssign(X2,Y2) + -> (is_FloatBranchFilter(X3,Y3) + -> (is_FloatVarValPrint(X4,Y4) + -> gecode_constraint_assign_32(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('FloatVarValPrint'(X4)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('FloatBranchFilter'(X3)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('FloatAssign'(X2)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntAssign(X2,Y2) + -> (is_IntBranchFilter(X3,Y3) + -> (is_IntVarValPrint(X4,Y4) + -> gecode_constraint_assign_35(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntVarValPrint'(X4)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntBranchFilter'(X3)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntAssign'(X2)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=3)))) + ; (is_SetVarArgs(X1,Y1) + -> (is_SetAssign(X2,Y2) + -> (is_SetBranchFilter(X3,Y3) + -> (is_SetVarValPrint(X4,Y4) + -> gecode_constraint_assign_38(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('SetVarValPrint'(X4)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('SetBranchFilter'(X3)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('SetAssign'(X2)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('SetVarArgs'(X1)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=2))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=1)))). + +binpacking(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> gecode_constraint_binpacking_39(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntArgs'(X3)),gecode_argument_error(binpacking(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(binpacking(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(binpacking(X0,X1,X2,X3),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(binpacking(X0,X1,X2,X3),arg=1)))). + +binpacking(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_binpacking_40(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(binpacking(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntArgs'(X3)),gecode_argument_error(binpacking(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(binpacking(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(binpacking(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(binpacking(X0,X1,X2,X3,X4),arg=1)))). + +branch(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVar(X1,Y1) + -> (is_BoolValBranch(X2,Y2) + -> gecode_constraint_branch_41(Y0,Y1,Y2) + ; throw(error(type_error('BoolValBranch'(X2)),gecode_argument_error(branch(X0,X1,X2),arg=3)))) + ; (is_FloatVar(X1,Y1) + -> (is_FloatValBranch(X2,Y2) + -> gecode_constraint_branch_43(Y0,Y1,Y2) + ; throw(error(type_error('FloatValBranch'(X2)),gecode_argument_error(branch(X0,X1,X2),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_IntValBranch(X2,Y2) + -> gecode_constraint_branch_45(Y0,Y1,Y2) + ; throw(error(type_error('IntValBranch'(X2)),gecode_argument_error(branch(X0,X1,X2),arg=3)))) + ; (is_SetVar(X1,Y1) + -> (is_SetValBranch(X2,Y2) + -> gecode_constraint_branch_47(Y0,Y1,Y2) + ; throw(error(type_error('SetValBranch'(X2)),gecode_argument_error(branch(X0,X1,X2),arg=3)))) + ; throw(error(type_error('SetVar'(X1)),gecode_argument_error(branch(X0,X1,X2),arg=2))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(branch(X0,X1,X2),arg=1)))). + +branch(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVar(X1,Y1) + -> (is_BoolValBranch(X2,Y2) + -> (is_BoolVarValPrint(X3,Y3) + -> gecode_constraint_branch_42(Y0,Y1,Y2,Y3) + ; throw(error(type_error('BoolVarValPrint'(X3)),gecode_argument_error(branch(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('BoolValBranch'(X2)),gecode_argument_error(branch(X0,X1,X2,X3),arg=3)))) + ; (is_FloatVar(X1,Y1) + -> (is_FloatValBranch(X2,Y2) + -> (is_FloatVarValPrint(X3,Y3) + -> gecode_constraint_branch_44(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatVarValPrint'(X3)),gecode_argument_error(branch(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('FloatValBranch'(X2)),gecode_argument_error(branch(X0,X1,X2,X3),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_IntValBranch(X2,Y2) + -> (is_IntVarValPrint(X3,Y3) + -> gecode_constraint_branch_46(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVarValPrint'(X3)),gecode_argument_error(branch(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntValBranch'(X2)),gecode_argument_error(branch(X0,X1,X2,X3),arg=3)))) + ; (is_SetVar(X1,Y1) + -> (is_SetValBranch(X2,Y2) + -> (is_SetVarValPrint(X3,Y3) + -> gecode_constraint_branch_48(Y0,Y1,Y2,Y3) + ; throw(error(type_error('SetVarValPrint'(X3)),gecode_argument_error(branch(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('SetValBranch'(X2)),gecode_argument_error(branch(X0,X1,X2,X3),arg=3)))) + ; (is_BoolVarArgs(X1,Y1) + -> (is_BoolVarBranch(X2,Y2) + -> (is_BoolValBranch(X3,Y3) + -> gecode_constraint_branch_49(Y0,Y1,Y2,Y3) + ; throw(error(type_error('BoolValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3),arg=4)))) + ; (is_BoolVarBranch(X2,Y2) + -> (is_BoolValBranch(X3,Y3) + -> gecode_constraint_branch_55(Y0,Y1,Y2,Y3) + ; throw(error(type_error('BoolValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(branch(X0,X1,X2,X3),arg=3))))) + ; (is_FloatVarArgs(X1,Y1) + -> (is_FloatVarBranch(X2,Y2) + -> (is_FloatValBranch(X3,Y3) + -> gecode_constraint_branch_61(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3),arg=4)))) + ; (is_FloatVarBranch(X2,Y2) + -> (is_FloatValBranch(X3,Y3) + -> gecode_constraint_branch_64(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(branch(X0,X1,X2,X3),arg=3))))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVarBranch(X2,Y2) + -> (is_IntValBranch(X3,Y3) + -> gecode_constraint_branch_67(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3),arg=4)))) + ; (is_IntVarBranch(X2,Y2) + -> (is_IntValBranch(X3,Y3) + -> gecode_constraint_branch_73(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(branch(X0,X1,X2,X3),arg=3))))) + ; (is_SetVarArgs(X1,Y1) + -> (is_SetVarBranch(X2,Y2) + -> (is_SetValBranch(X3,Y3) + -> gecode_constraint_branch_79(Y0,Y1,Y2,Y3) + ; throw(error(type_error('SetValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3),arg=4)))) + ; (is_SetVarBranch(X2,Y2) + -> (is_SetValBranch(X3,Y3) + -> gecode_constraint_branch_85(Y0,Y1,Y2,Y3) + ; throw(error(type_error('SetValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(branch(X0,X1,X2,X3),arg=3))))) + ; throw(error(type_error('SetVarArgs'(X1)),gecode_argument_error(branch(X0,X1,X2,X3),arg=2))))))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(branch(X0,X1,X2,X3),arg=1)))). + +branch(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_BoolVarBranch(X2,Y2) + -> (is_BoolValBranch(X3,Y3) + -> (is_BoolBranchFilter(X4,Y4) + -> gecode_constraint_branch_50(Y0,Y1,Y2,Y3,Y4) + ; (is_Symmetries(X4,Y4) + -> gecode_constraint_branch_52(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Symmetries'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('BoolValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=4)))) + ; (is_BoolVarBranch(X2,Y2) + -> (is_BoolValBranch(X3,Y3) + -> (is_BoolBranchFilter(X4,Y4) + -> gecode_constraint_branch_56(Y0,Y1,Y2,Y3,Y4) + ; (is_Symmetries(X4,Y4) + -> gecode_constraint_branch_58(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Symmetries'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('BoolValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=3))))) + ; (is_FloatVarArgs(X1,Y1) + -> (is_FloatVarBranch(X2,Y2) + -> (is_FloatValBranch(X3,Y3) + -> (is_FloatBranchFilter(X4,Y4) + -> gecode_constraint_branch_62(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('FloatBranchFilter'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('FloatValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=4)))) + ; (is_FloatVarBranch(X2,Y2) + -> (is_FloatValBranch(X3,Y3) + -> (is_FloatBranchFilter(X4,Y4) + -> gecode_constraint_branch_65(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('FloatBranchFilter'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('FloatValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=3))))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVarBranch(X2,Y2) + -> (is_IntValBranch(X3,Y3) + -> (is_IntBranchFilter(X4,Y4) + -> gecode_constraint_branch_68(Y0,Y1,Y2,Y3,Y4) + ; (is_Symmetries(X4,Y4) + -> gecode_constraint_branch_70(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Symmetries'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('IntValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=4)))) + ; (is_IntVarBranch(X2,Y2) + -> (is_IntValBranch(X3,Y3) + -> (is_IntBranchFilter(X4,Y4) + -> gecode_constraint_branch_74(Y0,Y1,Y2,Y3,Y4) + ; (is_Symmetries(X4,Y4) + -> gecode_constraint_branch_76(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Symmetries'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('IntValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=3))))) + ; (is_SetVarArgs(X1,Y1) + -> (is_SetVarBranch(X2,Y2) + -> (is_SetValBranch(X3,Y3) + -> (is_SetBranchFilter(X4,Y4) + -> gecode_constraint_branch_80(Y0,Y1,Y2,Y3,Y4) + ; (is_Symmetries(X4,Y4) + -> gecode_constraint_branch_82(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Symmetries'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('SetValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=4)))) + ; (is_SetVarBranch(X2,Y2) + -> (is_SetValBranch(X3,Y3) + -> (is_SetBranchFilter(X4,Y4) + -> gecode_constraint_branch_86(Y0,Y1,Y2,Y3,Y4) + ; (is_Symmetries(X4,Y4) + -> gecode_constraint_branch_88(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Symmetries'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('SetValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=3))))) + ; throw(error(type_error('SetVarArgs'(X1)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=2))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=1)))). + +branch(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_BoolVarBranch(X2,Y2) + -> (is_BoolValBranch(X3,Y3) + -> (is_BoolBranchFilter(X4,Y4) + -> (is_BoolVarValPrint(X5,Y5) + -> gecode_constraint_branch_51(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('BoolVarValPrint'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=6)))) + ; (is_Symmetries(X4,Y4) + -> (is_BoolBranchFilter(X5,Y5) + -> gecode_constraint_branch_53(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('BoolBranchFilter'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('Symmetries'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('BoolValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=4)))) + ; (is_BoolVarBranch(X2,Y2) + -> (is_BoolValBranch(X3,Y3) + -> (is_BoolBranchFilter(X4,Y4) + -> (is_BoolVarValPrint(X5,Y5) + -> gecode_constraint_branch_57(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('BoolVarValPrint'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=6)))) + ; (is_Symmetries(X4,Y4) + -> (is_BoolBranchFilter(X5,Y5) + -> gecode_constraint_branch_59(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('BoolBranchFilter'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('Symmetries'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('BoolValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=3))))) + ; (is_FloatVarArgs(X1,Y1) + -> (is_FloatVarBranch(X2,Y2) + -> (is_FloatValBranch(X3,Y3) + -> (is_FloatBranchFilter(X4,Y4) + -> (is_FloatVarValPrint(X5,Y5) + -> gecode_constraint_branch_63(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('FloatVarValPrint'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('FloatBranchFilter'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('FloatValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=4)))) + ; (is_FloatVarBranch(X2,Y2) + -> (is_FloatValBranch(X3,Y3) + -> (is_FloatBranchFilter(X4,Y4) + -> (is_FloatVarValPrint(X5,Y5) + -> gecode_constraint_branch_66(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('FloatVarValPrint'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('FloatBranchFilter'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('FloatValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=3))))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVarBranch(X2,Y2) + -> (is_IntValBranch(X3,Y3) + -> (is_IntBranchFilter(X4,Y4) + -> (is_IntVarValPrint(X5,Y5) + -> gecode_constraint_branch_69(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntVarValPrint'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=6)))) + ; (is_Symmetries(X4,Y4) + -> (is_IntBranchFilter(X5,Y5) + -> gecode_constraint_branch_71(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntBranchFilter'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('Symmetries'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('IntValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=4)))) + ; (is_IntVarBranch(X2,Y2) + -> (is_IntValBranch(X3,Y3) + -> (is_IntBranchFilter(X4,Y4) + -> (is_IntVarValPrint(X5,Y5) + -> gecode_constraint_branch_75(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntVarValPrint'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=6)))) + ; (is_Symmetries(X4,Y4) + -> (is_IntBranchFilter(X5,Y5) + -> gecode_constraint_branch_77(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntBranchFilter'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('Symmetries'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('IntValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=3))))) + ; (is_SetVarArgs(X1,Y1) + -> (is_SetVarBranch(X2,Y2) + -> (is_SetValBranch(X3,Y3) + -> (is_SetBranchFilter(X4,Y4) + -> (is_SetVarValPrint(X5,Y5) + -> gecode_constraint_branch_81(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('SetVarValPrint'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=6)))) + ; (is_Symmetries(X4,Y4) + -> (is_SetBranchFilter(X5,Y5) + -> gecode_constraint_branch_83(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('SetBranchFilter'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('Symmetries'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('SetValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=4)))) + ; (is_SetVarBranch(X2,Y2) + -> (is_SetValBranch(X3,Y3) + -> (is_SetBranchFilter(X4,Y4) + -> (is_SetVarValPrint(X5,Y5) + -> gecode_constraint_branch_87(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('SetVarValPrint'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=6)))) + ; (is_Symmetries(X4,Y4) + -> (is_SetBranchFilter(X5,Y5) + -> gecode_constraint_branch_89(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('SetBranchFilter'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('Symmetries'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('SetValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=3))))) + ; throw(error(type_error('SetVarArgs'(X1)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=2))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=1)))). + +branch(X0,X1,X2,X3,X4,X5,X6) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_BoolVarBranch(X2,Y2) + -> (is_BoolValBranch(X3,Y3) + -> (is_Symmetries(X4,Y4) + -> (is_BoolBranchFilter(X5,Y5) + -> (is_BoolVarValPrint(X6,Y6) + -> gecode_constraint_branch_54(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('BoolVarValPrint'(X6)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('BoolBranchFilter'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('Symmetries'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('BoolValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; (is_BoolVarBranch(X2,Y2) + -> (is_BoolValBranch(X3,Y3) + -> (is_Symmetries(X4,Y4) + -> (is_BoolBranchFilter(X5,Y5) + -> (is_BoolVarValPrint(X6,Y6) + -> gecode_constraint_branch_60(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('BoolVarValPrint'(X6)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('BoolBranchFilter'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('Symmetries'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('BoolValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=3))))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVarBranch(X2,Y2) + -> (is_IntValBranch(X3,Y3) + -> (is_Symmetries(X4,Y4) + -> (is_IntBranchFilter(X5,Y5) + -> (is_IntVarValPrint(X6,Y6) + -> gecode_constraint_branch_72(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntVarValPrint'(X6)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('IntBranchFilter'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('Symmetries'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('IntValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; (is_IntVarBranch(X2,Y2) + -> (is_IntValBranch(X3,Y3) + -> (is_Symmetries(X4,Y4) + -> (is_IntBranchFilter(X5,Y5) + -> (is_IntVarValPrint(X6,Y6) + -> gecode_constraint_branch_78(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntVarValPrint'(X6)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('IntBranchFilter'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('Symmetries'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('IntValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=3))))) + ; (is_SetVarArgs(X1,Y1) + -> (is_SetVarBranch(X2,Y2) + -> (is_SetValBranch(X3,Y3) + -> (is_Symmetries(X4,Y4) + -> (is_SetBranchFilter(X5,Y5) + -> (is_SetVarValPrint(X6,Y6) + -> gecode_constraint_branch_84(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('SetVarValPrint'(X6)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('SetBranchFilter'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('Symmetries'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('SetValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; (is_SetVarBranch(X2,Y2) + -> (is_SetValBranch(X3,Y3) + -> (is_Symmetries(X4,Y4) + -> (is_SetBranchFilter(X5,Y5) + -> (is_SetVarValPrint(X6,Y6) + -> gecode_constraint_branch_90(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('SetVarValPrint'(X6)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('SetBranchFilter'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('Symmetries'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('SetValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=3))))) + ; throw(error(type_error('SetVarArgs'(X1)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=2)))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=1)))). + +cardinality(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_SetVar(X1,Y1) + -> (is_int(X2,Y2) + -> (is_int(X3,Y3) + -> gecode_constraint_cardinality_91(Y0,Y1,Y2,Y3) + ; throw(error(type_error(int(X3)),gecode_argument_error(cardinality(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(cardinality(X0,X1,X2,X3),arg=3)))) + ; (is_SetVarArgs(X1,Y1) + -> (is_int(X2,Y2) + -> (is_int(X3,Y3) + -> gecode_constraint_cardinality_92(Y0,Y1,Y2,Y3) + ; throw(error(type_error(int(X3)),gecode_argument_error(cardinality(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(cardinality(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('SetVarArgs'(X1)),gecode_argument_error(cardinality(X0,X1,X2,X3),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(cardinality(X0,X1,X2,X3),arg=1)))). + +channel(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> gecode_constraint_channel_93(Y0,Y1,Y2) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(channel(X0,X1,X2),arg=3)))) + ; (is_FloatVar(X1,Y1) + -> (is_BoolVar(X2,Y2) + -> gecode_constraint_channel_95(Y0,Y1,Y2) + ; (is_IntVar(X2,Y2) + -> gecode_constraint_channel_96(Y0,Y1,Y2) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(channel(X0,X1,X2),arg=3))))) + ; (is_BoolVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> gecode_constraint_channel_97(Y0,Y1,Y2) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(channel(X0,X1,X2),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> gecode_constraint_channel_100(Y0,Y1,Y2) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(channel(X0,X1,X2),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(channel(X0,X1,X2),arg=2))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(channel(X0,X1,X2),arg=1)))). + +channel(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_channel_94(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(channel(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(channel(X0,X1,X2,X3),arg=3)))) + ; (is_BoolVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_int(X3,Y3) + -> gecode_constraint_channel_98(Y0,Y1,Y2,Y3) + ; throw(error(type_error(int(X3)),gecode_argument_error(channel(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(channel(X0,X1,X2,X3),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_channel_101(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(channel(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(channel(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(channel(X0,X1,X2,X3),arg=2)))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(channel(X0,X1,X2,X3),arg=1)))). + +channel(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_channel_99(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(channel(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(channel(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(channel(X0,X1,X2,X3,X4),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_int(X4,Y4) + -> gecode_constraint_channel_102(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error(int(X4)),gecode_argument_error(channel(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(channel(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(channel(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(channel(X0,X1,X2,X3,X4),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(channel(X0,X1,X2,X3,X4),arg=1)))). + +channel(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_int(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_channel_103(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(channel(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error(int(X4)),gecode_argument_error(channel(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(channel(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(channel(X0,X1,X2,X3,X4,X5),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(channel(X0,X1,X2,X3,X4,X5),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(channel(X0,X1,X2,X3,X4,X5),arg=1)))). + +circuit(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_circuit_104(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(circuit(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(circuit(X0,X1,X2,X3),arg=3)))) + ; (is_int(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_circuit_115(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(circuit(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(circuit(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error(int(X1)),gecode_argument_error(circuit(X0,X1,X2,X3),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(circuit(X0,X1,X2,X3),arg=1)))). + +circuit(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_circuit_105(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(circuit(X0,X1,X2,X3,X4),arg=5)))) + ; (is_IntVarArgs(X3,Y3) + -> (is_IntVar(X4,Y4) + -> gecode_constraint_circuit_106(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(circuit(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(circuit(X0,X1,X2,X3,X4),arg=4))))) + ; (is_int(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntVar(X4,Y4) + -> gecode_constraint_circuit_108(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(circuit(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(circuit(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(circuit(X0,X1,X2,X3,X4),arg=3))))) + ; throw(error(type_error('IntArgs'(X1)),gecode_argument_error(circuit(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(circuit(X0,X1,X2,X3,X4),arg=1)))). + +circuit(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_circuit_107(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5),arg=4)))) + ; (is_int(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_circuit_109(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5),arg=6)))) + ; (is_IntVarArgs(X4,Y4) + -> (is_IntVar(X5,Y5) + -> gecode_constraint_circuit_110(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntVar'(X5)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5),arg=3))))) + ; throw(error(type_error('IntArgs'(X1)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5),arg=1)))). + +circuit(X0,X1,X2,X3,X4,X5,X6) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntArgs(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntVar(X5,Y5) + -> (is_IntPropLevel(X6,Y6) + -> gecode_constraint_circuit_111(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntPropLevel'(X6)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('IntVar'(X5)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5,X6),arg=3)))) + ; throw(error(type_error('IntArgs'(X1)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5,X6),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5,X6),arg=1)))). + +circuit(X0,X1) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> gecode_constraint_circuit_112(Y0,Y1) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(circuit(X0,X1),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(circuit(X0,X1),arg=1)))). + +circuit(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntPropLevel(X2,Y2) + -> gecode_constraint_circuit_113(Y0,Y1,Y2) + ; throw(error(type_error('IntPropLevel'(X2)),gecode_argument_error(circuit(X0,X1,X2),arg=3)))) + ; (is_int(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> gecode_constraint_circuit_114(Y0,Y1,Y2) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(circuit(X0,X1,X2),arg=3)))) + ; throw(error(type_error(int(X1)),gecode_argument_error(circuit(X0,X1,X2),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(circuit(X0,X1,X2),arg=1)))). + +clause(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolOpType(X1,Y1) + -> (is_BoolVarArgs(X2,Y2) + -> (is_BoolVarArgs(X3,Y3) + -> (is_BoolVar(X4,Y4) + -> gecode_constraint_clause_116(Y0,Y1,Y2,Y3,Y4) + ; (is_int(X4,Y4) + -> gecode_constraint_clause_118(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error(int(X4)),gecode_argument_error(clause(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('BoolVarArgs'(X3)),gecode_argument_error(clause(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('BoolVarArgs'(X2)),gecode_argument_error(clause(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('BoolOpType'(X1)),gecode_argument_error(clause(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(clause(X0,X1,X2,X3,X4),arg=1)))). + +clause(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolOpType(X1,Y1) + -> (is_BoolVarArgs(X2,Y2) + -> (is_BoolVarArgs(X3,Y3) + -> (is_BoolVar(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_clause_117(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(clause(X0,X1,X2,X3,X4,X5),arg=6)))) + ; (is_int(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_clause_119(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(clause(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error(int(X4)),gecode_argument_error(clause(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('BoolVarArgs'(X3)),gecode_argument_error(clause(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('BoolVarArgs'(X2)),gecode_argument_error(clause(X0,X1,X2,X3,X4,X5),arg=3)))) + ; throw(error(type_error('BoolOpType'(X1)),gecode_argument_error(clause(X0,X1,X2,X3,X4,X5),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(clause(X0,X1,X2,X3,X4,X5),arg=1)))). + +count(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntRelType(X3,Y3) + -> (is_IntVar(X4,Y4) + -> gecode_constraint_count_120(Y0,Y1,Y2,Y3,Y4) + ; (is_int(X4,Y4) + -> gecode_constraint_count_122(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error(int(X4)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('IntRelType'(X3)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=4)))) + ; (is_IntArgs(X2,Y2) + -> (is_IntRelType(X3,Y3) + -> (is_IntVar(X4,Y4) + -> gecode_constraint_count_124(Y0,Y1,Y2,Y3,Y4) + ; (is_int(X4,Y4) + -> gecode_constraint_count_126(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error(int(X4)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('IntRelType'(X3)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=4)))) + ; (is_IntSet(X2,Y2) + -> (is_IntRelType(X3,Y3) + -> (is_IntVar(X4,Y4) + -> gecode_constraint_count_128(Y0,Y1,Y2,Y3,Y4) + ; (is_int(X4,Y4) + -> gecode_constraint_count_130(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error(int(X4)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=5))))) + ; (is_IntArgs(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_count_133(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntArgs'(X3)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=4))))) + ; (is_IntSetArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_count_137(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntArgs'(X3)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=4)))) + ; (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_count_141(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntArgs'(X3)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=4)))) + ; (is_int(X2,Y2) + -> (is_IntRelType(X3,Y3) + -> (is_IntVar(X4,Y4) + -> gecode_constraint_count_142(Y0,Y1,Y2,Y3,Y4) + ; (is_int(X4,Y4) + -> gecode_constraint_count_144(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error(int(X4)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('IntRelType'(X3)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=3))))))))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=1)))). + +count(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntRelType(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_count_121(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=6)))) + ; (is_int(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_count_123(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error(int(X4)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('IntRelType'(X3)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=4)))) + ; (is_IntArgs(X2,Y2) + -> (is_IntRelType(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_count_125(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=6)))) + ; (is_int(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_count_127(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error(int(X4)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('IntRelType'(X3)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=4)))) + ; (is_IntSet(X2,Y2) + -> (is_IntRelType(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_count_129(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=6)))) + ; (is_int(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_count_131(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error(int(X4)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('IntRelType'(X3)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=4)))) + ; (is_int(X2,Y2) + -> (is_IntRelType(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_count_143(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=6)))) + ; (is_int(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_count_145(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error(int(X4)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('IntRelType'(X3)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=3))))))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=1)))). + +count(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntSet(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> gecode_constraint_count_132(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntArgs'(X3)),gecode_argument_error(count(X0,X1,X2,X3),arg=4)))) + ; (is_IntSetArgs(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_count_135(Y0,Y1,Y2,Y3) + ; (is_IntArgs(X3,Y3) + -> gecode_constraint_count_136(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntArgs'(X3)),gecode_argument_error(count(X0,X1,X2,X3),arg=4))))) + ; (is_IntVarArgs(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_count_139(Y0,Y1,Y2,Y3) + ; (is_IntArgs(X3,Y3) + -> gecode_constraint_count_140(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntArgs'(X3)),gecode_argument_error(count(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(count(X0,X1,X2,X3),arg=3)))))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(count(X0,X1,X2,X3),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(count(X0,X1,X2,X3),arg=1)))). + +count(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntSetArgs(X2,Y2) + -> gecode_constraint_count_134(Y0,Y1,Y2) + ; (is_IntVarArgs(X2,Y2) + -> gecode_constraint_count_138(Y0,Y1,Y2) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(count(X0,X1,X2),arg=3))))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(count(X0,X1,X2),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(count(X0,X1,X2),arg=1)))). + +cumulative(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_IntArgs(X4,Y4) + -> gecode_constraint_cumulative_146(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntArgs'(X3)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4),arg=3)))) + ; (is_int(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_IntArgs(X4,Y4) + -> gecode_constraint_cumulative_158(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntArgs'(X3)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error(int(X1)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4),arg=1)))). + +cumulative(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_IntArgs(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_cumulative_147(Y0,Y1,Y2,Y3,Y4,Y5) + ; (is_BoolVarArgs(X5,Y5) + -> gecode_constraint_cumulative_148(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('BoolVarArgs'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=6))))) + ; throw(error(type_error('IntArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=5)))) + ; (is_IntVarArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> gecode_constraint_cumulative_150(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntArgs'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=4))))) + ; (is_TaskTypeArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> gecode_constraint_cumulative_154(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntArgs'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('IntArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('TaskTypeArgs'(X2)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=3))))) + ; (is_int(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_IntArgs(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_cumulative_159(Y0,Y1,Y2,Y3,Y4,Y5) + ; (is_BoolVarArgs(X5,Y5) + -> gecode_constraint_cumulative_160(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('BoolVarArgs'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=6))))) + ; throw(error(type_error('IntArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=5)))) + ; (is_IntVarArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> gecode_constraint_cumulative_162(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntArgs'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=4))))) + ; (is_TaskTypeArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> gecode_constraint_cumulative_166(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntArgs'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('IntArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('TaskTypeArgs'(X2)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=3))))) + ; throw(error(type_error(int(X1)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=1)))). + +cumulative(X0,X1,X2,X3,X4,X5,X6) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_IntArgs(X4,Y4) + -> (is_BoolVarArgs(X5,Y5) + -> (is_IntPropLevel(X6,Y6) + -> gecode_constraint_cumulative_149(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntPropLevel'(X6)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('BoolVarArgs'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('IntArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; (is_IntVarArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_IntPropLevel(X6,Y6) + -> gecode_constraint_cumulative_151(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; (is_BoolVarArgs(X6,Y6) + -> gecode_constraint_cumulative_152(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('BoolVarArgs'(X6)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=7))))) + ; throw(error(type_error('IntArgs'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=4))))) + ; (is_TaskTypeArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_IntPropLevel(X6,Y6) + -> gecode_constraint_cumulative_155(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; (is_BoolVarArgs(X6,Y6) + -> gecode_constraint_cumulative_156(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('BoolVarArgs'(X6)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=7))))) + ; throw(error(type_error('IntArgs'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('IntArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; throw(error(type_error('TaskTypeArgs'(X2)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=3))))) + ; (is_int(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_IntArgs(X4,Y4) + -> (is_BoolVarArgs(X5,Y5) + -> (is_IntPropLevel(X6,Y6) + -> gecode_constraint_cumulative_161(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntPropLevel'(X6)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('BoolVarArgs'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('IntArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; (is_IntVarArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_IntPropLevel(X6,Y6) + -> gecode_constraint_cumulative_163(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; (is_BoolVarArgs(X6,Y6) + -> gecode_constraint_cumulative_164(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('BoolVarArgs'(X6)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=7))))) + ; throw(error(type_error('IntArgs'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=4))))) + ; (is_TaskTypeArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_IntPropLevel(X6,Y6) + -> gecode_constraint_cumulative_167(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; (is_BoolVarArgs(X6,Y6) + -> gecode_constraint_cumulative_168(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('BoolVarArgs'(X6)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=7))))) + ; throw(error(type_error('IntArgs'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('IntArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; throw(error(type_error('TaskTypeArgs'(X2)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=3))))) + ; throw(error(type_error(int(X1)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=1)))). + +cumulative(X0,X1,X2,X3,X4,X5,X6,X7) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_BoolVarArgs(X6,Y6) + -> (is_IntPropLevel(X7,Y7) + -> gecode_constraint_cumulative_153(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error('IntPropLevel'(X7)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('BoolVarArgs'(X6)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; throw(error(type_error('IntArgs'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=6)))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=4)))) + ; (is_TaskTypeArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_BoolVarArgs(X6,Y6) + -> (is_IntPropLevel(X7,Y7) + -> gecode_constraint_cumulative_157(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error('IntPropLevel'(X7)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('BoolVarArgs'(X6)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; throw(error(type_error('IntArgs'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=6)))) + ; throw(error(type_error('IntArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=4)))) + ; throw(error(type_error('TaskTypeArgs'(X2)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=3))))) + ; (is_int(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_BoolVarArgs(X6,Y6) + -> (is_IntPropLevel(X7,Y7) + -> gecode_constraint_cumulative_165(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error('IntPropLevel'(X7)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('BoolVarArgs'(X6)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; throw(error(type_error('IntArgs'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=6)))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=4)))) + ; (is_TaskTypeArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_BoolVarArgs(X6,Y6) + -> (is_IntPropLevel(X7,Y7) + -> gecode_constraint_cumulative_169(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error('IntPropLevel'(X7)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('BoolVarArgs'(X6)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; throw(error(type_error('IntArgs'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=6)))) + ; throw(error(type_error('IntArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=4)))) + ; throw(error(type_error('TaskTypeArgs'(X2)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=3))))) + ; throw(error(type_error(int(X1)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=1)))). + +cumulatives(X0,X1,X2,X3,X4,X5,X6,X7) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> gecode_constraint_cumulatives_170(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; (is_IntVarArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> gecode_constraint_cumulatives_172(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; throw(error(type_error('IntVarArgs'(X5)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=6))))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))) + ; (is_IntVarArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> gecode_constraint_cumulatives_174(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; (is_IntVarArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> gecode_constraint_cumulatives_176(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; throw(error(type_error('IntVarArgs'(X5)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=6))))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=4))))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> gecode_constraint_cumulatives_178(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; (is_IntVarArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> gecode_constraint_cumulatives_180(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; throw(error(type_error('IntVarArgs'(X5)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=6))))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))) + ; (is_IntVarArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> gecode_constraint_cumulatives_182(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; (is_IntVarArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> gecode_constraint_cumulatives_184(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; throw(error(type_error('IntVarArgs'(X5)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=6))))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=4))))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=1)))). + +cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> (is_IntPropLevel(X8,Y8) + -> gecode_constraint_cumulatives_171(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8) + ; throw(error(type_error('IntPropLevel'(X8)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=9)))) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=7)))) + ; (is_IntVarArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> (is_IntPropLevel(X8,Y8) + -> gecode_constraint_cumulatives_173(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8) + ; throw(error(type_error('IntPropLevel'(X8)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=9)))) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=7)))) + ; throw(error(type_error('IntVarArgs'(X5)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=6))))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=5)))) + ; (is_IntVarArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> (is_IntPropLevel(X8,Y8) + -> gecode_constraint_cumulatives_175(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8) + ; throw(error(type_error('IntPropLevel'(X8)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=9)))) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=7)))) + ; (is_IntVarArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> (is_IntPropLevel(X8,Y8) + -> gecode_constraint_cumulatives_177(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8) + ; throw(error(type_error('IntPropLevel'(X8)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=9)))) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=7)))) + ; throw(error(type_error('IntVarArgs'(X5)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=6))))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=4))))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> (is_IntPropLevel(X8,Y8) + -> gecode_constraint_cumulatives_179(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8) + ; throw(error(type_error('IntPropLevel'(X8)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=9)))) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=7)))) + ; (is_IntVarArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> (is_IntPropLevel(X8,Y8) + -> gecode_constraint_cumulatives_181(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8) + ; throw(error(type_error('IntPropLevel'(X8)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=9)))) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=7)))) + ; throw(error(type_error('IntVarArgs'(X5)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=6))))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=5)))) + ; (is_IntVarArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> (is_IntPropLevel(X8,Y8) + -> gecode_constraint_cumulatives_183(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8) + ; throw(error(type_error('IntPropLevel'(X8)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=9)))) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=7)))) + ; (is_IntVarArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> (is_IntPropLevel(X8,Y8) + -> gecode_constraint_cumulatives_185(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8) + ; throw(error(type_error('IntPropLevel'(X8)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=9)))) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=7)))) + ; throw(error(type_error('IntVarArgs'(X5)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=6))))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=4))))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=1)))). + +distinct(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> gecode_constraint_distinct_186(Y0,Y1,Y2) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(distinct(X0,X1,X2),arg=3)))) + ; (is_IntArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> gecode_constraint_distinct_188(Y0,Y1,Y2) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(distinct(X0,X1,X2),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntPropLevel(X2,Y2) + -> gecode_constraint_distinct_191(Y0,Y1,Y2) + ; (is_int(X2,Y2) + -> gecode_constraint_distinct_192(Y0,Y1,Y2) + ; throw(error(type_error(int(X2)),gecode_argument_error(distinct(X0,X1,X2),arg=3))))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(distinct(X0,X1,X2),arg=2)))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(distinct(X0,X1,X2),arg=1)))). + +distinct(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_distinct_187(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(distinct(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(distinct(X0,X1,X2,X3),arg=3)))) + ; (is_IntArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_distinct_189(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(distinct(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(distinct(X0,X1,X2,X3),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_distinct_193(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(distinct(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(distinct(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(distinct(X0,X1,X2,X3),arg=2)))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(distinct(X0,X1,X2,X3),arg=1)))). + +distinct(X0,X1) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> gecode_constraint_distinct_190(Y0,Y1) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(distinct(X0,X1),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(distinct(X0,X1),arg=1)))). + +div(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_FloatVar(X1,Y1) + -> (is_FloatVar(X2,Y2) + -> (is_FloatVar(X3,Y3) + -> gecode_constraint_div_194(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatVar'(X3)),gecode_argument_error(div(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('FloatVar'(X2)),gecode_argument_error(div(X0,X1,X2,X3),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_div_195(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(div(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(div(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(div(X0,X1,X2,X3),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(div(X0,X1,X2,X3),arg=1)))). + +div(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_div_196(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(div(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(div(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(div(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(div(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(div(X0,X1,X2,X3,X4),arg=1)))). + +divmod(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntVar(X4,Y4) + -> gecode_constraint_divmod_197(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(divmod(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(divmod(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(divmod(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(divmod(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(divmod(X0,X1,X2,X3,X4),arg=1)))). + +divmod(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_divmod_198(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(divmod(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(divmod(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(divmod(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(divmod(X0,X1,X2,X3,X4,X5),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(divmod(X0,X1,X2,X3,X4,X5),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(divmod(X0,X1,X2,X3,X4,X5),arg=1)))). + +dom(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVar(X1,Y1) + -> (is_BoolVar(X2,Y2) + -> gecode_constraint_dom_199(Y0,Y1,Y2) + ; throw(error(type_error('BoolVar'(X2)),gecode_argument_error(dom(X0,X1,X2),arg=3)))) + ; (is_FloatVar(X1,Y1) + -> (is_FloatVal(X2,Y2) + -> gecode_constraint_dom_203(Y0,Y1,Y2) + ; (is_FloatVar(X2,Y2) + -> gecode_constraint_dom_205(Y0,Y1,Y2) + ; throw(error(type_error('FloatVar'(X2)),gecode_argument_error(dom(X0,X1,X2),arg=3))))) + ; (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> gecode_constraint_dom_206(Y0,Y1,Y2) + ; (is_IntSet(X2,Y2) + -> gecode_constraint_dom_208(Y0,Y1,Y2) + ; (is_int(X2,Y2) + -> gecode_constraint_dom_212(Y0,Y1,Y2) + ; throw(error(type_error(int(X2)),gecode_argument_error(dom(X0,X1,X2),arg=3)))))) + ; (is_SetVar(X1,Y1) + -> (is_SetVar(X2,Y2) + -> gecode_constraint_dom_226(Y0,Y1,Y2) + ; throw(error(type_error('SetVar'(X2)),gecode_argument_error(dom(X0,X1,X2),arg=3)))) + ; (is_BoolVarArgs(X1,Y1) + -> (is_BoolVarArgs(X2,Y2) + -> gecode_constraint_dom_227(Y0,Y1,Y2) + ; throw(error(type_error('BoolVarArgs'(X2)),gecode_argument_error(dom(X0,X1,X2),arg=3)))) + ; (is_FloatVarArgs(X1,Y1) + -> (is_FloatVal(X2,Y2) + -> gecode_constraint_dom_230(Y0,Y1,Y2) + ; (is_FloatVarArgs(X2,Y2) + -> gecode_constraint_dom_231(Y0,Y1,Y2) + ; throw(error(type_error('FloatVarArgs'(X2)),gecode_argument_error(dom(X0,X1,X2),arg=3))))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntSet(X2,Y2) + -> gecode_constraint_dom_232(Y0,Y1,Y2) + ; (is_IntVarArgs(X2,Y2) + -> gecode_constraint_dom_234(Y0,Y1,Y2) + ; (is_int(X2,Y2) + -> gecode_constraint_dom_236(Y0,Y1,Y2) + ; throw(error(type_error(int(X2)),gecode_argument_error(dom(X0,X1,X2),arg=3)))))) + ; (is_SetVarArgs(X1,Y1) + -> (is_SetVarArgs(X2,Y2) + -> gecode_constraint_dom_243(Y0,Y1,Y2) + ; throw(error(type_error('SetVarArgs'(X2)),gecode_argument_error(dom(X0,X1,X2),arg=3)))) + ; throw(error(type_error('SetVarArgs'(X1)),gecode_argument_error(dom(X0,X1,X2),arg=2))))))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(dom(X0,X1,X2),arg=1)))). + +dom(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVar(X1,Y1) + -> (is_BoolVar(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_dom_200(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(dom(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('BoolVar'(X2)),gecode_argument_error(dom(X0,X1,X2,X3),arg=3)))) + ; (is_FloatVar(X1,Y1) + -> (is_FloatNum(X2,Y2) + -> (is_FloatNum(X3,Y3) + -> gecode_constraint_dom_201(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatNum'(X3)),gecode_argument_error(dom(X0,X1,X2,X3),arg=4)))) + ; (is_FloatVal(X2,Y2) + -> (is_Reify(X3,Y3) + -> gecode_constraint_dom_204(Y0,Y1,Y2,Y3) + ; throw(error(type_error('Reify'(X3)),gecode_argument_error(dom(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('FloatVal'(X2)),gecode_argument_error(dom(X0,X1,X2,X3),arg=3))))) + ; (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_dom_207(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(dom(X0,X1,X2,X3),arg=4)))) + ; (is_IntSet(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_dom_209(Y0,Y1,Y2,Y3) + ; (is_Reify(X3,Y3) + -> gecode_constraint_dom_210(Y0,Y1,Y2,Y3) + ; throw(error(type_error('Reify'(X3)),gecode_argument_error(dom(X0,X1,X2,X3),arg=4))))) + ; (is_int(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_dom_213(Y0,Y1,Y2,Y3) + ; (is_Reify(X3,Y3) + -> gecode_constraint_dom_214(Y0,Y1,Y2,Y3) + ; (is_int(X3,Y3) + -> gecode_constraint_dom_216(Y0,Y1,Y2,Y3) + ; throw(error(type_error(int(X3)),gecode_argument_error(dom(X0,X1,X2,X3),arg=4)))))) + ; throw(error(type_error(int(X2)),gecode_argument_error(dom(X0,X1,X2,X3),arg=3)))))) + ; (is_SetVar(X1,Y1) + -> (is_SetRelType(X2,Y2) + -> (is_IntSet(X3,Y3) + -> gecode_constraint_dom_220(Y0,Y1,Y2,Y3) + ; (is_int(X3,Y3) + -> gecode_constraint_dom_222(Y0,Y1,Y2,Y3) + ; throw(error(type_error(int(X3)),gecode_argument_error(dom(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('SetRelType'(X2)),gecode_argument_error(dom(X0,X1,X2,X3),arg=3)))) + ; (is_BoolVarArgs(X1,Y1) + -> (is_BoolVarArgs(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_dom_228(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(dom(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('BoolVarArgs'(X2)),gecode_argument_error(dom(X0,X1,X2,X3),arg=3)))) + ; (is_FloatVarArgs(X1,Y1) + -> (is_FloatNum(X2,Y2) + -> (is_FloatNum(X3,Y3) + -> gecode_constraint_dom_229(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatNum'(X3)),gecode_argument_error(dom(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('FloatNum'(X2)),gecode_argument_error(dom(X0,X1,X2,X3),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntSet(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_dom_233(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(dom(X0,X1,X2,X3),arg=4)))) + ; (is_IntVarArgs(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_dom_235(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(dom(X0,X1,X2,X3),arg=4)))) + ; (is_int(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_dom_237(Y0,Y1,Y2,Y3) + ; (is_int(X3,Y3) + -> gecode_constraint_dom_238(Y0,Y1,Y2,Y3) + ; throw(error(type_error(int(X3)),gecode_argument_error(dom(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error(int(X2)),gecode_argument_error(dom(X0,X1,X2,X3),arg=3)))))) + ; (is_SetVarArgs(X1,Y1) + -> (is_SetRelType(X2,Y2) + -> (is_IntSet(X3,Y3) + -> gecode_constraint_dom_240(Y0,Y1,Y2,Y3) + ; (is_int(X3,Y3) + -> gecode_constraint_dom_241(Y0,Y1,Y2,Y3) + ; throw(error(type_error(int(X3)),gecode_argument_error(dom(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('SetRelType'(X2)),gecode_argument_error(dom(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('SetVarArgs'(X1)),gecode_argument_error(dom(X0,X1,X2,X3),arg=2))))))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(dom(X0,X1,X2,X3),arg=1)))). + +dom(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_FloatVar(X1,Y1) + -> (is_FloatNum(X2,Y2) + -> (is_FloatNum(X3,Y3) + -> (is_Reify(X4,Y4) + -> gecode_constraint_dom_202(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('FloatNum'(X3)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('FloatNum'(X2)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_IntSet(X2,Y2) + -> (is_Reify(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_dom_211(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('Reify'(X3)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=4)))) + ; (is_int(X2,Y2) + -> (is_Reify(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_dom_215(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=5)))) + ; (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_dom_217(Y0,Y1,Y2,Y3,Y4) + ; (is_Reify(X4,Y4) + -> gecode_constraint_dom_218(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error(int(X3)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=4))))) + ; throw(error(type_error(int(X2)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=3))))) + ; (is_SetVar(X1,Y1) + -> (is_SetRelType(X2,Y2) + -> (is_IntSet(X3,Y3) + -> (is_Reify(X4,Y4) + -> gecode_constraint_dom_221(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=5)))) + ; (is_int(X3,Y3) + -> (is_Reify(X4,Y4) + -> gecode_constraint_dom_223(Y0,Y1,Y2,Y3,Y4) + ; (is_int(X4,Y4) + -> gecode_constraint_dom_224(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error(int(X4)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error(int(X3)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=4))))) + ; throw(error(type_error('SetRelType'(X2)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_int(X2,Y2) + -> (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_dom_239(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=3)))) + ; (is_SetVarArgs(X1,Y1) + -> (is_SetRelType(X2,Y2) + -> (is_int(X3,Y3) + -> (is_int(X4,Y4) + -> gecode_constraint_dom_242(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error(int(X4)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('SetRelType'(X2)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('SetVarArgs'(X1)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=2)))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=1)))). + +dom(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_int(X2,Y2) + -> (is_int(X3,Y3) + -> (is_Reify(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_dom_219(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(dom(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(dom(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(dom(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(dom(X0,X1,X2,X3,X4,X5),arg=3)))) + ; (is_SetVar(X1,Y1) + -> (is_SetRelType(X2,Y2) + -> (is_int(X3,Y3) + -> (is_int(X4,Y4) + -> (is_Reify(X5,Y5) + -> gecode_constraint_dom_225(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('Reify'(X5)),gecode_argument_error(dom(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error(int(X4)),gecode_argument_error(dom(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(dom(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('SetRelType'(X2)),gecode_argument_error(dom(X0,X1,X2,X3,X4,X5),arg=3)))) + ; throw(error(type_error('SetVar'(X1)),gecode_argument_error(dom(X0,X1,X2,X3,X4,X5),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(dom(X0,X1,X2,X3,X4,X5),arg=1)))). + +element(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_BoolVar(X3,Y3) + -> gecode_constraint_element_244(Y0,Y1,Y2,Y3) + ; (is_IntVar(X3,Y3) + -> gecode_constraint_element_246(Y0,Y1,Y2,Y3) + ; (is_int(X3,Y3) + -> gecode_constraint_element_248(Y0,Y1,Y2,Y3) + ; throw(error(type_error(int(X3)),gecode_argument_error(element(X0,X1,X2,X3),arg=4)))))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(element(X0,X1,X2,X3),arg=3)))) + ; (is_BoolVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_BoolVar(X3,Y3) + -> gecode_constraint_element_254(Y0,Y1,Y2,Y3) + ; (is_int(X3,Y3) + -> gecode_constraint_element_256(Y0,Y1,Y2,Y3) + ; throw(error(type_error(int(X3)),gecode_argument_error(element(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(element(X0,X1,X2,X3),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_element_260(Y0,Y1,Y2,Y3) + ; (is_int(X3,Y3) + -> gecode_constraint_element_262(Y0,Y1,Y2,Y3) + ; throw(error(type_error(int(X3)),gecode_argument_error(element(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(element(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(element(X0,X1,X2,X3),arg=2)))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(element(X0,X1,X2,X3),arg=1)))). + +element(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_BoolVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_element_245(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(element(X0,X1,X2,X3,X4),arg=5)))) + ; (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_element_247(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(element(X0,X1,X2,X3,X4),arg=5)))) + ; (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_element_249(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(element(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(element(X0,X1,X2,X3,X4),arg=4)))))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(element(X0,X1,X2,X3,X4),arg=3)))) + ; (is_BoolVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_BoolVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_element_255(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(element(X0,X1,X2,X3,X4),arg=5)))) + ; (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_element_257(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(element(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(element(X0,X1,X2,X3,X4),arg=4))))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(element(X0,X1,X2,X3,X4),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_element_261(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(element(X0,X1,X2,X3,X4),arg=5)))) + ; (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_element_263(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(element(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(element(X0,X1,X2,X3,X4),arg=4))))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(element(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(element(X0,X1,X2,X3,X4),arg=2)))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(element(X0,X1,X2,X3,X4),arg=1)))). + +element(X0,X1,X2,X3,X4,X5,X6) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_int(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_int(X5,Y5) + -> (is_BoolVar(X6,Y6) + -> gecode_constraint_element_250(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; (is_IntVar(X6,Y6) + -> gecode_constraint_element_252(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntVar'(X6)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=7))))) + ; throw(error(type_error(int(X5)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=3)))) + ; (is_BoolVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_int(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_int(X5,Y5) + -> (is_BoolVar(X6,Y6) + -> gecode_constraint_element_258(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('BoolVar'(X6)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error(int(X5)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_int(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_int(X5,Y5) + -> (is_IntVar(X6,Y6) + -> gecode_constraint_element_264(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntVar'(X6)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error(int(X5)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=2)))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=1)))). + +element(X0,X1,X2,X3,X4,X5,X6,X7) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_int(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_int(X5,Y5) + -> (is_BoolVar(X6,Y6) + -> (is_IntPropLevel(X7,Y7) + -> gecode_constraint_element_251(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error('IntPropLevel'(X7)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; (is_IntVar(X6,Y6) + -> (is_IntPropLevel(X7,Y7) + -> gecode_constraint_element_253(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error('IntPropLevel'(X7)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('IntVar'(X6)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=7))))) + ; throw(error(type_error(int(X5)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=3)))) + ; (is_BoolVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_int(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_int(X5,Y5) + -> (is_BoolVar(X6,Y6) + -> (is_IntPropLevel(X7,Y7) + -> gecode_constraint_element_259(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error('IntPropLevel'(X7)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('BoolVar'(X6)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; throw(error(type_error(int(X5)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_int(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_int(X5,Y5) + -> (is_IntVar(X6,Y6) + -> (is_IntPropLevel(X7,Y7) + -> gecode_constraint_element_265(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error('IntPropLevel'(X7)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('IntVar'(X6)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; throw(error(type_error(int(X5)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=2)))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=1)))). + +extensional(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_DFA(X2,Y2) + -> gecode_constraint_extensional_266(Y0,Y1,Y2) + ; throw(error(type_error('DFA'(X2)),gecode_argument_error(extensional(X0,X1,X2),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_DFA(X2,Y2) + -> gecode_constraint_extensional_272(Y0,Y1,Y2) + ; throw(error(type_error('DFA'(X2)),gecode_argument_error(extensional(X0,X1,X2),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(extensional(X0,X1,X2),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(extensional(X0,X1,X2),arg=1)))). + +extensional(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_DFA(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_extensional_267(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(extensional(X0,X1,X2,X3),arg=4)))) + ; (is_TupleSet(X2,Y2) + -> (is_bool(X3,Y3) + -> gecode_constraint_extensional_268(Y0,Y1,Y2,Y3) + ; throw(error(type_error(bool(X3)),gecode_argument_error(extensional(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('TupleSet'(X2)),gecode_argument_error(extensional(X0,X1,X2,X3),arg=3))))) + ; (is_IntVarArgs(X1,Y1) + -> (is_DFA(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_extensional_273(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(extensional(X0,X1,X2,X3),arg=4)))) + ; (is_TupleSet(X2,Y2) + -> (is_bool(X3,Y3) + -> gecode_constraint_extensional_274(Y0,Y1,Y2,Y3) + ; throw(error(type_error(bool(X3)),gecode_argument_error(extensional(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('TupleSet'(X2)),gecode_argument_error(extensional(X0,X1,X2,X3),arg=3))))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(extensional(X0,X1,X2,X3),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(extensional(X0,X1,X2,X3),arg=1)))). + +extensional(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_TupleSet(X2,Y2) + -> (is_bool(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_extensional_269(Y0,Y1,Y2,Y3,Y4) + ; (is_Reify(X4,Y4) + -> gecode_constraint_extensional_270(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(extensional(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error(bool(X3)),gecode_argument_error(extensional(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('TupleSet'(X2)),gecode_argument_error(extensional(X0,X1,X2,X3,X4),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_TupleSet(X2,Y2) + -> (is_bool(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_extensional_275(Y0,Y1,Y2,Y3,Y4) + ; (is_Reify(X4,Y4) + -> gecode_constraint_extensional_276(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(extensional(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error(bool(X3)),gecode_argument_error(extensional(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('TupleSet'(X2)),gecode_argument_error(extensional(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(extensional(X0,X1,X2,X3,X4),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(extensional(X0,X1,X2,X3,X4),arg=1)))). + +extensional(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_TupleSet(X2,Y2) + -> (is_bool(X3,Y3) + -> (is_Reify(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_extensional_271(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(extensional(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(extensional(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error(bool(X3)),gecode_argument_error(extensional(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('TupleSet'(X2)),gecode_argument_error(extensional(X0,X1,X2,X3,X4,X5),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_TupleSet(X2,Y2) + -> (is_bool(X3,Y3) + -> (is_Reify(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_extensional_277(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(extensional(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(extensional(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error(bool(X3)),gecode_argument_error(extensional(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('TupleSet'(X2)),gecode_argument_error(extensional(X0,X1,X2,X3,X4,X5),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(extensional(X0,X1,X2,X3,X4,X5),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(extensional(X0,X1,X2,X3,X4,X5),arg=1)))). + +ite(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVar(X1,Y1) + -> (is_BoolVar(X2,Y2) + -> (is_BoolVar(X3,Y3) + -> (is_BoolVar(X4,Y4) + -> gecode_constraint_ite_278(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('BoolVar'(X4)),gecode_argument_error(ite(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('BoolVar'(X3)),gecode_argument_error(ite(X0,X1,X2,X3,X4),arg=4)))) + ; (is_FloatVar(X2,Y2) + -> (is_FloatVar(X3,Y3) + -> (is_FloatVar(X4,Y4) + -> gecode_constraint_ite_280(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('FloatVar'(X4)),gecode_argument_error(ite(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('FloatVar'(X3)),gecode_argument_error(ite(X0,X1,X2,X3,X4),arg=4)))) + ; (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntVar(X4,Y4) + -> gecode_constraint_ite_281(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(ite(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(ite(X0,X1,X2,X3,X4),arg=4)))) + ; (is_SetVar(X2,Y2) + -> (is_SetVar(X3,Y3) + -> (is_SetVar(X4,Y4) + -> gecode_constraint_ite_283(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('SetVar'(X4)),gecode_argument_error(ite(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('SetVar'(X3)),gecode_argument_error(ite(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('SetVar'(X2)),gecode_argument_error(ite(X0,X1,X2,X3,X4),arg=3))))))) + ; throw(error(type_error('BoolVar'(X1)),gecode_argument_error(ite(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(ite(X0,X1,X2,X3,X4),arg=1)))). + +ite(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVar(X1,Y1) + -> (is_BoolVar(X2,Y2) + -> (is_BoolVar(X3,Y3) + -> (is_BoolVar(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_ite_279(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(ite(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('BoolVar'(X4)),gecode_argument_error(ite(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('BoolVar'(X3)),gecode_argument_error(ite(X0,X1,X2,X3,X4,X5),arg=4)))) + ; (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_ite_282(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(ite(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(ite(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(ite(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(ite(X0,X1,X2,X3,X4,X5),arg=3))))) + ; throw(error(type_error('BoolVar'(X1)),gecode_argument_error(ite(X0,X1,X2,X3,X4,X5),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(ite(X0,X1,X2,X3,X4,X5),arg=1)))). + +linear(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_linear_284(Y0,Y1,Y2,Y3) + ; (is_int(X3,Y3) + -> gecode_constraint_linear_288(Y0,Y1,Y2,Y3) + ; throw(error(type_error(int(X3)),gecode_argument_error(linear(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(linear(X0,X1,X2,X3),arg=3)))) + ; (is_FloatVarArgs(X1,Y1) + -> (is_FloatRelType(X2,Y2) + -> (is_FloatVal(X3,Y3) + -> gecode_constraint_linear_296(Y0,Y1,Y2,Y3) + ; (is_FloatVar(X3,Y3) + -> gecode_constraint_linear_298(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatVar'(X3)),gecode_argument_error(linear(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('FloatRelType'(X2)),gecode_argument_error(linear(X0,X1,X2,X3),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_linear_316(Y0,Y1,Y2,Y3) + ; (is_int(X3,Y3) + -> gecode_constraint_linear_320(Y0,Y1,Y2,Y3) + ; throw(error(type_error(int(X3)),gecode_argument_error(linear(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(linear(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(linear(X0,X1,X2,X3),arg=2)))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(linear(X0,X1,X2,X3),arg=1)))). + +linear(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_linear_285(Y0,Y1,Y2,Y3,Y4) + ; (is_Reify(X4,Y4) + -> gecode_constraint_linear_286(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=5))))) + ; (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_linear_289(Y0,Y1,Y2,Y3,Y4) + ; (is_Reify(X4,Y4) + -> gecode_constraint_linear_290(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error(int(X3)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=3)))) + ; (is_FloatValArgs(X1,Y1) + -> (is_FloatVarArgs(X2,Y2) + -> (is_FloatRelType(X3,Y3) + -> (is_FloatVal(X4,Y4) + -> gecode_constraint_linear_292(Y0,Y1,Y2,Y3,Y4) + ; (is_FloatVar(X4,Y4) + -> gecode_constraint_linear_294(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('FloatVar'(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('FloatRelType'(X3)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('FloatVarArgs'(X2)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=3)))) + ; (is_FloatVarArgs(X1,Y1) + -> (is_FloatRelType(X2,Y2) + -> (is_FloatVal(X3,Y3) + -> (is_Reify(X4,Y4) + -> gecode_constraint_linear_297(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=5)))) + ; (is_FloatVar(X3,Y3) + -> (is_Reify(X4,Y4) + -> gecode_constraint_linear_299(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('FloatVar'(X3)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=4))))) + ; throw(error(type_error('FloatRelType'(X2)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=3)))) + ; (is_IntArgs(X1,Y1) + -> (is_BoolVarArgs(X2,Y2) + -> (is_IntRelType(X3,Y3) + -> (is_IntVar(X4,Y4) + -> gecode_constraint_linear_300(Y0,Y1,Y2,Y3,Y4) + ; (is_int(X4,Y4) + -> gecode_constraint_linear_304(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error(int(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('IntRelType'(X3)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=4)))) + ; (is_IntVarArgs(X2,Y2) + -> (is_IntRelType(X3,Y3) + -> (is_IntVar(X4,Y4) + -> gecode_constraint_linear_308(Y0,Y1,Y2,Y3,Y4) + ; (is_int(X4,Y4) + -> gecode_constraint_linear_312(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error(int(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('IntRelType'(X3)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=3))))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_linear_317(Y0,Y1,Y2,Y3,Y4) + ; (is_Reify(X4,Y4) + -> gecode_constraint_linear_318(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=5))))) + ; (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_linear_321(Y0,Y1,Y2,Y3,Y4) + ; (is_Reify(X4,Y4) + -> gecode_constraint_linear_322(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error(int(X3)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=2)))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=1)))). + +linear(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_Reify(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_linear_287(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=5)))) + ; (is_int(X3,Y3) + -> (is_Reify(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_linear_291(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=3)))) + ; (is_FloatValArgs(X1,Y1) + -> (is_FloatVarArgs(X2,Y2) + -> (is_FloatRelType(X3,Y3) + -> (is_FloatVal(X4,Y4) + -> (is_Reify(X5,Y5) + -> gecode_constraint_linear_293(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('Reify'(X5)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=6)))) + ; (is_FloatVar(X4,Y4) + -> (is_Reify(X5,Y5) + -> gecode_constraint_linear_295(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('Reify'(X5)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('FloatVar'(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('FloatRelType'(X3)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('FloatVarArgs'(X2)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=3)))) + ; (is_IntArgs(X1,Y1) + -> (is_BoolVarArgs(X2,Y2) + -> (is_IntRelType(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_linear_301(Y0,Y1,Y2,Y3,Y4,Y5) + ; (is_Reify(X5,Y5) + -> gecode_constraint_linear_302(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('Reify'(X5)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=6))))) + ; (is_int(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_linear_305(Y0,Y1,Y2,Y3,Y4,Y5) + ; (is_Reify(X5,Y5) + -> gecode_constraint_linear_306(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('Reify'(X5)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=6))))) + ; throw(error(type_error(int(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('IntRelType'(X3)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=4)))) + ; (is_IntVarArgs(X2,Y2) + -> (is_IntRelType(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_linear_309(Y0,Y1,Y2,Y3,Y4,Y5) + ; (is_Reify(X5,Y5) + -> gecode_constraint_linear_310(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('Reify'(X5)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=6))))) + ; (is_int(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_linear_313(Y0,Y1,Y2,Y3,Y4,Y5) + ; (is_Reify(X5,Y5) + -> gecode_constraint_linear_314(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('Reify'(X5)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=6))))) + ; throw(error(type_error(int(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('IntRelType'(X3)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=3))))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_Reify(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_linear_319(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=5)))) + ; (is_int(X3,Y3) + -> (is_Reify(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_linear_323(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=2))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=1)))). + +linear(X0,X1,X2,X3,X4,X5,X6) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntArgs(X1,Y1) + -> (is_BoolVarArgs(X2,Y2) + -> (is_IntRelType(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_Reify(X5,Y5) + -> (is_IntPropLevel(X6,Y6) + -> gecode_constraint_linear_303(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntPropLevel'(X6)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('Reify'(X5)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; (is_int(X4,Y4) + -> (is_Reify(X5,Y5) + -> (is_IntPropLevel(X6,Y6) + -> gecode_constraint_linear_307(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntPropLevel'(X6)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('Reify'(X5)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error(int(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=5))))) + ; throw(error(type_error('IntRelType'(X3)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; (is_IntVarArgs(X2,Y2) + -> (is_IntRelType(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_Reify(X5,Y5) + -> (is_IntPropLevel(X6,Y6) + -> gecode_constraint_linear_311(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntPropLevel'(X6)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('Reify'(X5)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; (is_int(X4,Y4) + -> (is_Reify(X5,Y5) + -> (is_IntPropLevel(X6,Y6) + -> gecode_constraint_linear_315(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntPropLevel'(X6)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('Reify'(X5)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error(int(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=5))))) + ; throw(error(type_error('IntRelType'(X3)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=3))))) + ; throw(error(type_error('IntArgs'(X1)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=1)))). + +max(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_FloatVar(X1,Y1) + -> (is_FloatVar(X2,Y2) + -> (is_FloatVar(X3,Y3) + -> gecode_constraint_max_324(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatVar'(X3)),gecode_argument_error(max(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('FloatVar'(X2)),gecode_argument_error(max(X0,X1,X2,X3),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_max_325(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(max(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(max(X0,X1,X2,X3),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_max_329(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(max(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(max(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(max(X0,X1,X2,X3),arg=2)))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(max(X0,X1,X2,X3),arg=1)))). + +max(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_max_326(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(max(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(max(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(max(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(max(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(max(X0,X1,X2,X3,X4),arg=1)))). + +max(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_FloatVarArgs(X1,Y1) + -> (is_FloatVar(X2,Y2) + -> gecode_constraint_max_327(Y0,Y1,Y2) + ; throw(error(type_error('FloatVar'(X2)),gecode_argument_error(max(X0,X1,X2),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> gecode_constraint_max_328(Y0,Y1,Y2) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(max(X0,X1,X2),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(max(X0,X1,X2),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(max(X0,X1,X2),arg=1)))). + +member(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_BoolVar(X2,Y2) + -> gecode_constraint_member_330(Y0,Y1,Y2) + ; throw(error(type_error('BoolVar'(X2)),gecode_argument_error(member(X0,X1,X2),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> gecode_constraint_member_334(Y0,Y1,Y2) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(member(X0,X1,X2),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(member(X0,X1,X2),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(member(X0,X1,X2),arg=1)))). + +member(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_BoolVar(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_member_331(Y0,Y1,Y2,Y3) + ; (is_Reify(X3,Y3) + -> gecode_constraint_member_332(Y0,Y1,Y2,Y3) + ; throw(error(type_error('Reify'(X3)),gecode_argument_error(member(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('BoolVar'(X2)),gecode_argument_error(member(X0,X1,X2,X3),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_member_335(Y0,Y1,Y2,Y3) + ; (is_Reify(X3,Y3) + -> gecode_constraint_member_336(Y0,Y1,Y2,Y3) + ; throw(error(type_error('Reify'(X3)),gecode_argument_error(member(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(member(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(member(X0,X1,X2,X3),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(member(X0,X1,X2,X3),arg=1)))). + +member(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_BoolVar(X2,Y2) + -> (is_Reify(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_member_333(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(member(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('Reify'(X3)),gecode_argument_error(member(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('BoolVar'(X2)),gecode_argument_error(member(X0,X1,X2,X3,X4),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_Reify(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_member_337(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(member(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('Reify'(X3)),gecode_argument_error(member(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(member(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(member(X0,X1,X2,X3,X4),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(member(X0,X1,X2,X3,X4),arg=1)))). + +min(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_FloatVar(X1,Y1) + -> (is_FloatVar(X2,Y2) + -> (is_FloatVar(X3,Y3) + -> gecode_constraint_min_338(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatVar'(X3)),gecode_argument_error(min(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('FloatVar'(X2)),gecode_argument_error(min(X0,X1,X2,X3),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_min_339(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(min(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(min(X0,X1,X2,X3),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_min_343(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(min(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(min(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(min(X0,X1,X2,X3),arg=2)))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(min(X0,X1,X2,X3),arg=1)))). + +min(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_min_340(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(min(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(min(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(min(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(min(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(min(X0,X1,X2,X3,X4),arg=1)))). + +min(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_FloatVarArgs(X1,Y1) + -> (is_FloatVar(X2,Y2) + -> gecode_constraint_min_341(Y0,Y1,Y2) + ; throw(error(type_error('FloatVar'(X2)),gecode_argument_error(min(X0,X1,X2),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> gecode_constraint_min_342(Y0,Y1,Y2) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(min(X0,X1,X2),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(min(X0,X1,X2),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(min(X0,X1,X2),arg=1)))). + +mod(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_mod_344(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(mod(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(mod(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(mod(X0,X1,X2,X3),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(mod(X0,X1,X2,X3),arg=1)))). + +mod(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_mod_345(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(mod(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(mod(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(mod(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(mod(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(mod(X0,X1,X2,X3,X4),arg=1)))). + +mult(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_FloatVar(X1,Y1) + -> (is_FloatVar(X2,Y2) + -> (is_FloatVar(X3,Y3) + -> gecode_constraint_mult_346(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatVar'(X3)),gecode_argument_error(mult(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('FloatVar'(X2)),gecode_argument_error(mult(X0,X1,X2,X3),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_mult_347(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(mult(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(mult(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(mult(X0,X1,X2,X3),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(mult(X0,X1,X2,X3),arg=1)))). + +mult(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_mult_348(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(mult(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(mult(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(mult(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(mult(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(mult(X0,X1,X2,X3,X4),arg=1)))). + +nooverlap(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntArgs(X4,Y4) + -> gecode_constraint_nooverlap_349(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntArgs'(X4)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntArgs'(X2)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4),arg=1)))). + +nooverlap(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntArgs(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_nooverlap_350(Y0,Y1,Y2,Y3,Y4,Y5) + ; (is_BoolVarArgs(X5,Y5) + -> gecode_constraint_nooverlap_351(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('BoolVarArgs'(X5)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5),arg=6))))) + ; throw(error(type_error('IntArgs'(X4)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('IntArgs'(X2)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5),arg=1)))). + +nooverlap(X0,X1,X2,X3,X4,X5,X6) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntArgs(X4,Y4) + -> (is_BoolVarArgs(X5,Y5) + -> (is_IntPropLevel(X6,Y6) + -> gecode_constraint_nooverlap_352(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntPropLevel'(X6)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('BoolVarArgs'(X5)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('IntArgs'(X4)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; (is_IntVarArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntVarArgs(X5,Y5) + -> (is_IntVarArgs(X6,Y6) + -> gecode_constraint_nooverlap_353(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntVarArgs'(X6)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('IntVarArgs'(X5)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=3))))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=1)))). + +nooverlap(X0,X1,X2,X3,X4,X5,X6,X7) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntVarArgs(X5,Y5) + -> (is_IntVarArgs(X6,Y6) + -> (is_IntPropLevel(X7,Y7) + -> gecode_constraint_nooverlap_354(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; (is_BoolVarArgs(X7,Y7) + -> gecode_constraint_nooverlap_355(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error('BoolVarArgs'(X7)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7),arg=8))))) + ; throw(error(type_error('IntVarArgs'(X6)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; throw(error(type_error('IntVarArgs'(X5)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7),arg=6)))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7),arg=1)))). + +nooverlap(X0,X1,X2,X3,X4,X5,X6,X7,X8) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntVarArgs(X5,Y5) + -> (is_IntVarArgs(X6,Y6) + -> (is_BoolVarArgs(X7,Y7) + -> (is_IntPropLevel(X8,Y8) + -> gecode_constraint_nooverlap_356(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8) + ; throw(error(type_error('IntPropLevel'(X8)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=9)))) + ; throw(error(type_error('BoolVarArgs'(X7)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=8)))) + ; throw(error(type_error('IntVarArgs'(X6)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=7)))) + ; throw(error(type_error('IntVarArgs'(X5)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=6)))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=1)))). + +nroot(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_FloatVar(X1,Y1) + -> (is_int(X2,Y2) + -> (is_FloatVar(X3,Y3) + -> gecode_constraint_nroot_357(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatVar'(X3)),gecode_argument_error(nroot(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(nroot(X0,X1,X2,X3),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_nroot_358(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(nroot(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(nroot(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(nroot(X0,X1,X2,X3),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(nroot(X0,X1,X2,X3),arg=1)))). + +nroot(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_nroot_359(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(nroot(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(nroot(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(nroot(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(nroot(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(nroot(X0,X1,X2,X3,X4),arg=1)))). + +nvalues(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_nvalues_360(Y0,Y1,Y2,Y3) + ; (is_int(X3,Y3) + -> gecode_constraint_nvalues_362(Y0,Y1,Y2,Y3) + ; throw(error(type_error(int(X3)),gecode_argument_error(nvalues(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(nvalues(X0,X1,X2,X3),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_nvalues_364(Y0,Y1,Y2,Y3) + ; (is_int(X3,Y3) + -> gecode_constraint_nvalues_366(Y0,Y1,Y2,Y3) + ; throw(error(type_error(int(X3)),gecode_argument_error(nvalues(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(nvalues(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(nvalues(X0,X1,X2,X3),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(nvalues(X0,X1,X2,X3),arg=1)))). + +nvalues(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_nvalues_361(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(nvalues(X0,X1,X2,X3,X4),arg=5)))) + ; (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_nvalues_363(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(nvalues(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(nvalues(X0,X1,X2,X3,X4),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(nvalues(X0,X1,X2,X3,X4),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_nvalues_365(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(nvalues(X0,X1,X2,X3,X4),arg=5)))) + ; (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_nvalues_367(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(nvalues(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(nvalues(X0,X1,X2,X3,X4),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(nvalues(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(nvalues(X0,X1,X2,X3,X4),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(nvalues(X0,X1,X2,X3,X4),arg=1)))). + +path(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_IntVar(X5,Y5) + -> gecode_constraint_path_368(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntVar'(X5)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5),arg=3)))) + ; (is_int(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_path_379(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5),arg=3)))) + ; throw(error(type_error(int(X1)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5),arg=1)))). + +path(X0,X1,X2,X3,X4,X5,X6) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_IntVar(X5,Y5) + -> (is_IntPropLevel(X6,Y6) + -> gecode_constraint_path_369(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntPropLevel'(X6)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; (is_IntVarArgs(X5,Y5) + -> (is_IntVar(X6,Y6) + -> gecode_constraint_path_370(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntVar'(X6)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('IntVarArgs'(X5)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=6))))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; (is_int(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_IntVar(X5,Y5) + -> (is_IntVar(X6,Y6) + -> gecode_constraint_path_372(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntVar'(X6)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('IntVar'(X5)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=3))))) + ; throw(error(type_error('IntArgs'(X1)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=1)))). + +path(X0,X1,X2,X3,X4,X5,X6,X7) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_IntVarArgs(X5,Y5) + -> (is_IntVar(X6,Y6) + -> (is_IntPropLevel(X7,Y7) + -> gecode_constraint_path_371(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error('IntPropLevel'(X7)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('IntVar'(X6)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; throw(error(type_error('IntVarArgs'(X5)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=4)))) + ; (is_int(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_IntVar(X5,Y5) + -> (is_IntVar(X6,Y6) + -> (is_IntPropLevel(X7,Y7) + -> gecode_constraint_path_373(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error('IntPropLevel'(X7)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; (is_IntVarArgs(X6,Y6) + -> (is_IntVar(X7,Y7) + -> gecode_constraint_path_374(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error('IntVar'(X7)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('IntVarArgs'(X6)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=7))))) + ; throw(error(type_error('IntVar'(X5)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=3))))) + ; throw(error(type_error('IntArgs'(X1)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=1)))). + +path(X0,X1,X2,X3,X4,X5,X6,X7,X8) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntArgs(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_IntVar(X5,Y5) + -> (is_IntVarArgs(X6,Y6) + -> (is_IntVar(X7,Y7) + -> (is_IntPropLevel(X8,Y8) + -> gecode_constraint_path_375(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8) + ; throw(error(type_error('IntPropLevel'(X8)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=9)))) + ; throw(error(type_error('IntVar'(X7)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=8)))) + ; throw(error(type_error('IntVarArgs'(X6)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=7)))) + ; throw(error(type_error('IntVar'(X5)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=3)))) + ; throw(error(type_error('IntArgs'(X1)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=1)))). + +path(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_path_376(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(path(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(path(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(path(X0,X1,X2,X3),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(path(X0,X1,X2,X3),arg=1)))). + +path(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_path_377(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(path(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(path(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(path(X0,X1,X2,X3,X4),arg=3)))) + ; (is_int(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntVar(X4,Y4) + -> gecode_constraint_path_378(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(path(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(path(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(path(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error(int(X1)),gecode_argument_error(path(X0,X1,X2,X3,X4),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(path(X0,X1,X2,X3,X4),arg=1)))). + +pow(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_FloatVar(X1,Y1) + -> (is_int(X2,Y2) + -> (is_FloatVar(X3,Y3) + -> gecode_constraint_pow_380(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatVar'(X3)),gecode_argument_error(pow(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(pow(X0,X1,X2,X3),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_pow_381(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(pow(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(pow(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(pow(X0,X1,X2,X3),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(pow(X0,X1,X2,X3),arg=1)))). + +pow(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_pow_382(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(pow(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(pow(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(pow(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(pow(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(pow(X0,X1,X2,X3,X4),arg=1)))). + +precede(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntArgs(X2,Y2) + -> gecode_constraint_precede_383(Y0,Y1,Y2) + ; throw(error(type_error('IntArgs'(X2)),gecode_argument_error(precede(X0,X1,X2),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(precede(X0,X1,X2),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(precede(X0,X1,X2),arg=1)))). + +precede(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntArgs(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_precede_384(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(precede(X0,X1,X2,X3),arg=4)))) + ; (is_int(X2,Y2) + -> (is_int(X3,Y3) + -> gecode_constraint_precede_385(Y0,Y1,Y2,Y3) + ; throw(error(type_error(int(X3)),gecode_argument_error(precede(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(precede(X0,X1,X2,X3),arg=3))))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(precede(X0,X1,X2,X3),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(precede(X0,X1,X2,X3),arg=1)))). + +precede(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_int(X2,Y2) + -> (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_precede_386(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(precede(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(precede(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(precede(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(precede(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(precede(X0,X1,X2,X3,X4),arg=1)))). + +rel(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolOpType(X1,Y1) + -> (is_BoolVarArgs(X2,Y2) + -> (is_BoolVar(X3,Y3) + -> gecode_constraint_rel_387(Y0,Y1,Y2,Y3) + ; (is_int(X3,Y3) + -> gecode_constraint_rel_389(Y0,Y1,Y2,Y3) + ; throw(error(type_error(int(X3)),gecode_argument_error(rel(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('BoolVarArgs'(X2)),gecode_argument_error(rel(X0,X1,X2,X3),arg=3)))) + ; (is_BoolVar(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_BoolVar(X3,Y3) + -> gecode_constraint_rel_395(Y0,Y1,Y2,Y3) + ; (is_int(X3,Y3) + -> gecode_constraint_rel_399(Y0,Y1,Y2,Y3) + ; throw(error(type_error(int(X3)),gecode_argument_error(rel(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3),arg=3)))) + ; (is_FloatVar(X1,Y1) + -> (is_FloatRelType(X2,Y2) + -> (is_FloatVal(X3,Y3) + -> gecode_constraint_rel_403(Y0,Y1,Y2,Y3) + ; (is_FloatVar(X3,Y3) + -> gecode_constraint_rel_405(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatVar'(X3)),gecode_argument_error(rel(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('FloatRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_rel_407(Y0,Y1,Y2,Y3) + ; (is_int(X3,Y3) + -> gecode_constraint_rel_411(Y0,Y1,Y2,Y3) + ; throw(error(type_error(int(X3)),gecode_argument_error(rel(X0,X1,X2,X3),arg=4))))) + ; (is_SetRelType(X2,Y2) + -> (is_SetVar(X3,Y3) + -> gecode_constraint_rel_415(Y0,Y1,Y2,Y3) + ; throw(error(type_error('SetVar'(X3)),gecode_argument_error(rel(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('SetRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3),arg=3))))) + ; (is_SetVar(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_rel_417(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(rel(X0,X1,X2,X3),arg=4)))) + ; (is_SetRelType(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_rel_419(Y0,Y1,Y2,Y3) + ; (is_SetVar(X3,Y3) + -> gecode_constraint_rel_421(Y0,Y1,Y2,Y3) + ; throw(error(type_error('SetVar'(X3)),gecode_argument_error(rel(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('SetRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3),arg=3))))) + ; (is_BoolVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_BoolVar(X3,Y3) + -> gecode_constraint_rel_423(Y0,Y1,Y2,Y3) + ; (is_IntPropLevel(X3,Y3) + -> gecode_constraint_rel_426(Y0,Y1,Y2,Y3) + ; (is_BoolVarArgs(X3,Y3) + -> gecode_constraint_rel_427(Y0,Y1,Y2,Y3) + ; (is_IntArgs(X3,Y3) + -> gecode_constraint_rel_429(Y0,Y1,Y2,Y3) + ; (is_int(X3,Y3) + -> gecode_constraint_rel_431(Y0,Y1,Y2,Y3) + ; throw(error(type_error(int(X3)),gecode_argument_error(rel(X0,X1,X2,X3),arg=4)))))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3),arg=3)))) + ; (is_FloatVarArgs(X1,Y1) + -> (is_FloatRelType(X2,Y2) + -> (is_FloatVal(X3,Y3) + -> gecode_constraint_rel_433(Y0,Y1,Y2,Y3) + ; (is_FloatVar(X3,Y3) + -> gecode_constraint_rel_434(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatVar'(X3)),gecode_argument_error(rel(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('FloatRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3),arg=3)))) + ; (is_IntArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_BoolVarArgs(X3,Y3) + -> gecode_constraint_rel_435(Y0,Y1,Y2,Y3) + ; (is_IntVarArgs(X3,Y3) + -> gecode_constraint_rel_437(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(rel(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_rel_440(Y0,Y1,Y2,Y3) + ; (is_IntVar(X3,Y3) + -> gecode_constraint_rel_441(Y0,Y1,Y2,Y3) + ; (is_IntArgs(X3,Y3) + -> gecode_constraint_rel_443(Y0,Y1,Y2,Y3) + ; (is_IntVarArgs(X3,Y3) + -> gecode_constraint_rel_445(Y0,Y1,Y2,Y3) + ; (is_int(X3,Y3) + -> gecode_constraint_rel_447(Y0,Y1,Y2,Y3) + ; throw(error(type_error(int(X3)),gecode_argument_error(rel(X0,X1,X2,X3),arg=4)))))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(rel(X0,X1,X2,X3),arg=2)))))))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(rel(X0,X1,X2,X3),arg=1)))). + +rel(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolOpType(X1,Y1) + -> (is_BoolVarArgs(X2,Y2) + -> (is_BoolVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_388(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_390(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4))))) + ; throw(error(type_error('BoolVarArgs'(X2)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=3)))) + ; (is_BoolVar(X1,Y1) + -> (is_BoolOpType(X2,Y2) + -> (is_BoolVar(X3,Y3) + -> (is_BoolVar(X4,Y4) + -> gecode_constraint_rel_391(Y0,Y1,Y2,Y3,Y4) + ; (is_int(X4,Y4) + -> gecode_constraint_rel_393(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error(int(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('BoolVar'(X3)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4)))) + ; (is_IntRelType(X2,Y2) + -> (is_BoolVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_396(Y0,Y1,Y2,Y3,Y4) + ; (is_Reify(X4,Y4) + -> gecode_constraint_rel_397(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5))))) + ; (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_400(Y0,Y1,Y2,Y3,Y4) + ; (is_Reify(X4,Y4) + -> gecode_constraint_rel_401(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error(int(X3)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=3))))) + ; (is_FloatVar(X1,Y1) + -> (is_FloatRelType(X2,Y2) + -> (is_FloatVal(X3,Y3) + -> (is_Reify(X4,Y4) + -> gecode_constraint_rel_404(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; (is_FloatVar(X3,Y3) + -> (is_Reify(X4,Y4) + -> gecode_constraint_rel_406(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('FloatVar'(X3)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4))))) + ; throw(error(type_error('FloatRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_408(Y0,Y1,Y2,Y3,Y4) + ; (is_Reify(X4,Y4) + -> gecode_constraint_rel_409(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5))))) + ; (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_412(Y0,Y1,Y2,Y3,Y4) + ; (is_Reify(X4,Y4) + -> gecode_constraint_rel_413(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error(int(X3)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4))))) + ; (is_SetRelType(X2,Y2) + -> (is_SetVar(X3,Y3) + -> (is_Reify(X4,Y4) + -> gecode_constraint_rel_416(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('SetVar'(X3)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('SetRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=3))))) + ; (is_SetVar(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_Reify(X4,Y4) + -> gecode_constraint_rel_418(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4)))) + ; (is_SetRelType(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_Reify(X4,Y4) + -> gecode_constraint_rel_420(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; (is_SetVar(X3,Y3) + -> (is_Reify(X4,Y4) + -> gecode_constraint_rel_422(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('SetVar'(X3)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4))))) + ; throw(error(type_error('SetRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=3))))) + ; (is_BoolVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_BoolVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_424(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; (is_BoolVarArgs(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_428(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; (is_IntArgs(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_430(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_432(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4))))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=3)))) + ; (is_IntArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_BoolVarArgs(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_436(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; (is_IntVarArgs(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_438(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_442(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; (is_IntArgs(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_444(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; (is_IntVarArgs(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_446(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_448(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4))))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=2))))))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=1)))). + +rel(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVar(X1,Y1) + -> (is_BoolOpType(X2,Y2) + -> (is_BoolVar(X3,Y3) + -> (is_BoolVar(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_rel_392(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=6)))) + ; (is_int(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_rel_394(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error(int(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('BoolVar'(X3)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=4)))) + ; (is_IntRelType(X2,Y2) + -> (is_BoolVar(X3,Y3) + -> (is_Reify(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_rel_398(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=5)))) + ; (is_int(X3,Y3) + -> (is_Reify(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_rel_402(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=3))))) + ; (is_IntVar(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_Reify(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_rel_410(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=5)))) + ; (is_int(X3,Y3) + -> (is_Reify(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_rel_414(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=1)))). + +rel(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> gecode_constraint_rel_425(Y0,Y1,Y2) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(rel(X0,X1,X2),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> gecode_constraint_rel_439(Y0,Y1,Y2) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(rel(X0,X1,X2),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(rel(X0,X1,X2),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(rel(X0,X1,X2),arg=1)))). + +relax(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_SetVarArgs(X1,Y1) + -> (is_SetVarArgs(X2,Y2) + -> (is_Rnd(X3,Y3) + -> (is_double(X4,Y4) + -> gecode_constraint_relax_449(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error(double(X4)),gecode_argument_error(relax(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('Rnd'(X3)),gecode_argument_error(relax(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('SetVarArgs'(X2)),gecode_argument_error(relax(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('SetVarArgs'(X1)),gecode_argument_error(relax(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(relax(X0,X1,X2,X3,X4),arg=1)))). + +sequence(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_IntSet(X2,Y2) + -> (is_int(X3,Y3) + -> (is_int(X4,Y4) + -> (is_int(X5,Y5) + -> gecode_constraint_sequence_450(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error(int(X5)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error(int(X4)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('IntSet'(X2)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntSet(X2,Y2) + -> (is_int(X3,Y3) + -> (is_int(X4,Y4) + -> (is_int(X5,Y5) + -> gecode_constraint_sequence_452(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error(int(X5)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error(int(X4)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('IntSet'(X2)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5),arg=1)))). + +sequence(X0,X1,X2,X3,X4,X5,X6) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_IntSet(X2,Y2) + -> (is_int(X3,Y3) + -> (is_int(X4,Y4) + -> (is_int(X5,Y5) + -> (is_IntPropLevel(X6,Y6) + -> gecode_constraint_sequence_451(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntPropLevel'(X6)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error(int(X5)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error(int(X4)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; throw(error(type_error('IntSet'(X2)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntSet(X2,Y2) + -> (is_int(X3,Y3) + -> (is_int(X4,Y4) + -> (is_int(X5,Y5) + -> (is_IntPropLevel(X6,Y6) + -> gecode_constraint_sequence_453(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntPropLevel'(X6)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error(int(X5)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error(int(X4)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; throw(error(type_error('IntSet'(X2)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=1)))). + +sorted(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> gecode_constraint_sorted_454(Y0,Y1,Y2) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(sorted(X0,X1,X2),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(sorted(X0,X1,X2),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(sorted(X0,X1,X2),arg=1)))). + +sorted(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_sorted_455(Y0,Y1,Y2,Y3) + ; (is_IntVarArgs(X3,Y3) + -> gecode_constraint_sorted_456(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(sorted(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(sorted(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(sorted(X0,X1,X2,X3),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(sorted(X0,X1,X2,X3),arg=1)))). + +sorted(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_sorted_457(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(sorted(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(sorted(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(sorted(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(sorted(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(sorted(X0,X1,X2,X3,X4),arg=1)))). + +sqr(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_FloatVar(X1,Y1) + -> (is_FloatVar(X2,Y2) + -> gecode_constraint_sqr_458(Y0,Y1,Y2) + ; throw(error(type_error('FloatVar'(X2)),gecode_argument_error(sqr(X0,X1,X2),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> gecode_constraint_sqr_459(Y0,Y1,Y2) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(sqr(X0,X1,X2),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(sqr(X0,X1,X2),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(sqr(X0,X1,X2),arg=1)))). + +sqr(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_sqr_460(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(sqr(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(sqr(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(sqr(X0,X1,X2,X3),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(sqr(X0,X1,X2,X3),arg=1)))). + +sqrt(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_FloatVar(X1,Y1) + -> (is_FloatVar(X2,Y2) + -> gecode_constraint_sqrt_461(Y0,Y1,Y2) + ; throw(error(type_error('FloatVar'(X2)),gecode_argument_error(sqrt(X0,X1,X2),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> gecode_constraint_sqrt_462(Y0,Y1,Y2) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(sqrt(X0,X1,X2),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(sqrt(X0,X1,X2),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(sqrt(X0,X1,X2),arg=1)))). + +sqrt(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_sqrt_463(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(sqrt(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(sqrt(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(sqrt(X0,X1,X2,X3),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(sqrt(X0,X1,X2,X3),arg=1)))). + +unary(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntArgs(X2,Y2) + -> gecode_constraint_unary_464(Y0,Y1,Y2) + ; throw(error(type_error('IntArgs'(X2)),gecode_argument_error(unary(X0,X1,X2),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(unary(X0,X1,X2),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(unary(X0,X1,X2),arg=1)))). + +unary(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntArgs(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_unary_465(Y0,Y1,Y2,Y3) + ; (is_BoolVarArgs(X3,Y3) + -> gecode_constraint_unary_466(Y0,Y1,Y2,Y3) + ; throw(error(type_error('BoolVarArgs'(X3)),gecode_argument_error(unary(X0,X1,X2,X3),arg=4))))) + ; (is_IntVarArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> gecode_constraint_unary_468(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(unary(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(unary(X0,X1,X2,X3),arg=3))))) + ; (is_TaskTypeArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> gecode_constraint_unary_472(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntArgs'(X3)),gecode_argument_error(unary(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(unary(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('TaskTypeArgs'(X1)),gecode_argument_error(unary(X0,X1,X2,X3),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(unary(X0,X1,X2,X3),arg=1)))). + +unary(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntArgs(X2,Y2) + -> (is_BoolVarArgs(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_unary_467(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(unary(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('BoolVarArgs'(X3)),gecode_argument_error(unary(X0,X1,X2,X3,X4),arg=4)))) + ; (is_IntVarArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_unary_469(Y0,Y1,Y2,Y3,Y4) + ; (is_BoolVarArgs(X4,Y4) + -> gecode_constraint_unary_470(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('BoolVarArgs'(X4)),gecode_argument_error(unary(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(unary(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(unary(X0,X1,X2,X3,X4),arg=3))))) + ; (is_TaskTypeArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_unary_473(Y0,Y1,Y2,Y3,Y4) + ; (is_BoolVarArgs(X4,Y4) + -> gecode_constraint_unary_474(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('BoolVarArgs'(X4)),gecode_argument_error(unary(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('IntArgs'(X3)),gecode_argument_error(unary(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(unary(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('TaskTypeArgs'(X1)),gecode_argument_error(unary(X0,X1,X2,X3,X4),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(unary(X0,X1,X2,X3,X4),arg=1)))). + +unary(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_BoolVarArgs(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_unary_471(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(unary(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('BoolVarArgs'(X4)),gecode_argument_error(unary(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(unary(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(unary(X0,X1,X2,X3,X4,X5),arg=3)))) + ; (is_TaskTypeArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_BoolVarArgs(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_unary_475(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(unary(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('BoolVarArgs'(X4)),gecode_argument_error(unary(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntArgs'(X3)),gecode_argument_error(unary(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(unary(X0,X1,X2,X3,X4,X5),arg=3)))) + ; throw(error(type_error('TaskTypeArgs'(X1)),gecode_argument_error(unary(X0,X1,X2,X3,X4,X5),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(unary(X0,X1,X2,X3,X4,X5),arg=1)))). + +unshare(X0,X1) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> gecode_constraint_unshare_476(Y0,Y1) + ; (is_IntVarArgs(X1,Y1) + -> gecode_constraint_unshare_478(Y0,Y1) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(unshare(X0,X1),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(unshare(X0,X1),arg=1)))). + +unshare(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_IntPropLevel(X2,Y2) + -> gecode_constraint_unshare_477(Y0,Y1,Y2) + ; throw(error(type_error('IntPropLevel'(X2)),gecode_argument_error(unshare(X0,X1,X2),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntPropLevel(X2,Y2) + -> gecode_constraint_unshare_479(Y0,Y1,Y2) + ; throw(error(type_error('IntPropLevel'(X2)),gecode_argument_error(unshare(X0,X1,X2),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(unshare(X0,X1,X2),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(unshare(X0,X1,X2),arg=1)))). + +when(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVar(X1,Y1) + -> (is_std_function(X2,Y2) + -> gecode_constraint_when_480(Y0,Y1,Y2) + ; throw(error(type_error('std::function'(X2)),gecode_argument_error(when(X0,X1,X2),arg=3)))) + ; throw(error(type_error('BoolVar'(X1)),gecode_argument_error(when(X0,X1,X2),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(when(X0,X1,X2),arg=1)))). + +when(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVar(X1,Y1) + -> (is_std_function(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_when_481(Y0,Y1,Y2,Y3) + ; (is_std_function(X3,Y3) + -> gecode_constraint_when_482(Y0,Y1,Y2,Y3) + ; throw(error(type_error('std::function'(X3)),gecode_argument_error(when(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('std::function'(X2)),gecode_argument_error(when(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('BoolVar'(X1)),gecode_argument_error(when(X0,X1,X2,X3),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(when(X0,X1,X2,X3),arg=1)))). + +when(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVar(X1,Y1) + -> (is_std_function(X2,Y2) + -> (is_std_function(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_when_483(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(when(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('std::function'(X3)),gecode_argument_error(when(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('std::function'(X2)),gecode_argument_error(when(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('BoolVar'(X1)),gecode_argument_error(when(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(when(X0,X1,X2,X3,X4),arg=1)))). + diff --git a/packages/gecode/6.1.1/gecode_yap_cc_forward_auto_generated.icc b/packages/gecode/6.1.1/gecode_yap_cc_forward_auto_generated.icc new file mode 100644 index 000000000..dd1196994 --- /dev/null +++ b/packages/gecode/6.1.1/gecode_yap_cc_forward_auto_generated.icc @@ -0,0 +1,28 @@ +// -*- c++ -*- +//============================================================================= +// Copyright (C) 2011 by Denys Duchier +// +// This program is free software: you can redistribute it and/or modify it +// under the terms of the GNU Lesser General Public License as published by the +// Free Software Foundation, either version 3 of the License, or (at your +// option) any later version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +// more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . +//============================================================================= + +static RestartMode gecode_RestartMode_from_term(YAP_Term); +static FloatRelType gecode_FloatRelType_from_term(YAP_Term); +static ReifyMode gecode_ReifyMode_from_term(YAP_Term); +static IntRelType gecode_IntRelType_from_term(YAP_Term); +static BoolOpType gecode_BoolOpType_from_term(YAP_Term); +static IntPropLevel gecode_IntPropLevel_from_term(YAP_Term); +static TaskType gecode_TaskType_from_term(YAP_Term); +static TraceEvent gecode_TraceEvent_from_term(YAP_Term); +static SetRelType gecode_SetRelType_from_term(YAP_Term); +static SetOpType gecode_SetOpType_from_term(YAP_Term); diff --git a/packages/gecode/6.1.1/gecode_yap_cc_impl_auto_generated.icc b/packages/gecode/6.1.1/gecode_yap_cc_impl_auto_generated.icc new file mode 100644 index 000000000..3826ebca8 --- /dev/null +++ b/packages/gecode/6.1.1/gecode_yap_cc_impl_auto_generated.icc @@ -0,0 +1,5458 @@ +// -*- c++ -*- +//============================================================================= +// Copyright (C) 2011 by Denys Duchier +// +// This program is free software: you can redistribute it and/or modify it +// under the terms of the GNU Lesser General Public License as published by the +// Free Software Foundation, either version 3 of the License, or (at your +// option) any later version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +// more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . +//============================================================================= + +static YAP_Term gecode_RM_NONE; +static YAP_Term gecode_RM_CONSTANT; +static YAP_Term gecode_RM_LINEAR; +static YAP_Term gecode_RM_LUBY; +static YAP_Term gecode_RM_GEOMETRIC; + +static RestartMode gecode_RestartMode_from_term(YAP_Term X) +{ + if (X==gecode_RM_NONE) return RM_NONE; + if (X==gecode_RM_CONSTANT) return RM_CONSTANT; + if (X==gecode_RM_LINEAR) return RM_LINEAR; + if (X==gecode_RM_LUBY) return RM_LUBY; + if (X==gecode_RM_GEOMETRIC) return RM_GEOMETRIC; + cerr << "this should never happen" << endl; exit(1); +} + +static YAP_Term gecode_FRT_EQ; +static YAP_Term gecode_FRT_NQ; +static YAP_Term gecode_FRT_LQ; +static YAP_Term gecode_FRT_LE; +static YAP_Term gecode_FRT_GQ; +static YAP_Term gecode_FRT_GR; + +static FloatRelType gecode_FloatRelType_from_term(YAP_Term X) +{ + if (X==gecode_FRT_EQ) return FRT_EQ; + if (X==gecode_FRT_NQ) return FRT_NQ; + if (X==gecode_FRT_LQ) return FRT_LQ; + if (X==gecode_FRT_LE) return FRT_LE; + if (X==gecode_FRT_GQ) return FRT_GQ; + if (X==gecode_FRT_GR) return FRT_GR; + cerr << "this should never happen" << endl; exit(1); +} + +static YAP_Term gecode_RM_EQV; +static YAP_Term gecode_RM_IMP; +static YAP_Term gecode_RM_PMI; + +static ReifyMode gecode_ReifyMode_from_term(YAP_Term X) +{ + if (X==gecode_RM_EQV) return RM_EQV; + if (X==gecode_RM_IMP) return RM_IMP; + if (X==gecode_RM_PMI) return RM_PMI; + cerr << "this should never happen" << endl; exit(1); +} + +static YAP_Term gecode_IRT_EQ; +static YAP_Term gecode_IRT_NQ; +static YAP_Term gecode_IRT_LQ; +static YAP_Term gecode_IRT_LE; +static YAP_Term gecode_IRT_GQ; +static YAP_Term gecode_IRT_GR; + +static IntRelType gecode_IntRelType_from_term(YAP_Term X) +{ + if (X==gecode_IRT_EQ) return IRT_EQ; + if (X==gecode_IRT_NQ) return IRT_NQ; + if (X==gecode_IRT_LQ) return IRT_LQ; + if (X==gecode_IRT_LE) return IRT_LE; + if (X==gecode_IRT_GQ) return IRT_GQ; + if (X==gecode_IRT_GR) return IRT_GR; + cerr << "this should never happen" << endl; exit(1); +} + +static YAP_Term gecode_BOT_AND; +static YAP_Term gecode_BOT_OR; +static YAP_Term gecode_BOT_IMP; +static YAP_Term gecode_BOT_EQV; +static YAP_Term gecode_BOT_XOR; + +static BoolOpType gecode_BoolOpType_from_term(YAP_Term X) +{ + if (X==gecode_BOT_AND) return BOT_AND; + if (X==gecode_BOT_OR) return BOT_OR; + if (X==gecode_BOT_IMP) return BOT_IMP; + if (X==gecode_BOT_EQV) return BOT_EQV; + if (X==gecode_BOT_XOR) return BOT_XOR; + cerr << "this should never happen" << endl; exit(1); +} + +static YAP_Term gecode_IPL_DEF; +static YAP_Term gecode_IPL_VAL; +static YAP_Term gecode_IPL_BND; +static YAP_Term gecode_IPL_DOM; +static YAP_Term gecode_IPL_BASIC; +static YAP_Term gecode_IPL_ADVANCED; +static YAP_Term gecode_IPL_BASIC_ADVANCED; + +static IntPropLevel gecode_IntPropLevel_from_term(YAP_Term X) +{ + if (X==gecode_IPL_DEF) return IPL_DEF; + if (X==gecode_IPL_VAL) return IPL_VAL; + if (X==gecode_IPL_BND) return IPL_BND; + if (X==gecode_IPL_DOM) return IPL_DOM; + if (X==gecode_IPL_BASIC) return IPL_BASIC; + if (X==gecode_IPL_ADVANCED) return IPL_ADVANCED; + if (X==gecode_IPL_BASIC_ADVANCED) return IPL_BASIC_ADVANCED; + cerr << "this should never happen" << endl; exit(1); +} + +static YAP_Term gecode_TT_FIXP; +static YAP_Term gecode_TT_FIXS; +static YAP_Term gecode_TT_FIXE; + +static TaskType gecode_TaskType_from_term(YAP_Term X) +{ + if (X==gecode_TT_FIXP) return TT_FIXP; + if (X==gecode_TT_FIXS) return TT_FIXS; + if (X==gecode_TT_FIXE) return TT_FIXE; + cerr << "this should never happen" << endl; exit(1); +} + +static YAP_Term gecode_TE_INIT; +static YAP_Term gecode_TE_PRUNE; +static YAP_Term gecode_TE_FIX; +static YAP_Term gecode_TE_FAIL; +static YAP_Term gecode_TE_DONE; +static YAP_Term gecode_TE_PROPAGATE; +static YAP_Term gecode_TE_COMMIT; + +static TraceEvent gecode_TraceEvent_from_term(YAP_Term X) +{ + if (X==gecode_TE_INIT) return TE_INIT; + if (X==gecode_TE_PRUNE) return TE_PRUNE; + if (X==gecode_TE_FIX) return TE_FIX; + if (X==gecode_TE_FAIL) return TE_FAIL; + if (X==gecode_TE_DONE) return TE_DONE; + if (X==gecode_TE_PROPAGATE) return TE_PROPAGATE; + if (X==gecode_TE_COMMIT) return TE_COMMIT; + cerr << "this should never happen" << endl; exit(1); +} + +static YAP_Term gecode_SRT_EQ; +static YAP_Term gecode_SRT_NQ; +static YAP_Term gecode_SRT_SUB; +static YAP_Term gecode_SRT_SUP; +static YAP_Term gecode_SRT_DISJ; +static YAP_Term gecode_SRT_CMPL; +static YAP_Term gecode_SRT_LQ; +static YAP_Term gecode_SRT_LE; +static YAP_Term gecode_SRT_GQ; +static YAP_Term gecode_SRT_GR; + +static SetRelType gecode_SetRelType_from_term(YAP_Term X) +{ + if (X==gecode_SRT_EQ) return SRT_EQ; + if (X==gecode_SRT_NQ) return SRT_NQ; + if (X==gecode_SRT_SUB) return SRT_SUB; + if (X==gecode_SRT_SUP) return SRT_SUP; + if (X==gecode_SRT_DISJ) return SRT_DISJ; + if (X==gecode_SRT_CMPL) return SRT_CMPL; + if (X==gecode_SRT_LQ) return SRT_LQ; + if (X==gecode_SRT_LE) return SRT_LE; + if (X==gecode_SRT_GQ) return SRT_GQ; + if (X==gecode_SRT_GR) return SRT_GR; + cerr << "this should never happen" << endl; exit(1); +} + +static YAP_Term gecode_SOT_UNION; +static YAP_Term gecode_SOT_DUNION; +static YAP_Term gecode_SOT_INTER; +static YAP_Term gecode_SOT_MINUS; + +static SetOpType gecode_SetOpType_from_term(YAP_Term X) +{ + if (X==gecode_SOT_UNION) return SOT_UNION; + if (X==gecode_SOT_DUNION) return SOT_DUNION; + if (X==gecode_SOT_INTER) return SOT_INTER; + if (X==gecode_SOT_MINUS) return SOT_MINUS; + cerr << "this should never happen" << endl; exit(1); +} + +static YAP_Bool gecode_constraint_branch_1(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + std::function X2 = gecode_std_function_from_term(YAP_ARG2); + branch(*space,X2); + return TRUE; +} + +static YAP_Bool gecode_constraint_convex_2(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + convex(*space,X2); + return TRUE; +} + +static YAP_Bool gecode_constraint_convex_3(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetVar X3 = gecode_SetVar_from_term(space,YAP_ARG3); + convex(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_abs_4(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatVar X3 = gecode_FloatVar_from_term(space,YAP_ARG3); + abs(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_abs_5(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + abs(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_abs_6(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + abs(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmax_7(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + argmax(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmax_8(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + bool X4 = gecode_bool_from_term(YAP_ARG4); + argmax(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmax_10(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + argmax(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmax_9(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + bool X4 = gecode_bool_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + argmax(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmax_11(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + bool X5 = gecode_bool_from_term(YAP_ARG5); + argmax(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmax_12(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + bool X5 = gecode_bool_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + argmax(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmin_13(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + argmin(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmin_14(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + bool X4 = gecode_bool_from_term(YAP_ARG4); + argmin(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmin_16(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + argmin(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmin_15(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + bool X4 = gecode_bool_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + argmin(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmin_17(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + bool X5 = gecode_bool_from_term(YAP_ARG5); + argmin(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmin_18(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + bool X5 = gecode_bool_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + argmin(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_19(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + BoolAssign X3 = gecode_BoolAssign_from_term(YAP_ARG3); + assign(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_21(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatAssign X3 = gecode_FloatAssign_from_term(YAP_ARG3); + assign(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_23(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntAssign X3 = gecode_IntAssign_from_term(YAP_ARG3); + assign(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_25(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetAssign X3 = gecode_SetAssign_from_term(YAP_ARG3); + assign(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_27(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + BoolAssign X3 = gecode_BoolAssign_from_term(YAP_ARG3); + assign(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_30(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatAssign X3 = gecode_FloatAssign_from_term(YAP_ARG3); + assign(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_33(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntAssign X3 = gecode_IntAssign_from_term(YAP_ARG3); + assign(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_36(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + SetAssign X3 = gecode_SetAssign_from_term(YAP_ARG3); + assign(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_20(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + BoolAssign X3 = gecode_BoolAssign_from_term(YAP_ARG3); + BoolVarValPrint X4 = gecode_BoolVarValPrint_from_term(YAP_ARG4); + assign(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_22(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatAssign X3 = gecode_FloatAssign_from_term(YAP_ARG3); + FloatVarValPrint X4 = gecode_FloatVarValPrint_from_term(YAP_ARG4); + assign(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_24(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntAssign X3 = gecode_IntAssign_from_term(YAP_ARG3); + IntVarValPrint X4 = gecode_IntVarValPrint_from_term(YAP_ARG4); + assign(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_26(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetAssign X3 = gecode_SetAssign_from_term(YAP_ARG3); + SetVarValPrint X4 = gecode_SetVarValPrint_from_term(YAP_ARG4); + assign(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_28(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + BoolAssign X3 = gecode_BoolAssign_from_term(YAP_ARG3); + BoolBranchFilter X4 = gecode_BoolBranchFilter_from_term(YAP_ARG4); + assign(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_31(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatAssign X3 = gecode_FloatAssign_from_term(YAP_ARG3); + FloatBranchFilter X4 = gecode_FloatBranchFilter_from_term(YAP_ARG4); + assign(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_34(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntAssign X3 = gecode_IntAssign_from_term(YAP_ARG3); + IntBranchFilter X4 = gecode_IntBranchFilter_from_term(YAP_ARG4); + assign(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_37(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + SetAssign X3 = gecode_SetAssign_from_term(YAP_ARG3); + SetBranchFilter X4 = gecode_SetBranchFilter_from_term(YAP_ARG4); + assign(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_29(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + BoolAssign X3 = gecode_BoolAssign_from_term(YAP_ARG3); + BoolBranchFilter X4 = gecode_BoolBranchFilter_from_term(YAP_ARG4); + BoolVarValPrint X5 = gecode_BoolVarValPrint_from_term(YAP_ARG5); + assign(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_32(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatAssign X3 = gecode_FloatAssign_from_term(YAP_ARG3); + FloatBranchFilter X4 = gecode_FloatBranchFilter_from_term(YAP_ARG4); + FloatVarValPrint X5 = gecode_FloatVarValPrint_from_term(YAP_ARG5); + assign(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_35(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntAssign X3 = gecode_IntAssign_from_term(YAP_ARG3); + IntBranchFilter X4 = gecode_IntBranchFilter_from_term(YAP_ARG4); + IntVarValPrint X5 = gecode_IntVarValPrint_from_term(YAP_ARG5); + assign(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_38(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + SetAssign X3 = gecode_SetAssign_from_term(YAP_ARG3); + SetBranchFilter X4 = gecode_SetBranchFilter_from_term(YAP_ARG4); + SetVarValPrint X5 = gecode_SetVarValPrint_from_term(YAP_ARG5); + assign(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_binpacking_39(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + binpacking(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_binpacking_40(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + binpacking(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_41(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + BoolValBranch X3 = gecode_BoolValBranch_from_term(YAP_ARG3); + branch(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_43(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatValBranch X3 = gecode_FloatValBranch_from_term(YAP_ARG3); + branch(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_45(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntValBranch X3 = gecode_IntValBranch_from_term(YAP_ARG3); + branch(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_47(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetValBranch X3 = gecode_SetValBranch_from_term(YAP_ARG3); + branch(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_42(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + BoolValBranch X3 = gecode_BoolValBranch_from_term(YAP_ARG3); + BoolVarValPrint X4 = gecode_BoolVarValPrint_from_term(YAP_ARG4); + branch(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_44(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatValBranch X3 = gecode_FloatValBranch_from_term(YAP_ARG3); + FloatVarValPrint X4 = gecode_FloatVarValPrint_from_term(YAP_ARG4); + branch(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_46(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntValBranch X3 = gecode_IntValBranch_from_term(YAP_ARG3); + IntVarValPrint X4 = gecode_IntVarValPrint_from_term(YAP_ARG4); + branch(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_48(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetValBranch X3 = gecode_SetValBranch_from_term(YAP_ARG3); + SetVarValPrint X4 = gecode_SetVarValPrint_from_term(YAP_ARG4); + branch(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_49(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + BoolVarBranch X3 = gecode_BoolVarBranch_from_term(YAP_ARG3); + BoolValBranch X4 = gecode_BoolValBranch_from_term(YAP_ARG4); + branch(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_55(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_BoolVarBranch_from_term(YAP_ARG3); + BoolValBranch X4 = gecode_BoolValBranch_from_term(YAP_ARG4); + branch(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_61(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatVarBranch X3 = gecode_FloatVarBranch_from_term(YAP_ARG3); + FloatValBranch X4 = gecode_FloatValBranch_from_term(YAP_ARG4); + branch(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_64(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_FloatVarBranch_from_term(YAP_ARG3); + FloatValBranch X4 = gecode_FloatValBranch_from_term(YAP_ARG4); + branch(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_67(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarBranch X3 = gecode_IntVarBranch_from_term(YAP_ARG3); + IntValBranch X4 = gecode_IntValBranch_from_term(YAP_ARG4); + branch(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_73(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_IntVarBranch_from_term(YAP_ARG3); + IntValBranch X4 = gecode_IntValBranch_from_term(YAP_ARG4); + branch(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_79(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + SetVarBranch X3 = gecode_SetVarBranch_from_term(YAP_ARG3); + SetValBranch X4 = gecode_SetValBranch_from_term(YAP_ARG4); + branch(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_85(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_SetVarBranch_from_term(YAP_ARG3); + SetValBranch X4 = gecode_SetValBranch_from_term(YAP_ARG4); + branch(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_50(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + BoolVarBranch X3 = gecode_BoolVarBranch_from_term(YAP_ARG3); + BoolValBranch X4 = gecode_BoolValBranch_from_term(YAP_ARG4); + BoolBranchFilter X5 = gecode_BoolBranchFilter_from_term(YAP_ARG5); + branch(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_52(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + BoolVarBranch X3 = gecode_BoolVarBranch_from_term(YAP_ARG3); + BoolValBranch X4 = gecode_BoolValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + branch(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_56(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_BoolVarBranch_from_term(YAP_ARG3); + BoolValBranch X4 = gecode_BoolValBranch_from_term(YAP_ARG4); + BoolBranchFilter X5 = gecode_BoolBranchFilter_from_term(YAP_ARG5); + branch(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_58(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_BoolVarBranch_from_term(YAP_ARG3); + BoolValBranch X4 = gecode_BoolValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + branch(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_62(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatVarBranch X3 = gecode_FloatVarBranch_from_term(YAP_ARG3); + FloatValBranch X4 = gecode_FloatValBranch_from_term(YAP_ARG4); + FloatBranchFilter X5 = gecode_FloatBranchFilter_from_term(YAP_ARG5); + branch(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_65(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_FloatVarBranch_from_term(YAP_ARG3); + FloatValBranch X4 = gecode_FloatValBranch_from_term(YAP_ARG4); + FloatBranchFilter X5 = gecode_FloatBranchFilter_from_term(YAP_ARG5); + branch(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_68(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarBranch X3 = gecode_IntVarBranch_from_term(YAP_ARG3); + IntValBranch X4 = gecode_IntValBranch_from_term(YAP_ARG4); + IntBranchFilter X5 = gecode_IntBranchFilter_from_term(YAP_ARG5); + branch(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_70(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarBranch X3 = gecode_IntVarBranch_from_term(YAP_ARG3); + IntValBranch X4 = gecode_IntValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + branch(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_74(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_IntVarBranch_from_term(YAP_ARG3); + IntValBranch X4 = gecode_IntValBranch_from_term(YAP_ARG4); + IntBranchFilter X5 = gecode_IntBranchFilter_from_term(YAP_ARG5); + branch(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_76(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_IntVarBranch_from_term(YAP_ARG3); + IntValBranch X4 = gecode_IntValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + branch(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_80(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + SetVarBranch X3 = gecode_SetVarBranch_from_term(YAP_ARG3); + SetValBranch X4 = gecode_SetValBranch_from_term(YAP_ARG4); + SetBranchFilter X5 = gecode_SetBranchFilter_from_term(YAP_ARG5); + branch(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_82(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + SetVarBranch X3 = gecode_SetVarBranch_from_term(YAP_ARG3); + SetValBranch X4 = gecode_SetValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + branch(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_86(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_SetVarBranch_from_term(YAP_ARG3); + SetValBranch X4 = gecode_SetValBranch_from_term(YAP_ARG4); + SetBranchFilter X5 = gecode_SetBranchFilter_from_term(YAP_ARG5); + branch(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_88(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_SetVarBranch_from_term(YAP_ARG3); + SetValBranch X4 = gecode_SetValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + branch(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_51(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + BoolVarBranch X3 = gecode_BoolVarBranch_from_term(YAP_ARG3); + BoolValBranch X4 = gecode_BoolValBranch_from_term(YAP_ARG4); + BoolBranchFilter X5 = gecode_BoolBranchFilter_from_term(YAP_ARG5); + BoolVarValPrint X6 = gecode_BoolVarValPrint_from_term(YAP_ARG6); + branch(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_53(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + BoolVarBranch X3 = gecode_BoolVarBranch_from_term(YAP_ARG3); + BoolValBranch X4 = gecode_BoolValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + BoolBranchFilter X6 = gecode_BoolBranchFilter_from_term(YAP_ARG6); + branch(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_57(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_BoolVarBranch_from_term(YAP_ARG3); + BoolValBranch X4 = gecode_BoolValBranch_from_term(YAP_ARG4); + BoolBranchFilter X5 = gecode_BoolBranchFilter_from_term(YAP_ARG5); + BoolVarValPrint X6 = gecode_BoolVarValPrint_from_term(YAP_ARG6); + branch(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_59(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_BoolVarBranch_from_term(YAP_ARG3); + BoolValBranch X4 = gecode_BoolValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + BoolBranchFilter X6 = gecode_BoolBranchFilter_from_term(YAP_ARG6); + branch(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_63(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatVarBranch X3 = gecode_FloatVarBranch_from_term(YAP_ARG3); + FloatValBranch X4 = gecode_FloatValBranch_from_term(YAP_ARG4); + FloatBranchFilter X5 = gecode_FloatBranchFilter_from_term(YAP_ARG5); + FloatVarValPrint X6 = gecode_FloatVarValPrint_from_term(YAP_ARG6); + branch(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_66(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_FloatVarBranch_from_term(YAP_ARG3); + FloatValBranch X4 = gecode_FloatValBranch_from_term(YAP_ARG4); + FloatBranchFilter X5 = gecode_FloatBranchFilter_from_term(YAP_ARG5); + FloatVarValPrint X6 = gecode_FloatVarValPrint_from_term(YAP_ARG6); + branch(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_69(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarBranch X3 = gecode_IntVarBranch_from_term(YAP_ARG3); + IntValBranch X4 = gecode_IntValBranch_from_term(YAP_ARG4); + IntBranchFilter X5 = gecode_IntBranchFilter_from_term(YAP_ARG5); + IntVarValPrint X6 = gecode_IntVarValPrint_from_term(YAP_ARG6); + branch(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_71(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarBranch X3 = gecode_IntVarBranch_from_term(YAP_ARG3); + IntValBranch X4 = gecode_IntValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + IntBranchFilter X6 = gecode_IntBranchFilter_from_term(YAP_ARG6); + branch(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_75(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_IntVarBranch_from_term(YAP_ARG3); + IntValBranch X4 = gecode_IntValBranch_from_term(YAP_ARG4); + IntBranchFilter X5 = gecode_IntBranchFilter_from_term(YAP_ARG5); + IntVarValPrint X6 = gecode_IntVarValPrint_from_term(YAP_ARG6); + branch(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_77(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_IntVarBranch_from_term(YAP_ARG3); + IntValBranch X4 = gecode_IntValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + IntBranchFilter X6 = gecode_IntBranchFilter_from_term(YAP_ARG6); + branch(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_81(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + SetVarBranch X3 = gecode_SetVarBranch_from_term(YAP_ARG3); + SetValBranch X4 = gecode_SetValBranch_from_term(YAP_ARG4); + SetBranchFilter X5 = gecode_SetBranchFilter_from_term(YAP_ARG5); + SetVarValPrint X6 = gecode_SetVarValPrint_from_term(YAP_ARG6); + branch(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_83(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + SetVarBranch X3 = gecode_SetVarBranch_from_term(YAP_ARG3); + SetValBranch X4 = gecode_SetValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + SetBranchFilter X6 = gecode_SetBranchFilter_from_term(YAP_ARG6); + branch(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_87(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_SetVarBranch_from_term(YAP_ARG3); + SetValBranch X4 = gecode_SetValBranch_from_term(YAP_ARG4); + SetBranchFilter X5 = gecode_SetBranchFilter_from_term(YAP_ARG5); + SetVarValPrint X6 = gecode_SetVarValPrint_from_term(YAP_ARG6); + branch(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_89(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_SetVarBranch_from_term(YAP_ARG3); + SetValBranch X4 = gecode_SetValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + SetBranchFilter X6 = gecode_SetBranchFilter_from_term(YAP_ARG6); + branch(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_54(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + BoolVarBranch X3 = gecode_BoolVarBranch_from_term(YAP_ARG3); + BoolValBranch X4 = gecode_BoolValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + BoolBranchFilter X6 = gecode_BoolBranchFilter_from_term(YAP_ARG6); + BoolVarValPrint X7 = gecode_BoolVarValPrint_from_term(YAP_ARG7); + branch(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_60(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_BoolVarBranch_from_term(YAP_ARG3); + BoolValBranch X4 = gecode_BoolValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + BoolBranchFilter X6 = gecode_BoolBranchFilter_from_term(YAP_ARG6); + BoolVarValPrint X7 = gecode_BoolVarValPrint_from_term(YAP_ARG7); + branch(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_72(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarBranch X3 = gecode_IntVarBranch_from_term(YAP_ARG3); + IntValBranch X4 = gecode_IntValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + IntBranchFilter X6 = gecode_IntBranchFilter_from_term(YAP_ARG6); + IntVarValPrint X7 = gecode_IntVarValPrint_from_term(YAP_ARG7); + branch(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_78(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_IntVarBranch_from_term(YAP_ARG3); + IntValBranch X4 = gecode_IntValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + IntBranchFilter X6 = gecode_IntBranchFilter_from_term(YAP_ARG6); + IntVarValPrint X7 = gecode_IntVarValPrint_from_term(YAP_ARG7); + branch(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_84(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + SetVarBranch X3 = gecode_SetVarBranch_from_term(YAP_ARG3); + SetValBranch X4 = gecode_SetValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + SetBranchFilter X6 = gecode_SetBranchFilter_from_term(YAP_ARG6); + SetVarValPrint X7 = gecode_SetVarValPrint_from_term(YAP_ARG7); + branch(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_90(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_SetVarBranch_from_term(YAP_ARG3); + SetValBranch X4 = gecode_SetValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + SetBranchFilter X6 = gecode_SetBranchFilter_from_term(YAP_ARG6); + SetVarValPrint X7 = gecode_SetVarValPrint_from_term(YAP_ARG7); + branch(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_cardinality_91(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + cardinality(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_cardinality_92(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + cardinality(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_channel_93(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + channel(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_channel_95(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + BoolVar X3 = gecode_BoolVar_from_term(space,YAP_ARG3); + channel(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_channel_96(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + channel(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_channel_97(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + channel(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_channel_100(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + channel(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_channel_94(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + channel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_channel_98(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + channel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_channel_101(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + channel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_channel_99(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + channel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_channel_102(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + channel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_channel_103(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + channel(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_circuit_104(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + circuit(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_circuit_115(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + circuit(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_circuit_105(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + circuit(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_circuit_106(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + circuit(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_circuit_108(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + circuit(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_circuit_107(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + circuit(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_circuit_109(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + circuit(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_circuit_110(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntVar X6 = gecode_IntVar_from_term(space,YAP_ARG6); + circuit(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_circuit_111(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntVar X6 = gecode_IntVar_from_term(space,YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + circuit(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_circuit_112(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + circuit(*space,X2); + return TRUE; +} + +static YAP_Bool gecode_constraint_circuit_113(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntPropLevel X3 = gecode_IntPropLevel_from_term(YAP_ARG3); + circuit(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_circuit_114(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + circuit(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_clause_116(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolOpType X2 = gecode_BoolOpType_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + BoolVarArgs X4 = gecode_BoolVarArgs_from_term(space,YAP_ARG4); + BoolVar X5 = gecode_BoolVar_from_term(space,YAP_ARG5); + clause(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_clause_118(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolOpType X2 = gecode_BoolOpType_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + BoolVarArgs X4 = gecode_BoolVarArgs_from_term(space,YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + clause(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_clause_117(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolOpType X2 = gecode_BoolOpType_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + BoolVarArgs X4 = gecode_BoolVarArgs_from_term(space,YAP_ARG4); + BoolVar X5 = gecode_BoolVar_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + clause(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_clause_119(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolOpType X2 = gecode_BoolOpType_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + BoolVarArgs X4 = gecode_BoolVarArgs_from_term(space,YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + clause(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_120(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + count(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_122(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + count(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_124(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntArgs X3 = gecode_IntArgs_from_term(YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + count(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_126(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntArgs X3 = gecode_IntArgs_from_term(YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + count(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_128(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + count(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_130(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + count(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_133(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + count(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_137(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntSetArgs X3 = gecode_IntSetArgs_from_term(YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + count(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_141(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + count(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_142(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + count(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_144(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + count(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_121(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + count(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_123(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + count(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_125(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntArgs X3 = gecode_IntArgs_from_term(YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + count(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_127(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntArgs X3 = gecode_IntArgs_from_term(YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + count(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_129(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + count(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_131(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + count(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_143(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + count(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_145(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + count(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_132(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + count(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_135(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntSetArgs X3 = gecode_IntSetArgs_from_term(YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + count(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_136(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntSetArgs X3 = gecode_IntSetArgs_from_term(YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + count(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_139(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + count(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_140(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + count(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_134(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntSetArgs X3 = gecode_IntSetArgs_from_term(YAP_ARG3); + count(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_138(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + count(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_146(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + cumulative(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_158(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + cumulative(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_147(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + cumulative(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_148(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + BoolVarArgs X6 = gecode_BoolVarArgs_from_term(space,YAP_ARG6); + cumulative(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_150(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + cumulative(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_154(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + TaskTypeArgs X3 = gecode_TaskTypeArgs_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + cumulative(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_159(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + cumulative(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_160(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + BoolVarArgs X6 = gecode_BoolVarArgs_from_term(space,YAP_ARG6); + cumulative(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_162(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + cumulative(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_166(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + TaskTypeArgs X3 = gecode_TaskTypeArgs_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + cumulative(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_149(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + BoolVarArgs X6 = gecode_BoolVarArgs_from_term(space,YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + cumulative(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_151(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + cumulative(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_152(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + BoolVarArgs X7 = gecode_BoolVarArgs_from_term(space,YAP_ARG7); + cumulative(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_155(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + TaskTypeArgs X3 = gecode_TaskTypeArgs_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + cumulative(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_156(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + TaskTypeArgs X3 = gecode_TaskTypeArgs_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + BoolVarArgs X7 = gecode_BoolVarArgs_from_term(space,YAP_ARG7); + cumulative(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_161(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + BoolVarArgs X6 = gecode_BoolVarArgs_from_term(space,YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + cumulative(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_163(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + cumulative(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_164(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + BoolVarArgs X7 = gecode_BoolVarArgs_from_term(space,YAP_ARG7); + cumulative(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_167(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + TaskTypeArgs X3 = gecode_TaskTypeArgs_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + cumulative(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_168(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + TaskTypeArgs X3 = gecode_TaskTypeArgs_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + BoolVarArgs X7 = gecode_BoolVarArgs_from_term(space,YAP_ARG7); + cumulative(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_153(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + BoolVarArgs X7 = gecode_BoolVarArgs_from_term(space,YAP_ARG7); + IntPropLevel X8 = gecode_IntPropLevel_from_term(YAP_ARG8); + cumulative(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_157(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + TaskTypeArgs X3 = gecode_TaskTypeArgs_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + BoolVarArgs X7 = gecode_BoolVarArgs_from_term(space,YAP_ARG7); + IntPropLevel X8 = gecode_IntPropLevel_from_term(YAP_ARG8); + cumulative(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_165(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + BoolVarArgs X7 = gecode_BoolVarArgs_from_term(space,YAP_ARG7); + IntPropLevel X8 = gecode_IntPropLevel_from_term(YAP_ARG8); + cumulative(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_169(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + TaskTypeArgs X3 = gecode_TaskTypeArgs_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + BoolVarArgs X7 = gecode_BoolVarArgs_from_term(space,YAP_ARG7); + IntPropLevel X8 = gecode_IntPropLevel_from_term(YAP_ARG8); + cumulative(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_170(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_172(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntVarArgs X6 = gecode_IntVarArgs_from_term(space,YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_174(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_176(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntVarArgs X6 = gecode_IntVarArgs_from_term(space,YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_178(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_180(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntVarArgs X6 = gecode_IntVarArgs_from_term(space,YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_182(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_184(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntVarArgs X6 = gecode_IntVarArgs_from_term(space,YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_171(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + IntPropLevel X9 = gecode_IntPropLevel_from_term(YAP_ARG9); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8,X9); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_173(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntVarArgs X6 = gecode_IntVarArgs_from_term(space,YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + IntPropLevel X9 = gecode_IntPropLevel_from_term(YAP_ARG9); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8,X9); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_175(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + IntPropLevel X9 = gecode_IntPropLevel_from_term(YAP_ARG9); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8,X9); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_177(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntVarArgs X6 = gecode_IntVarArgs_from_term(space,YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + IntPropLevel X9 = gecode_IntPropLevel_from_term(YAP_ARG9); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8,X9); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_179(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + IntPropLevel X9 = gecode_IntPropLevel_from_term(YAP_ARG9); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8,X9); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_181(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntVarArgs X6 = gecode_IntVarArgs_from_term(space,YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + IntPropLevel X9 = gecode_IntPropLevel_from_term(YAP_ARG9); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8,X9); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_183(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + IntPropLevel X9 = gecode_IntPropLevel_from_term(YAP_ARG9); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8,X9); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_185(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntVarArgs X6 = gecode_IntVarArgs_from_term(space,YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + IntPropLevel X9 = gecode_IntPropLevel_from_term(YAP_ARG9); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8,X9); + return TRUE; +} + +static YAP_Bool gecode_constraint_distinct_186(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + distinct(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_distinct_188(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + distinct(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_distinct_191(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntPropLevel X3 = gecode_IntPropLevel_from_term(YAP_ARG3); + distinct(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_distinct_192(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + distinct(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_distinct_187(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + distinct(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_distinct_189(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + distinct(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_distinct_193(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + distinct(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_distinct_190(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + distinct(*space,X2); + return TRUE; +} + +static YAP_Bool gecode_constraint_div_194(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatVar X3 = gecode_FloatVar_from_term(space,YAP_ARG3); + FloatVar X4 = gecode_FloatVar_from_term(space,YAP_ARG4); + div(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_div_195(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + div(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_div_196(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + div(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_divmod_197(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + divmod(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_divmod_198(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + divmod(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_199(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + BoolVar X3 = gecode_BoolVar_from_term(space,YAP_ARG3); + dom(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_203(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatVal X3 = gecode_FloatVal_from_term(YAP_ARG3); + dom(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_205(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatVar X3 = gecode_FloatVar_from_term(space,YAP_ARG3); + dom(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_206(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + dom(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_208(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + dom(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_212(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + dom(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_226(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetVar X3 = gecode_SetVar_from_term(space,YAP_ARG3); + dom(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_227(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + dom(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_230(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatVal X3 = gecode_FloatVal_from_term(YAP_ARG3); + dom(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_231(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatVarArgs X3 = gecode_FloatVarArgs_from_term(space,YAP_ARG3); + dom(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_232(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + dom(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_234(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + dom(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_236(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + dom(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_243(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + SetVarArgs X3 = gecode_SetVarArgs_from_term(space,YAP_ARG3); + dom(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_200(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + BoolVar X3 = gecode_BoolVar_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_201(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatNum X3 = gecode_FloatNum_from_term(YAP_ARG3); + FloatNum X4 = gecode_FloatNum_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_204(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatVal X3 = gecode_FloatVal_from_term(YAP_ARG3); + Reify X4 = gecode_Reify_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_207(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_209(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_210(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + Reify X4 = gecode_Reify_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_213(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_214(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + Reify X4 = gecode_Reify_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_216(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_220(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetRelType X3 = gecode_SetRelType_from_term(YAP_ARG3); + IntSet X4 = gecode_IntSet_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_222(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetRelType X3 = gecode_SetRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_228(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_229(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatNum X3 = gecode_FloatNum_from_term(YAP_ARG3); + FloatNum X4 = gecode_FloatNum_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_233(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_235(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_237(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_238(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_240(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + SetRelType X3 = gecode_SetRelType_from_term(YAP_ARG3); + IntSet X4 = gecode_IntSet_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_241(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + SetRelType X3 = gecode_SetRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_202(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatNum X3 = gecode_FloatNum_from_term(YAP_ARG3); + FloatNum X4 = gecode_FloatNum_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + dom(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_211(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + Reify X4 = gecode_Reify_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + dom(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_215(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + Reify X4 = gecode_Reify_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + dom(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_217(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + dom(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_218(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + dom(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_221(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetRelType X3 = gecode_SetRelType_from_term(YAP_ARG3); + IntSet X4 = gecode_IntSet_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + dom(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_223(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetRelType X3 = gecode_SetRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + dom(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_224(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetRelType X3 = gecode_SetRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + dom(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_239(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + dom(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_242(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + SetRelType X3 = gecode_SetRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + dom(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_219(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + dom(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_225(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetRelType X3 = gecode_SetRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + Reify X6 = gecode_Reify_from_term(YAP_ARG6); + dom(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_244(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + element(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_246(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + element(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_248(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + element(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_254(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + element(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_256(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + element(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_260(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + element(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_262(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + element(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_245(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + element(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_247(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + element(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_249(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + element(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_255(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + element(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_257(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + element(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_261(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + element(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_263(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + element(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_250(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + int X6 = gecode_int_from_term(YAP_ARG6); + BoolVar X7 = gecode_BoolVar_from_term(space,YAP_ARG7); + element(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_252(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + int X6 = gecode_int_from_term(YAP_ARG6); + IntVar X7 = gecode_IntVar_from_term(space,YAP_ARG7); + element(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_258(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + int X6 = gecode_int_from_term(YAP_ARG6); + BoolVar X7 = gecode_BoolVar_from_term(space,YAP_ARG7); + element(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_264(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + int X6 = gecode_int_from_term(YAP_ARG6); + IntVar X7 = gecode_IntVar_from_term(space,YAP_ARG7); + element(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_251(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + int X6 = gecode_int_from_term(YAP_ARG6); + BoolVar X7 = gecode_BoolVar_from_term(space,YAP_ARG7); + IntPropLevel X8 = gecode_IntPropLevel_from_term(YAP_ARG8); + element(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_253(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + int X6 = gecode_int_from_term(YAP_ARG6); + IntVar X7 = gecode_IntVar_from_term(space,YAP_ARG7); + IntPropLevel X8 = gecode_IntPropLevel_from_term(YAP_ARG8); + element(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_259(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + int X6 = gecode_int_from_term(YAP_ARG6); + BoolVar X7 = gecode_BoolVar_from_term(space,YAP_ARG7); + IntPropLevel X8 = gecode_IntPropLevel_from_term(YAP_ARG8); + element(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_265(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + int X6 = gecode_int_from_term(YAP_ARG6); + IntVar X7 = gecode_IntVar_from_term(space,YAP_ARG7); + IntPropLevel X8 = gecode_IntPropLevel_from_term(YAP_ARG8); + element(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_extensional_266(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + DFA X3 = gecode_DFA_from_term(YAP_ARG3); + extensional(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_extensional_272(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + DFA X3 = gecode_DFA_from_term(YAP_ARG3); + extensional(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_extensional_267(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + DFA X3 = gecode_DFA_from_term(YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + extensional(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_extensional_268(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + TupleSet X3 = gecode_TupleSet_from_term(YAP_ARG3); + bool X4 = gecode_bool_from_term(YAP_ARG4); + extensional(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_extensional_273(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + DFA X3 = gecode_DFA_from_term(YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + extensional(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_extensional_274(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + TupleSet X3 = gecode_TupleSet_from_term(YAP_ARG3); + bool X4 = gecode_bool_from_term(YAP_ARG4); + extensional(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_extensional_269(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + TupleSet X3 = gecode_TupleSet_from_term(YAP_ARG3); + bool X4 = gecode_bool_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + extensional(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_extensional_270(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + TupleSet X3 = gecode_TupleSet_from_term(YAP_ARG3); + bool X4 = gecode_bool_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + extensional(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_extensional_275(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + TupleSet X3 = gecode_TupleSet_from_term(YAP_ARG3); + bool X4 = gecode_bool_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + extensional(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_extensional_276(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + TupleSet X3 = gecode_TupleSet_from_term(YAP_ARG3); + bool X4 = gecode_bool_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + extensional(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_extensional_271(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + TupleSet X3 = gecode_TupleSet_from_term(YAP_ARG3); + bool X4 = gecode_bool_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + extensional(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_extensional_277(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + TupleSet X3 = gecode_TupleSet_from_term(YAP_ARG3); + bool X4 = gecode_bool_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + extensional(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_ite_278(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + BoolVar X3 = gecode_BoolVar_from_term(space,YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + BoolVar X5 = gecode_BoolVar_from_term(space,YAP_ARG5); + ite(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_ite_280(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + FloatVar X3 = gecode_FloatVar_from_term(space,YAP_ARG3); + FloatVar X4 = gecode_FloatVar_from_term(space,YAP_ARG4); + FloatVar X5 = gecode_FloatVar_from_term(space,YAP_ARG5); + ite(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_ite_281(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + ite(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_ite_283(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + SetVar X3 = gecode_SetVar_from_term(space,YAP_ARG3); + SetVar X4 = gecode_SetVar_from_term(space,YAP_ARG4); + SetVar X5 = gecode_SetVar_from_term(space,YAP_ARG5); + ite(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_ite_279(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + BoolVar X3 = gecode_BoolVar_from_term(space,YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + BoolVar X5 = gecode_BoolVar_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + ite(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_ite_282(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + ite(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_284(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + linear(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_288(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + linear(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_296(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatRelType X3 = gecode_FloatRelType_from_term(YAP_ARG3); + FloatVal X4 = gecode_FloatVal_from_term(YAP_ARG4); + linear(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_298(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatRelType X3 = gecode_FloatRelType_from_term(YAP_ARG3); + FloatVar X4 = gecode_FloatVar_from_term(space,YAP_ARG4); + linear(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_316(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + linear(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_320(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + linear(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_285(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_286(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_289(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_290(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_292(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatValArgs X2 = gecode_FloatValArgs_from_term(YAP_ARG2); + FloatVarArgs X3 = gecode_FloatVarArgs_from_term(space,YAP_ARG3); + FloatRelType X4 = gecode_FloatRelType_from_term(YAP_ARG4); + FloatVal X5 = gecode_FloatVal_from_term(YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_294(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatValArgs X2 = gecode_FloatValArgs_from_term(YAP_ARG2); + FloatVarArgs X3 = gecode_FloatVarArgs_from_term(space,YAP_ARG3); + FloatRelType X4 = gecode_FloatRelType_from_term(YAP_ARG4); + FloatVar X5 = gecode_FloatVar_from_term(space,YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_297(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatRelType X3 = gecode_FloatRelType_from_term(YAP_ARG3); + FloatVal X4 = gecode_FloatVal_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_299(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatRelType X3 = gecode_FloatRelType_from_term(YAP_ARG3); + FloatVar X4 = gecode_FloatVar_from_term(space,YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_300(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_304(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_308(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_312(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_317(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_318(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_321(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_322(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_287(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + linear(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_291(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + linear(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_293(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatValArgs X2 = gecode_FloatValArgs_from_term(YAP_ARG2); + FloatVarArgs X3 = gecode_FloatVarArgs_from_term(space,YAP_ARG3); + FloatRelType X4 = gecode_FloatRelType_from_term(YAP_ARG4); + FloatVal X5 = gecode_FloatVal_from_term(YAP_ARG5); + Reify X6 = gecode_Reify_from_term(YAP_ARG6); + linear(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_295(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatValArgs X2 = gecode_FloatValArgs_from_term(YAP_ARG2); + FloatVarArgs X3 = gecode_FloatVarArgs_from_term(space,YAP_ARG3); + FloatRelType X4 = gecode_FloatRelType_from_term(YAP_ARG4); + FloatVar X5 = gecode_FloatVar_from_term(space,YAP_ARG5); + Reify X6 = gecode_Reify_from_term(YAP_ARG6); + linear(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_301(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + linear(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_302(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + Reify X6 = gecode_Reify_from_term(YAP_ARG6); + linear(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_305(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + linear(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_306(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + Reify X6 = gecode_Reify_from_term(YAP_ARG6); + linear(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_309(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + linear(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_310(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + Reify X6 = gecode_Reify_from_term(YAP_ARG6); + linear(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_313(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + linear(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_314(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + Reify X6 = gecode_Reify_from_term(YAP_ARG6); + linear(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_319(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + linear(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_323(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + linear(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_303(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + Reify X6 = gecode_Reify_from_term(YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + linear(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_307(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + Reify X6 = gecode_Reify_from_term(YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + linear(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_311(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + Reify X6 = gecode_Reify_from_term(YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + linear(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_315(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + Reify X6 = gecode_Reify_from_term(YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + linear(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_max_324(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatVar X3 = gecode_FloatVar_from_term(space,YAP_ARG3); + FloatVar X4 = gecode_FloatVar_from_term(space,YAP_ARG4); + max(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_max_325(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + max(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_max_329(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + max(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_max_326(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + max(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_max_327(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatVar X3 = gecode_FloatVar_from_term(space,YAP_ARG3); + max(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_max_328(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + max(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_member_330(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + BoolVar X3 = gecode_BoolVar_from_term(space,YAP_ARG3); + member(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_member_334(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + member(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_member_331(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + BoolVar X3 = gecode_BoolVar_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + member(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_member_332(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + BoolVar X3 = gecode_BoolVar_from_term(space,YAP_ARG3); + Reify X4 = gecode_Reify_from_term(YAP_ARG4); + member(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_member_335(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + member(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_member_336(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + Reify X4 = gecode_Reify_from_term(YAP_ARG4); + member(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_member_333(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + BoolVar X3 = gecode_BoolVar_from_term(space,YAP_ARG3); + Reify X4 = gecode_Reify_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + member(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_member_337(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + Reify X4 = gecode_Reify_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + member(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_min_338(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatVar X3 = gecode_FloatVar_from_term(space,YAP_ARG3); + FloatVar X4 = gecode_FloatVar_from_term(space,YAP_ARG4); + min(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_min_339(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + min(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_min_343(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + min(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_min_340(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + min(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_min_341(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatVar X3 = gecode_FloatVar_from_term(space,YAP_ARG3); + min(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_min_342(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + min(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_mod_344(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + mod(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_mod_345(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + mod(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_mult_346(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatVar X3 = gecode_FloatVar_from_term(space,YAP_ARG3); + FloatVar X4 = gecode_FloatVar_from_term(space,YAP_ARG4); + mult(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_mult_347(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + mult(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_mult_348(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + mult(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_nooverlap_349(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntArgs X3 = gecode_IntArgs_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + nooverlap(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_nooverlap_350(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntArgs X3 = gecode_IntArgs_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + nooverlap(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_nooverlap_351(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntArgs X3 = gecode_IntArgs_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + BoolVarArgs X6 = gecode_BoolVarArgs_from_term(space,YAP_ARG6); + nooverlap(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_nooverlap_352(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntArgs X3 = gecode_IntArgs_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + BoolVarArgs X6 = gecode_BoolVarArgs_from_term(space,YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + nooverlap(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_nooverlap_353(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntVarArgs X6 = gecode_IntVarArgs_from_term(space,YAP_ARG6); + IntVarArgs X7 = gecode_IntVarArgs_from_term(space,YAP_ARG7); + nooverlap(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_nooverlap_354(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntVarArgs X6 = gecode_IntVarArgs_from_term(space,YAP_ARG6); + IntVarArgs X7 = gecode_IntVarArgs_from_term(space,YAP_ARG7); + IntPropLevel X8 = gecode_IntPropLevel_from_term(YAP_ARG8); + nooverlap(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_nooverlap_355(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntVarArgs X6 = gecode_IntVarArgs_from_term(space,YAP_ARG6); + IntVarArgs X7 = gecode_IntVarArgs_from_term(space,YAP_ARG7); + BoolVarArgs X8 = gecode_BoolVarArgs_from_term(space,YAP_ARG8); + nooverlap(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_nooverlap_356(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntVarArgs X6 = gecode_IntVarArgs_from_term(space,YAP_ARG6); + IntVarArgs X7 = gecode_IntVarArgs_from_term(space,YAP_ARG7); + BoolVarArgs X8 = gecode_BoolVarArgs_from_term(space,YAP_ARG8); + IntPropLevel X9 = gecode_IntPropLevel_from_term(YAP_ARG9); + nooverlap(*space,X2,X3,X4,X5,X6,X7,X8,X9); + return TRUE; +} + +static YAP_Bool gecode_constraint_nroot_357(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + FloatVar X4 = gecode_FloatVar_from_term(space,YAP_ARG4); + nroot(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_nroot_358(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + nroot(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_nroot_359(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + nroot(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_nvalues_360(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + nvalues(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_nvalues_362(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + nvalues(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_nvalues_364(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + nvalues(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_nvalues_366(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + nvalues(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_nvalues_361(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + nvalues(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_nvalues_363(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + nvalues(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_nvalues_365(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + nvalues(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_nvalues_367(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + nvalues(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_path_368(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntVar X6 = gecode_IntVar_from_term(space,YAP_ARG6); + path(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_path_379(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + path(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_path_369(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntVar X6 = gecode_IntVar_from_term(space,YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + path(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_path_370(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntVarArgs X6 = gecode_IntVarArgs_from_term(space,YAP_ARG6); + IntVar X7 = gecode_IntVar_from_term(space,YAP_ARG7); + path(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_path_372(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntVar X6 = gecode_IntVar_from_term(space,YAP_ARG6); + IntVar X7 = gecode_IntVar_from_term(space,YAP_ARG7); + path(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_path_371(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntVarArgs X6 = gecode_IntVarArgs_from_term(space,YAP_ARG6); + IntVar X7 = gecode_IntVar_from_term(space,YAP_ARG7); + IntPropLevel X8 = gecode_IntPropLevel_from_term(YAP_ARG8); + path(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_path_373(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntVar X6 = gecode_IntVar_from_term(space,YAP_ARG6); + IntVar X7 = gecode_IntVar_from_term(space,YAP_ARG7); + IntPropLevel X8 = gecode_IntPropLevel_from_term(YAP_ARG8); + path(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_path_374(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntVar X6 = gecode_IntVar_from_term(space,YAP_ARG6); + IntVarArgs X7 = gecode_IntVarArgs_from_term(space,YAP_ARG7); + IntVar X8 = gecode_IntVar_from_term(space,YAP_ARG8); + path(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_path_375(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntVar X6 = gecode_IntVar_from_term(space,YAP_ARG6); + IntVarArgs X7 = gecode_IntVarArgs_from_term(space,YAP_ARG7); + IntVar X8 = gecode_IntVar_from_term(space,YAP_ARG8); + IntPropLevel X9 = gecode_IntPropLevel_from_term(YAP_ARG9); + path(*space,X2,X3,X4,X5,X6,X7,X8,X9); + return TRUE; +} + +static YAP_Bool gecode_constraint_path_376(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + path(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_path_377(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + path(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_path_378(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + path(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_pow_380(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + FloatVar X4 = gecode_FloatVar_from_term(space,YAP_ARG4); + pow(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_pow_381(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + pow(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_pow_382(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + pow(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_precede_383(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntArgs X3 = gecode_IntArgs_from_term(YAP_ARG3); + precede(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_precede_384(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntArgs X3 = gecode_IntArgs_from_term(YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + precede(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_precede_385(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + precede(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_precede_386(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + precede(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_387(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolOpType X2 = gecode_BoolOpType_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_389(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolOpType X2 = gecode_BoolOpType_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_395(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_399(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_403(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatRelType X3 = gecode_FloatRelType_from_term(YAP_ARG3); + FloatVal X4 = gecode_FloatVal_from_term(YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_405(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatRelType X3 = gecode_FloatRelType_from_term(YAP_ARG3); + FloatVar X4 = gecode_FloatVar_from_term(space,YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_407(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_411(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_415(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + SetRelType X3 = gecode_SetRelType_from_term(YAP_ARG3); + SetVar X4 = gecode_SetVar_from_term(space,YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_417(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_419(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetRelType X3 = gecode_SetRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_421(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetRelType X3 = gecode_SetRelType_from_term(YAP_ARG3); + SetVar X4 = gecode_SetVar_from_term(space,YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_423(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_426(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_427(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + BoolVarArgs X4 = gecode_BoolVarArgs_from_term(space,YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_429(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_431(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_433(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatRelType X3 = gecode_FloatRelType_from_term(YAP_ARG3); + FloatVal X4 = gecode_FloatVal_from_term(YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_434(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatRelType X3 = gecode_FloatRelType_from_term(YAP_ARG3); + FloatVar X4 = gecode_FloatVar_from_term(space,YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_435(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + BoolVarArgs X4 = gecode_BoolVarArgs_from_term(space,YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_437(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_440(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_441(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_443(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_445(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_447(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_388(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolOpType X2 = gecode_BoolOpType_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_390(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolOpType X2 = gecode_BoolOpType_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_391(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + BoolOpType X3 = gecode_BoolOpType_from_term(YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + BoolVar X5 = gecode_BoolVar_from_term(space,YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_393(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + BoolOpType X3 = gecode_BoolOpType_from_term(YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_396(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_397(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_400(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_401(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_404(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatRelType X3 = gecode_FloatRelType_from_term(YAP_ARG3); + FloatVal X4 = gecode_FloatVal_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_406(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatRelType X3 = gecode_FloatRelType_from_term(YAP_ARG3); + FloatVar X4 = gecode_FloatVar_from_term(space,YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_408(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_409(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_412(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_413(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_416(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + SetRelType X3 = gecode_SetRelType_from_term(YAP_ARG3); + SetVar X4 = gecode_SetVar_from_term(space,YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_418(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_420(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetRelType X3 = gecode_SetRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_422(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetRelType X3 = gecode_SetRelType_from_term(YAP_ARG3); + SetVar X4 = gecode_SetVar_from_term(space,YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_424(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_428(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + BoolVarArgs X4 = gecode_BoolVarArgs_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_430(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_432(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_436(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + BoolVarArgs X4 = gecode_BoolVarArgs_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_438(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_442(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_444(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_446(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_448(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_392(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + BoolOpType X3 = gecode_BoolOpType_from_term(YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + BoolVar X5 = gecode_BoolVar_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + rel(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_394(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + BoolOpType X3 = gecode_BoolOpType_from_term(YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + rel(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_398(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + rel(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_402(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + rel(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_410(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + rel(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_414(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + rel(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_425(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + rel(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_439(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + rel(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_relax_449(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + SetVarArgs X3 = gecode_SetVarArgs_from_term(space,YAP_ARG3); + Rnd X4 = gecode_Rnd_from_term(YAP_ARG4); + double X5 = gecode_double_from_term(YAP_ARG5); + relax(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_sequence_450(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + int X6 = gecode_int_from_term(YAP_ARG6); + sequence(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_sequence_452(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + int X6 = gecode_int_from_term(YAP_ARG6); + sequence(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_sequence_451(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + int X6 = gecode_int_from_term(YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + sequence(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_sequence_453(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + int X6 = gecode_int_from_term(YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + sequence(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_sorted_454(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + sorted(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_sorted_455(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + sorted(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_sorted_456(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + sorted(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_sorted_457(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + sorted(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_sqr_458(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatVar X3 = gecode_FloatVar_from_term(space,YAP_ARG3); + sqr(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_sqr_459(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + sqr(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_sqr_460(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + sqr(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_sqrt_461(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatVar X3 = gecode_FloatVar_from_term(space,YAP_ARG3); + sqrt(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_sqrt_462(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + sqrt(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_sqrt_463(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + sqrt(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_unary_464(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntArgs X3 = gecode_IntArgs_from_term(YAP_ARG3); + unary(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_unary_465(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntArgs X3 = gecode_IntArgs_from_term(YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + unary(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_unary_466(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntArgs X3 = gecode_IntArgs_from_term(YAP_ARG3); + BoolVarArgs X4 = gecode_BoolVarArgs_from_term(space,YAP_ARG4); + unary(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_unary_468(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + unary(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_unary_472(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + TaskTypeArgs X2 = gecode_TaskTypeArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + unary(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_unary_467(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntArgs X3 = gecode_IntArgs_from_term(YAP_ARG3); + BoolVarArgs X4 = gecode_BoolVarArgs_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + unary(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_unary_469(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + unary(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_unary_470(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + BoolVarArgs X5 = gecode_BoolVarArgs_from_term(space,YAP_ARG5); + unary(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_unary_473(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + TaskTypeArgs X2 = gecode_TaskTypeArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + unary(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_unary_474(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + TaskTypeArgs X2 = gecode_TaskTypeArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + BoolVarArgs X5 = gecode_BoolVarArgs_from_term(space,YAP_ARG5); + unary(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_unary_471(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + BoolVarArgs X5 = gecode_BoolVarArgs_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + unary(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_unary_475(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + TaskTypeArgs X2 = gecode_TaskTypeArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + BoolVarArgs X5 = gecode_BoolVarArgs_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + unary(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_unshare_476(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + unshare(*space,X2); + return TRUE; +} + +static YAP_Bool gecode_constraint_unshare_478(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + unshare(*space,X2); + return TRUE; +} + +static YAP_Bool gecode_constraint_unshare_477(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntPropLevel X3 = gecode_IntPropLevel_from_term(YAP_ARG3); + unshare(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_unshare_479(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntPropLevel X3 = gecode_IntPropLevel_from_term(YAP_ARG3); + unshare(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_when_480(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + std::function X3 = gecode_std_function_from_term(YAP_ARG3); + when(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_when_481(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + std::function X3 = gecode_std_function_from_term(YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + when(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_when_482(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + std::function X3 = gecode_std_function_from_term(YAP_ARG3); + std::function X4 = gecode_std_function_from_term(YAP_ARG4); + when(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_when_483(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + std::function X3 = gecode_std_function_from_term(YAP_ARG3); + std::function X4 = gecode_std_function_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + when(*space,X2,X3,X4,X5); + return TRUE; +} + diff --git a/packages/gecode/6.1.1/gecode_yap_cc_init_auto_generated.icc b/packages/gecode/6.1.1/gecode_yap_cc_init_auto_generated.icc new file mode 100644 index 000000000..7cdbb49bb --- /dev/null +++ b/packages/gecode/6.1.1/gecode_yap_cc_init_auto_generated.icc @@ -0,0 +1,679 @@ +// -*- c++ -*- +//============================================================================= +// Copyright (C) 2011 by Denys Duchier +// +// This program is free software: you can redistribute it and/or modify it +// under the terms of the GNU Lesser General Public License as published by the +// Free Software Foundation, either version 3 of the License, or (at your +// option) any later version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +// more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . +//============================================================================= + +{ YAP_Atom X= YAP_LookupAtom("RM_NONE"); + gecode_RM_NONE = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("RM_CONSTANT"); + gecode_RM_CONSTANT = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("RM_LINEAR"); + gecode_RM_LINEAR = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("RM_LUBY"); + gecode_RM_LUBY = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("RM_GEOMETRIC"); + gecode_RM_GEOMETRIC = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } + +{ YAP_Atom X= YAP_LookupAtom("FRT_EQ"); + gecode_FRT_EQ = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("FRT_NQ"); + gecode_FRT_NQ = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("FRT_LQ"); + gecode_FRT_LQ = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("FRT_LE"); + gecode_FRT_LE = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("FRT_GQ"); + gecode_FRT_GQ = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("FRT_GR"); + gecode_FRT_GR = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } + +{ YAP_Atom X= YAP_LookupAtom("RM_EQV"); + gecode_RM_EQV = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("RM_IMP"); + gecode_RM_IMP = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("RM_PMI"); + gecode_RM_PMI = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } + +{ YAP_Atom X= YAP_LookupAtom("IRT_EQ"); + gecode_IRT_EQ = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("IRT_NQ"); + gecode_IRT_NQ = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("IRT_LQ"); + gecode_IRT_LQ = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("IRT_LE"); + gecode_IRT_LE = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("IRT_GQ"); + gecode_IRT_GQ = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("IRT_GR"); + gecode_IRT_GR = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } + +{ YAP_Atom X= YAP_LookupAtom("BOT_AND"); + gecode_BOT_AND = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("BOT_OR"); + gecode_BOT_OR = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("BOT_IMP"); + gecode_BOT_IMP = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("BOT_EQV"); + gecode_BOT_EQV = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("BOT_XOR"); + gecode_BOT_XOR = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } + +{ YAP_Atom X= YAP_LookupAtom("IPL_DEF"); + gecode_IPL_DEF = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("IPL_VAL"); + gecode_IPL_VAL = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("IPL_BND"); + gecode_IPL_BND = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("IPL_DOM"); + gecode_IPL_DOM = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("IPL_BASIC"); + gecode_IPL_BASIC = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("IPL_ADVANCED"); + gecode_IPL_ADVANCED = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("IPL_BASIC_ADVANCED"); + gecode_IPL_BASIC_ADVANCED = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } + +{ YAP_Atom X= YAP_LookupAtom("TT_FIXP"); + gecode_TT_FIXP = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("TT_FIXS"); + gecode_TT_FIXS = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("TT_FIXE"); + gecode_TT_FIXE = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } + +{ YAP_Atom X= YAP_LookupAtom("TE_INIT"); + gecode_TE_INIT = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("TE_PRUNE"); + gecode_TE_PRUNE = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("TE_FIX"); + gecode_TE_FIX = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("TE_FAIL"); + gecode_TE_FAIL = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("TE_DONE"); + gecode_TE_DONE = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("TE_PROPAGATE"); + gecode_TE_PROPAGATE = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("TE_COMMIT"); + gecode_TE_COMMIT = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } + +{ YAP_Atom X= YAP_LookupAtom("SRT_EQ"); + gecode_SRT_EQ = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("SRT_NQ"); + gecode_SRT_NQ = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("SRT_SUB"); + gecode_SRT_SUB = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("SRT_SUP"); + gecode_SRT_SUP = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("SRT_DISJ"); + gecode_SRT_DISJ = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("SRT_CMPL"); + gecode_SRT_CMPL = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("SRT_LQ"); + gecode_SRT_LQ = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("SRT_LE"); + gecode_SRT_LE = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("SRT_GQ"); + gecode_SRT_GQ = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("SRT_GR"); + gecode_SRT_GR = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } + +{ YAP_Atom X= YAP_LookupAtom("SOT_UNION"); + gecode_SOT_UNION = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("SOT_DUNION"); + gecode_SOT_DUNION = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("SOT_INTER"); + gecode_SOT_INTER = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("SOT_MINUS"); + gecode_SOT_MINUS = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } + +YAP_UserCPredicate("gecode_constraint_branch_1", gecode_constraint_branch_1, 2); +YAP_UserCPredicate("gecode_constraint_convex_2", gecode_constraint_convex_2, 2); +YAP_UserCPredicate("gecode_constraint_convex_3", gecode_constraint_convex_3, 3); +YAP_UserCPredicate("gecode_constraint_abs_4", gecode_constraint_abs_4, 3); +YAP_UserCPredicate("gecode_constraint_abs_5", gecode_constraint_abs_5, 3); +YAP_UserCPredicate("gecode_constraint_abs_6", gecode_constraint_abs_6, 4); +YAP_UserCPredicate("gecode_constraint_argmax_7", gecode_constraint_argmax_7, 3); +YAP_UserCPredicate("gecode_constraint_argmax_8", gecode_constraint_argmax_8, 4); +YAP_UserCPredicate("gecode_constraint_argmax_10", gecode_constraint_argmax_10, 4); +YAP_UserCPredicate("gecode_constraint_argmax_9", gecode_constraint_argmax_9, 5); +YAP_UserCPredicate("gecode_constraint_argmax_11", gecode_constraint_argmax_11, 5); +YAP_UserCPredicate("gecode_constraint_argmax_12", gecode_constraint_argmax_12, 6); +YAP_UserCPredicate("gecode_constraint_argmin_13", gecode_constraint_argmin_13, 3); +YAP_UserCPredicate("gecode_constraint_argmin_14", gecode_constraint_argmin_14, 4); +YAP_UserCPredicate("gecode_constraint_argmin_16", gecode_constraint_argmin_16, 4); +YAP_UserCPredicate("gecode_constraint_argmin_15", gecode_constraint_argmin_15, 5); +YAP_UserCPredicate("gecode_constraint_argmin_17", gecode_constraint_argmin_17, 5); +YAP_UserCPredicate("gecode_constraint_argmin_18", gecode_constraint_argmin_18, 6); +YAP_UserCPredicate("gecode_constraint_assign_19", gecode_constraint_assign_19, 3); +YAP_UserCPredicate("gecode_constraint_assign_21", gecode_constraint_assign_21, 3); +YAP_UserCPredicate("gecode_constraint_assign_23", gecode_constraint_assign_23, 3); +YAP_UserCPredicate("gecode_constraint_assign_25", gecode_constraint_assign_25, 3); +YAP_UserCPredicate("gecode_constraint_assign_27", gecode_constraint_assign_27, 3); +YAP_UserCPredicate("gecode_constraint_assign_30", gecode_constraint_assign_30, 3); +YAP_UserCPredicate("gecode_constraint_assign_33", gecode_constraint_assign_33, 3); +YAP_UserCPredicate("gecode_constraint_assign_36", gecode_constraint_assign_36, 3); +YAP_UserCPredicate("gecode_constraint_assign_20", gecode_constraint_assign_20, 4); +YAP_UserCPredicate("gecode_constraint_assign_22", gecode_constraint_assign_22, 4); +YAP_UserCPredicate("gecode_constraint_assign_24", gecode_constraint_assign_24, 4); +YAP_UserCPredicate("gecode_constraint_assign_26", gecode_constraint_assign_26, 4); +YAP_UserCPredicate("gecode_constraint_assign_28", gecode_constraint_assign_28, 4); +YAP_UserCPredicate("gecode_constraint_assign_31", gecode_constraint_assign_31, 4); +YAP_UserCPredicate("gecode_constraint_assign_34", gecode_constraint_assign_34, 4); +YAP_UserCPredicate("gecode_constraint_assign_37", gecode_constraint_assign_37, 4); +YAP_UserCPredicate("gecode_constraint_assign_29", gecode_constraint_assign_29, 5); +YAP_UserCPredicate("gecode_constraint_assign_32", gecode_constraint_assign_32, 5); +YAP_UserCPredicate("gecode_constraint_assign_35", gecode_constraint_assign_35, 5); +YAP_UserCPredicate("gecode_constraint_assign_38", gecode_constraint_assign_38, 5); +YAP_UserCPredicate("gecode_constraint_binpacking_39", gecode_constraint_binpacking_39, 4); +YAP_UserCPredicate("gecode_constraint_binpacking_40", gecode_constraint_binpacking_40, 5); +YAP_UserCPredicate("gecode_constraint_branch_41", gecode_constraint_branch_41, 3); +YAP_UserCPredicate("gecode_constraint_branch_43", gecode_constraint_branch_43, 3); +YAP_UserCPredicate("gecode_constraint_branch_45", gecode_constraint_branch_45, 3); +YAP_UserCPredicate("gecode_constraint_branch_47", gecode_constraint_branch_47, 3); +YAP_UserCPredicate("gecode_constraint_branch_42", gecode_constraint_branch_42, 4); +YAP_UserCPredicate("gecode_constraint_branch_44", gecode_constraint_branch_44, 4); +YAP_UserCPredicate("gecode_constraint_branch_46", gecode_constraint_branch_46, 4); +YAP_UserCPredicate("gecode_constraint_branch_48", gecode_constraint_branch_48, 4); +YAP_UserCPredicate("gecode_constraint_branch_49", gecode_constraint_branch_49, 4); +YAP_UserCPredicate("gecode_constraint_branch_55", gecode_constraint_branch_55, 4); +YAP_UserCPredicate("gecode_constraint_branch_61", gecode_constraint_branch_61, 4); +YAP_UserCPredicate("gecode_constraint_branch_64", gecode_constraint_branch_64, 4); +YAP_UserCPredicate("gecode_constraint_branch_67", gecode_constraint_branch_67, 4); +YAP_UserCPredicate("gecode_constraint_branch_73", gecode_constraint_branch_73, 4); +YAP_UserCPredicate("gecode_constraint_branch_79", gecode_constraint_branch_79, 4); +YAP_UserCPredicate("gecode_constraint_branch_85", gecode_constraint_branch_85, 4); +YAP_UserCPredicate("gecode_constraint_branch_50", gecode_constraint_branch_50, 5); +YAP_UserCPredicate("gecode_constraint_branch_52", gecode_constraint_branch_52, 5); +YAP_UserCPredicate("gecode_constraint_branch_56", gecode_constraint_branch_56, 5); +YAP_UserCPredicate("gecode_constraint_branch_58", gecode_constraint_branch_58, 5); +YAP_UserCPredicate("gecode_constraint_branch_62", gecode_constraint_branch_62, 5); +YAP_UserCPredicate("gecode_constraint_branch_65", gecode_constraint_branch_65, 5); +YAP_UserCPredicate("gecode_constraint_branch_68", gecode_constraint_branch_68, 5); +YAP_UserCPredicate("gecode_constraint_branch_70", gecode_constraint_branch_70, 5); +YAP_UserCPredicate("gecode_constraint_branch_74", gecode_constraint_branch_74, 5); +YAP_UserCPredicate("gecode_constraint_branch_76", gecode_constraint_branch_76, 5); +YAP_UserCPredicate("gecode_constraint_branch_80", gecode_constraint_branch_80, 5); +YAP_UserCPredicate("gecode_constraint_branch_82", gecode_constraint_branch_82, 5); +YAP_UserCPredicate("gecode_constraint_branch_86", gecode_constraint_branch_86, 5); +YAP_UserCPredicate("gecode_constraint_branch_88", gecode_constraint_branch_88, 5); +YAP_UserCPredicate("gecode_constraint_branch_51", gecode_constraint_branch_51, 6); +YAP_UserCPredicate("gecode_constraint_branch_53", gecode_constraint_branch_53, 6); +YAP_UserCPredicate("gecode_constraint_branch_57", gecode_constraint_branch_57, 6); +YAP_UserCPredicate("gecode_constraint_branch_59", gecode_constraint_branch_59, 6); +YAP_UserCPredicate("gecode_constraint_branch_63", gecode_constraint_branch_63, 6); +YAP_UserCPredicate("gecode_constraint_branch_66", gecode_constraint_branch_66, 6); +YAP_UserCPredicate("gecode_constraint_branch_69", gecode_constraint_branch_69, 6); +YAP_UserCPredicate("gecode_constraint_branch_71", gecode_constraint_branch_71, 6); +YAP_UserCPredicate("gecode_constraint_branch_75", gecode_constraint_branch_75, 6); +YAP_UserCPredicate("gecode_constraint_branch_77", gecode_constraint_branch_77, 6); +YAP_UserCPredicate("gecode_constraint_branch_81", gecode_constraint_branch_81, 6); +YAP_UserCPredicate("gecode_constraint_branch_83", gecode_constraint_branch_83, 6); +YAP_UserCPredicate("gecode_constraint_branch_87", gecode_constraint_branch_87, 6); +YAP_UserCPredicate("gecode_constraint_branch_89", gecode_constraint_branch_89, 6); +YAP_UserCPredicate("gecode_constraint_branch_54", gecode_constraint_branch_54, 7); +YAP_UserCPredicate("gecode_constraint_branch_60", gecode_constraint_branch_60, 7); +YAP_UserCPredicate("gecode_constraint_branch_72", gecode_constraint_branch_72, 7); +YAP_UserCPredicate("gecode_constraint_branch_78", gecode_constraint_branch_78, 7); +YAP_UserCPredicate("gecode_constraint_branch_84", gecode_constraint_branch_84, 7); +YAP_UserCPredicate("gecode_constraint_branch_90", gecode_constraint_branch_90, 7); +YAP_UserCPredicate("gecode_constraint_cardinality_91", gecode_constraint_cardinality_91, 4); +YAP_UserCPredicate("gecode_constraint_cardinality_92", gecode_constraint_cardinality_92, 4); +YAP_UserCPredicate("gecode_constraint_channel_93", gecode_constraint_channel_93, 3); +YAP_UserCPredicate("gecode_constraint_channel_95", gecode_constraint_channel_95, 3); +YAP_UserCPredicate("gecode_constraint_channel_96", gecode_constraint_channel_96, 3); +YAP_UserCPredicate("gecode_constraint_channel_97", gecode_constraint_channel_97, 3); +YAP_UserCPredicate("gecode_constraint_channel_100", gecode_constraint_channel_100, 3); +YAP_UserCPredicate("gecode_constraint_channel_94", gecode_constraint_channel_94, 4); +YAP_UserCPredicate("gecode_constraint_channel_98", gecode_constraint_channel_98, 4); +YAP_UserCPredicate("gecode_constraint_channel_101", gecode_constraint_channel_101, 4); +YAP_UserCPredicate("gecode_constraint_channel_99", gecode_constraint_channel_99, 5); +YAP_UserCPredicate("gecode_constraint_channel_102", gecode_constraint_channel_102, 5); +YAP_UserCPredicate("gecode_constraint_channel_103", gecode_constraint_channel_103, 6); +YAP_UserCPredicate("gecode_constraint_circuit_104", gecode_constraint_circuit_104, 4); +YAP_UserCPredicate("gecode_constraint_circuit_115", gecode_constraint_circuit_115, 4); +YAP_UserCPredicate("gecode_constraint_circuit_105", gecode_constraint_circuit_105, 5); +YAP_UserCPredicate("gecode_constraint_circuit_106", gecode_constraint_circuit_106, 5); +YAP_UserCPredicate("gecode_constraint_circuit_108", gecode_constraint_circuit_108, 5); +YAP_UserCPredicate("gecode_constraint_circuit_107", gecode_constraint_circuit_107, 6); +YAP_UserCPredicate("gecode_constraint_circuit_109", gecode_constraint_circuit_109, 6); +YAP_UserCPredicate("gecode_constraint_circuit_110", gecode_constraint_circuit_110, 6); +YAP_UserCPredicate("gecode_constraint_circuit_111", gecode_constraint_circuit_111, 7); +YAP_UserCPredicate("gecode_constraint_circuit_112", gecode_constraint_circuit_112, 2); +YAP_UserCPredicate("gecode_constraint_circuit_113", gecode_constraint_circuit_113, 3); +YAP_UserCPredicate("gecode_constraint_circuit_114", gecode_constraint_circuit_114, 3); +YAP_UserCPredicate("gecode_constraint_clause_116", gecode_constraint_clause_116, 5); +YAP_UserCPredicate("gecode_constraint_clause_118", gecode_constraint_clause_118, 5); +YAP_UserCPredicate("gecode_constraint_clause_117", gecode_constraint_clause_117, 6); +YAP_UserCPredicate("gecode_constraint_clause_119", gecode_constraint_clause_119, 6); +YAP_UserCPredicate("gecode_constraint_count_120", gecode_constraint_count_120, 5); +YAP_UserCPredicate("gecode_constraint_count_122", gecode_constraint_count_122, 5); +YAP_UserCPredicate("gecode_constraint_count_124", gecode_constraint_count_124, 5); +YAP_UserCPredicate("gecode_constraint_count_126", gecode_constraint_count_126, 5); +YAP_UserCPredicate("gecode_constraint_count_128", gecode_constraint_count_128, 5); +YAP_UserCPredicate("gecode_constraint_count_130", gecode_constraint_count_130, 5); +YAP_UserCPredicate("gecode_constraint_count_133", gecode_constraint_count_133, 5); +YAP_UserCPredicate("gecode_constraint_count_137", gecode_constraint_count_137, 5); +YAP_UserCPredicate("gecode_constraint_count_141", gecode_constraint_count_141, 5); +YAP_UserCPredicate("gecode_constraint_count_142", gecode_constraint_count_142, 5); +YAP_UserCPredicate("gecode_constraint_count_144", gecode_constraint_count_144, 5); +YAP_UserCPredicate("gecode_constraint_count_121", gecode_constraint_count_121, 6); +YAP_UserCPredicate("gecode_constraint_count_123", gecode_constraint_count_123, 6); +YAP_UserCPredicate("gecode_constraint_count_125", gecode_constraint_count_125, 6); +YAP_UserCPredicate("gecode_constraint_count_127", gecode_constraint_count_127, 6); +YAP_UserCPredicate("gecode_constraint_count_129", gecode_constraint_count_129, 6); +YAP_UserCPredicate("gecode_constraint_count_131", gecode_constraint_count_131, 6); +YAP_UserCPredicate("gecode_constraint_count_143", gecode_constraint_count_143, 6); +YAP_UserCPredicate("gecode_constraint_count_145", gecode_constraint_count_145, 6); +YAP_UserCPredicate("gecode_constraint_count_132", gecode_constraint_count_132, 4); +YAP_UserCPredicate("gecode_constraint_count_135", gecode_constraint_count_135, 4); +YAP_UserCPredicate("gecode_constraint_count_136", gecode_constraint_count_136, 4); +YAP_UserCPredicate("gecode_constraint_count_139", gecode_constraint_count_139, 4); +YAP_UserCPredicate("gecode_constraint_count_140", gecode_constraint_count_140, 4); +YAP_UserCPredicate("gecode_constraint_count_134", gecode_constraint_count_134, 3); +YAP_UserCPredicate("gecode_constraint_count_138", gecode_constraint_count_138, 3); +YAP_UserCPredicate("gecode_constraint_cumulative_146", gecode_constraint_cumulative_146, 5); +YAP_UserCPredicate("gecode_constraint_cumulative_158", gecode_constraint_cumulative_158, 5); +YAP_UserCPredicate("gecode_constraint_cumulative_147", gecode_constraint_cumulative_147, 6); +YAP_UserCPredicate("gecode_constraint_cumulative_148", gecode_constraint_cumulative_148, 6); +YAP_UserCPredicate("gecode_constraint_cumulative_150", gecode_constraint_cumulative_150, 6); +YAP_UserCPredicate("gecode_constraint_cumulative_154", gecode_constraint_cumulative_154, 6); +YAP_UserCPredicate("gecode_constraint_cumulative_159", gecode_constraint_cumulative_159, 6); +YAP_UserCPredicate("gecode_constraint_cumulative_160", gecode_constraint_cumulative_160, 6); +YAP_UserCPredicate("gecode_constraint_cumulative_162", gecode_constraint_cumulative_162, 6); +YAP_UserCPredicate("gecode_constraint_cumulative_166", gecode_constraint_cumulative_166, 6); +YAP_UserCPredicate("gecode_constraint_cumulative_149", gecode_constraint_cumulative_149, 7); +YAP_UserCPredicate("gecode_constraint_cumulative_151", gecode_constraint_cumulative_151, 7); +YAP_UserCPredicate("gecode_constraint_cumulative_152", gecode_constraint_cumulative_152, 7); +YAP_UserCPredicate("gecode_constraint_cumulative_155", gecode_constraint_cumulative_155, 7); +YAP_UserCPredicate("gecode_constraint_cumulative_156", gecode_constraint_cumulative_156, 7); +YAP_UserCPredicate("gecode_constraint_cumulative_161", gecode_constraint_cumulative_161, 7); +YAP_UserCPredicate("gecode_constraint_cumulative_163", gecode_constraint_cumulative_163, 7); +YAP_UserCPredicate("gecode_constraint_cumulative_164", gecode_constraint_cumulative_164, 7); +YAP_UserCPredicate("gecode_constraint_cumulative_167", gecode_constraint_cumulative_167, 7); +YAP_UserCPredicate("gecode_constraint_cumulative_168", gecode_constraint_cumulative_168, 7); +YAP_UserCPredicate("gecode_constraint_cumulative_153", gecode_constraint_cumulative_153, 8); +YAP_UserCPredicate("gecode_constraint_cumulative_157", gecode_constraint_cumulative_157, 8); +YAP_UserCPredicate("gecode_constraint_cumulative_165", gecode_constraint_cumulative_165, 8); +YAP_UserCPredicate("gecode_constraint_cumulative_169", gecode_constraint_cumulative_169, 8); +YAP_UserCPredicate("gecode_constraint_cumulatives_170", gecode_constraint_cumulatives_170, 8); +YAP_UserCPredicate("gecode_constraint_cumulatives_172", gecode_constraint_cumulatives_172, 8); +YAP_UserCPredicate("gecode_constraint_cumulatives_174", gecode_constraint_cumulatives_174, 8); +YAP_UserCPredicate("gecode_constraint_cumulatives_176", gecode_constraint_cumulatives_176, 8); +YAP_UserCPredicate("gecode_constraint_cumulatives_178", gecode_constraint_cumulatives_178, 8); +YAP_UserCPredicate("gecode_constraint_cumulatives_180", gecode_constraint_cumulatives_180, 8); +YAP_UserCPredicate("gecode_constraint_cumulatives_182", gecode_constraint_cumulatives_182, 8); +YAP_UserCPredicate("gecode_constraint_cumulatives_184", gecode_constraint_cumulatives_184, 8); +YAP_UserCPredicate("gecode_constraint_cumulatives_171", gecode_constraint_cumulatives_171, 9); +YAP_UserCPredicate("gecode_constraint_cumulatives_173", gecode_constraint_cumulatives_173, 9); +YAP_UserCPredicate("gecode_constraint_cumulatives_175", gecode_constraint_cumulatives_175, 9); +YAP_UserCPredicate("gecode_constraint_cumulatives_177", gecode_constraint_cumulatives_177, 9); +YAP_UserCPredicate("gecode_constraint_cumulatives_179", gecode_constraint_cumulatives_179, 9); +YAP_UserCPredicate("gecode_constraint_cumulatives_181", gecode_constraint_cumulatives_181, 9); +YAP_UserCPredicate("gecode_constraint_cumulatives_183", gecode_constraint_cumulatives_183, 9); +YAP_UserCPredicate("gecode_constraint_cumulatives_185", gecode_constraint_cumulatives_185, 9); +YAP_UserCPredicate("gecode_constraint_distinct_186", gecode_constraint_distinct_186, 3); +YAP_UserCPredicate("gecode_constraint_distinct_188", gecode_constraint_distinct_188, 3); +YAP_UserCPredicate("gecode_constraint_distinct_191", gecode_constraint_distinct_191, 3); +YAP_UserCPredicate("gecode_constraint_distinct_192", gecode_constraint_distinct_192, 3); +YAP_UserCPredicate("gecode_constraint_distinct_187", gecode_constraint_distinct_187, 4); +YAP_UserCPredicate("gecode_constraint_distinct_189", gecode_constraint_distinct_189, 4); +YAP_UserCPredicate("gecode_constraint_distinct_193", gecode_constraint_distinct_193, 4); +YAP_UserCPredicate("gecode_constraint_distinct_190", gecode_constraint_distinct_190, 2); +YAP_UserCPredicate("gecode_constraint_div_194", gecode_constraint_div_194, 4); +YAP_UserCPredicate("gecode_constraint_div_195", gecode_constraint_div_195, 4); +YAP_UserCPredicate("gecode_constraint_div_196", gecode_constraint_div_196, 5); +YAP_UserCPredicate("gecode_constraint_divmod_197", gecode_constraint_divmod_197, 5); +YAP_UserCPredicate("gecode_constraint_divmod_198", gecode_constraint_divmod_198, 6); +YAP_UserCPredicate("gecode_constraint_dom_199", gecode_constraint_dom_199, 3); +YAP_UserCPredicate("gecode_constraint_dom_203", gecode_constraint_dom_203, 3); +YAP_UserCPredicate("gecode_constraint_dom_205", gecode_constraint_dom_205, 3); +YAP_UserCPredicate("gecode_constraint_dom_206", gecode_constraint_dom_206, 3); +YAP_UserCPredicate("gecode_constraint_dom_208", gecode_constraint_dom_208, 3); +YAP_UserCPredicate("gecode_constraint_dom_212", gecode_constraint_dom_212, 3); +YAP_UserCPredicate("gecode_constraint_dom_226", gecode_constraint_dom_226, 3); +YAP_UserCPredicate("gecode_constraint_dom_227", gecode_constraint_dom_227, 3); +YAP_UserCPredicate("gecode_constraint_dom_230", gecode_constraint_dom_230, 3); +YAP_UserCPredicate("gecode_constraint_dom_231", gecode_constraint_dom_231, 3); +YAP_UserCPredicate("gecode_constraint_dom_232", gecode_constraint_dom_232, 3); +YAP_UserCPredicate("gecode_constraint_dom_234", gecode_constraint_dom_234, 3); +YAP_UserCPredicate("gecode_constraint_dom_236", gecode_constraint_dom_236, 3); +YAP_UserCPredicate("gecode_constraint_dom_243", gecode_constraint_dom_243, 3); +YAP_UserCPredicate("gecode_constraint_dom_200", gecode_constraint_dom_200, 4); +YAP_UserCPredicate("gecode_constraint_dom_201", gecode_constraint_dom_201, 4); +YAP_UserCPredicate("gecode_constraint_dom_204", gecode_constraint_dom_204, 4); +YAP_UserCPredicate("gecode_constraint_dom_207", gecode_constraint_dom_207, 4); +YAP_UserCPredicate("gecode_constraint_dom_209", gecode_constraint_dom_209, 4); +YAP_UserCPredicate("gecode_constraint_dom_210", gecode_constraint_dom_210, 4); +YAP_UserCPredicate("gecode_constraint_dom_213", gecode_constraint_dom_213, 4); +YAP_UserCPredicate("gecode_constraint_dom_214", gecode_constraint_dom_214, 4); +YAP_UserCPredicate("gecode_constraint_dom_216", gecode_constraint_dom_216, 4); +YAP_UserCPredicate("gecode_constraint_dom_220", gecode_constraint_dom_220, 4); +YAP_UserCPredicate("gecode_constraint_dom_222", gecode_constraint_dom_222, 4); +YAP_UserCPredicate("gecode_constraint_dom_228", gecode_constraint_dom_228, 4); +YAP_UserCPredicate("gecode_constraint_dom_229", gecode_constraint_dom_229, 4); +YAP_UserCPredicate("gecode_constraint_dom_233", gecode_constraint_dom_233, 4); +YAP_UserCPredicate("gecode_constraint_dom_235", gecode_constraint_dom_235, 4); +YAP_UserCPredicate("gecode_constraint_dom_237", gecode_constraint_dom_237, 4); +YAP_UserCPredicate("gecode_constraint_dom_238", gecode_constraint_dom_238, 4); +YAP_UserCPredicate("gecode_constraint_dom_240", gecode_constraint_dom_240, 4); +YAP_UserCPredicate("gecode_constraint_dom_241", gecode_constraint_dom_241, 4); +YAP_UserCPredicate("gecode_constraint_dom_202", gecode_constraint_dom_202, 5); +YAP_UserCPredicate("gecode_constraint_dom_211", gecode_constraint_dom_211, 5); +YAP_UserCPredicate("gecode_constraint_dom_215", gecode_constraint_dom_215, 5); +YAP_UserCPredicate("gecode_constraint_dom_217", gecode_constraint_dom_217, 5); +YAP_UserCPredicate("gecode_constraint_dom_218", gecode_constraint_dom_218, 5); +YAP_UserCPredicate("gecode_constraint_dom_221", gecode_constraint_dom_221, 5); +YAP_UserCPredicate("gecode_constraint_dom_223", gecode_constraint_dom_223, 5); +YAP_UserCPredicate("gecode_constraint_dom_224", gecode_constraint_dom_224, 5); +YAP_UserCPredicate("gecode_constraint_dom_239", gecode_constraint_dom_239, 5); +YAP_UserCPredicate("gecode_constraint_dom_242", gecode_constraint_dom_242, 5); +YAP_UserCPredicate("gecode_constraint_dom_219", gecode_constraint_dom_219, 6); +YAP_UserCPredicate("gecode_constraint_dom_225", gecode_constraint_dom_225, 6); +YAP_UserCPredicate("gecode_constraint_element_244", gecode_constraint_element_244, 4); +YAP_UserCPredicate("gecode_constraint_element_246", gecode_constraint_element_246, 4); +YAP_UserCPredicate("gecode_constraint_element_248", gecode_constraint_element_248, 4); +YAP_UserCPredicate("gecode_constraint_element_254", gecode_constraint_element_254, 4); +YAP_UserCPredicate("gecode_constraint_element_256", gecode_constraint_element_256, 4); +YAP_UserCPredicate("gecode_constraint_element_260", gecode_constraint_element_260, 4); +YAP_UserCPredicate("gecode_constraint_element_262", gecode_constraint_element_262, 4); +YAP_UserCPredicate("gecode_constraint_element_245", gecode_constraint_element_245, 5); +YAP_UserCPredicate("gecode_constraint_element_247", gecode_constraint_element_247, 5); +YAP_UserCPredicate("gecode_constraint_element_249", gecode_constraint_element_249, 5); +YAP_UserCPredicate("gecode_constraint_element_255", gecode_constraint_element_255, 5); +YAP_UserCPredicate("gecode_constraint_element_257", gecode_constraint_element_257, 5); +YAP_UserCPredicate("gecode_constraint_element_261", gecode_constraint_element_261, 5); +YAP_UserCPredicate("gecode_constraint_element_263", gecode_constraint_element_263, 5); +YAP_UserCPredicate("gecode_constraint_element_250", gecode_constraint_element_250, 7); +YAP_UserCPredicate("gecode_constraint_element_252", gecode_constraint_element_252, 7); +YAP_UserCPredicate("gecode_constraint_element_258", gecode_constraint_element_258, 7); +YAP_UserCPredicate("gecode_constraint_element_264", gecode_constraint_element_264, 7); +YAP_UserCPredicate("gecode_constraint_element_251", gecode_constraint_element_251, 8); +YAP_UserCPredicate("gecode_constraint_element_253", gecode_constraint_element_253, 8); +YAP_UserCPredicate("gecode_constraint_element_259", gecode_constraint_element_259, 8); +YAP_UserCPredicate("gecode_constraint_element_265", gecode_constraint_element_265, 8); +YAP_UserCPredicate("gecode_constraint_extensional_266", gecode_constraint_extensional_266, 3); +YAP_UserCPredicate("gecode_constraint_extensional_272", gecode_constraint_extensional_272, 3); +YAP_UserCPredicate("gecode_constraint_extensional_267", gecode_constraint_extensional_267, 4); +YAP_UserCPredicate("gecode_constraint_extensional_268", gecode_constraint_extensional_268, 4); +YAP_UserCPredicate("gecode_constraint_extensional_273", gecode_constraint_extensional_273, 4); +YAP_UserCPredicate("gecode_constraint_extensional_274", gecode_constraint_extensional_274, 4); +YAP_UserCPredicate("gecode_constraint_extensional_269", gecode_constraint_extensional_269, 5); +YAP_UserCPredicate("gecode_constraint_extensional_270", gecode_constraint_extensional_270, 5); +YAP_UserCPredicate("gecode_constraint_extensional_275", gecode_constraint_extensional_275, 5); +YAP_UserCPredicate("gecode_constraint_extensional_276", gecode_constraint_extensional_276, 5); +YAP_UserCPredicate("gecode_constraint_extensional_271", gecode_constraint_extensional_271, 6); +YAP_UserCPredicate("gecode_constraint_extensional_277", gecode_constraint_extensional_277, 6); +YAP_UserCPredicate("gecode_constraint_ite_278", gecode_constraint_ite_278, 5); +YAP_UserCPredicate("gecode_constraint_ite_280", gecode_constraint_ite_280, 5); +YAP_UserCPredicate("gecode_constraint_ite_281", gecode_constraint_ite_281, 5); +YAP_UserCPredicate("gecode_constraint_ite_283", gecode_constraint_ite_283, 5); +YAP_UserCPredicate("gecode_constraint_ite_279", gecode_constraint_ite_279, 6); +YAP_UserCPredicate("gecode_constraint_ite_282", gecode_constraint_ite_282, 6); +YAP_UserCPredicate("gecode_constraint_linear_284", gecode_constraint_linear_284, 4); +YAP_UserCPredicate("gecode_constraint_linear_288", gecode_constraint_linear_288, 4); +YAP_UserCPredicate("gecode_constraint_linear_296", gecode_constraint_linear_296, 4); +YAP_UserCPredicate("gecode_constraint_linear_298", gecode_constraint_linear_298, 4); +YAP_UserCPredicate("gecode_constraint_linear_316", gecode_constraint_linear_316, 4); +YAP_UserCPredicate("gecode_constraint_linear_320", gecode_constraint_linear_320, 4); +YAP_UserCPredicate("gecode_constraint_linear_285", gecode_constraint_linear_285, 5); +YAP_UserCPredicate("gecode_constraint_linear_286", gecode_constraint_linear_286, 5); +YAP_UserCPredicate("gecode_constraint_linear_289", gecode_constraint_linear_289, 5); +YAP_UserCPredicate("gecode_constraint_linear_290", gecode_constraint_linear_290, 5); +YAP_UserCPredicate("gecode_constraint_linear_292", gecode_constraint_linear_292, 5); +YAP_UserCPredicate("gecode_constraint_linear_294", gecode_constraint_linear_294, 5); +YAP_UserCPredicate("gecode_constraint_linear_297", gecode_constraint_linear_297, 5); +YAP_UserCPredicate("gecode_constraint_linear_299", gecode_constraint_linear_299, 5); +YAP_UserCPredicate("gecode_constraint_linear_300", gecode_constraint_linear_300, 5); +YAP_UserCPredicate("gecode_constraint_linear_304", gecode_constraint_linear_304, 5); +YAP_UserCPredicate("gecode_constraint_linear_308", gecode_constraint_linear_308, 5); +YAP_UserCPredicate("gecode_constraint_linear_312", gecode_constraint_linear_312, 5); +YAP_UserCPredicate("gecode_constraint_linear_317", gecode_constraint_linear_317, 5); +YAP_UserCPredicate("gecode_constraint_linear_318", gecode_constraint_linear_318, 5); +YAP_UserCPredicate("gecode_constraint_linear_321", gecode_constraint_linear_321, 5); +YAP_UserCPredicate("gecode_constraint_linear_322", gecode_constraint_linear_322, 5); +YAP_UserCPredicate("gecode_constraint_linear_287", gecode_constraint_linear_287, 6); +YAP_UserCPredicate("gecode_constraint_linear_291", gecode_constraint_linear_291, 6); +YAP_UserCPredicate("gecode_constraint_linear_293", gecode_constraint_linear_293, 6); +YAP_UserCPredicate("gecode_constraint_linear_295", gecode_constraint_linear_295, 6); +YAP_UserCPredicate("gecode_constraint_linear_301", gecode_constraint_linear_301, 6); +YAP_UserCPredicate("gecode_constraint_linear_302", gecode_constraint_linear_302, 6); +YAP_UserCPredicate("gecode_constraint_linear_305", gecode_constraint_linear_305, 6); +YAP_UserCPredicate("gecode_constraint_linear_306", gecode_constraint_linear_306, 6); +YAP_UserCPredicate("gecode_constraint_linear_309", gecode_constraint_linear_309, 6); +YAP_UserCPredicate("gecode_constraint_linear_310", gecode_constraint_linear_310, 6); +YAP_UserCPredicate("gecode_constraint_linear_313", gecode_constraint_linear_313, 6); +YAP_UserCPredicate("gecode_constraint_linear_314", gecode_constraint_linear_314, 6); +YAP_UserCPredicate("gecode_constraint_linear_319", gecode_constraint_linear_319, 6); +YAP_UserCPredicate("gecode_constraint_linear_323", gecode_constraint_linear_323, 6); +YAP_UserCPredicate("gecode_constraint_linear_303", gecode_constraint_linear_303, 7); +YAP_UserCPredicate("gecode_constraint_linear_307", gecode_constraint_linear_307, 7); +YAP_UserCPredicate("gecode_constraint_linear_311", gecode_constraint_linear_311, 7); +YAP_UserCPredicate("gecode_constraint_linear_315", gecode_constraint_linear_315, 7); +YAP_UserCPredicate("gecode_constraint_max_324", gecode_constraint_max_324, 4); +YAP_UserCPredicate("gecode_constraint_max_325", gecode_constraint_max_325, 4); +YAP_UserCPredicate("gecode_constraint_max_329", gecode_constraint_max_329, 4); +YAP_UserCPredicate("gecode_constraint_max_326", gecode_constraint_max_326, 5); +YAP_UserCPredicate("gecode_constraint_max_327", gecode_constraint_max_327, 3); +YAP_UserCPredicate("gecode_constraint_max_328", gecode_constraint_max_328, 3); +YAP_UserCPredicate("gecode_constraint_member_330", gecode_constraint_member_330, 3); +YAP_UserCPredicate("gecode_constraint_member_334", gecode_constraint_member_334, 3); +YAP_UserCPredicate("gecode_constraint_member_331", gecode_constraint_member_331, 4); +YAP_UserCPredicate("gecode_constraint_member_332", gecode_constraint_member_332, 4); +YAP_UserCPredicate("gecode_constraint_member_335", gecode_constraint_member_335, 4); +YAP_UserCPredicate("gecode_constraint_member_336", gecode_constraint_member_336, 4); +YAP_UserCPredicate("gecode_constraint_member_333", gecode_constraint_member_333, 5); +YAP_UserCPredicate("gecode_constraint_member_337", gecode_constraint_member_337, 5); +YAP_UserCPredicate("gecode_constraint_min_338", gecode_constraint_min_338, 4); +YAP_UserCPredicate("gecode_constraint_min_339", gecode_constraint_min_339, 4); +YAP_UserCPredicate("gecode_constraint_min_343", gecode_constraint_min_343, 4); +YAP_UserCPredicate("gecode_constraint_min_340", gecode_constraint_min_340, 5); +YAP_UserCPredicate("gecode_constraint_min_341", gecode_constraint_min_341, 3); +YAP_UserCPredicate("gecode_constraint_min_342", gecode_constraint_min_342, 3); +YAP_UserCPredicate("gecode_constraint_mod_344", gecode_constraint_mod_344, 4); +YAP_UserCPredicate("gecode_constraint_mod_345", gecode_constraint_mod_345, 5); +YAP_UserCPredicate("gecode_constraint_mult_346", gecode_constraint_mult_346, 4); +YAP_UserCPredicate("gecode_constraint_mult_347", gecode_constraint_mult_347, 4); +YAP_UserCPredicate("gecode_constraint_mult_348", gecode_constraint_mult_348, 5); +YAP_UserCPredicate("gecode_constraint_nooverlap_349", gecode_constraint_nooverlap_349, 5); +YAP_UserCPredicate("gecode_constraint_nooverlap_350", gecode_constraint_nooverlap_350, 6); +YAP_UserCPredicate("gecode_constraint_nooverlap_351", gecode_constraint_nooverlap_351, 6); +YAP_UserCPredicate("gecode_constraint_nooverlap_352", gecode_constraint_nooverlap_352, 7); +YAP_UserCPredicate("gecode_constraint_nooverlap_353", gecode_constraint_nooverlap_353, 7); +YAP_UserCPredicate("gecode_constraint_nooverlap_354", gecode_constraint_nooverlap_354, 8); +YAP_UserCPredicate("gecode_constraint_nooverlap_355", gecode_constraint_nooverlap_355, 8); +YAP_UserCPredicate("gecode_constraint_nooverlap_356", gecode_constraint_nooverlap_356, 9); +YAP_UserCPredicate("gecode_constraint_nroot_357", gecode_constraint_nroot_357, 4); +YAP_UserCPredicate("gecode_constraint_nroot_358", gecode_constraint_nroot_358, 4); +YAP_UserCPredicate("gecode_constraint_nroot_359", gecode_constraint_nroot_359, 5); +YAP_UserCPredicate("gecode_constraint_nvalues_360", gecode_constraint_nvalues_360, 4); +YAP_UserCPredicate("gecode_constraint_nvalues_362", gecode_constraint_nvalues_362, 4); +YAP_UserCPredicate("gecode_constraint_nvalues_364", gecode_constraint_nvalues_364, 4); +YAP_UserCPredicate("gecode_constraint_nvalues_366", gecode_constraint_nvalues_366, 4); +YAP_UserCPredicate("gecode_constraint_nvalues_361", gecode_constraint_nvalues_361, 5); +YAP_UserCPredicate("gecode_constraint_nvalues_363", gecode_constraint_nvalues_363, 5); +YAP_UserCPredicate("gecode_constraint_nvalues_365", gecode_constraint_nvalues_365, 5); +YAP_UserCPredicate("gecode_constraint_nvalues_367", gecode_constraint_nvalues_367, 5); +YAP_UserCPredicate("gecode_constraint_path_368", gecode_constraint_path_368, 6); +YAP_UserCPredicate("gecode_constraint_path_379", gecode_constraint_path_379, 6); +YAP_UserCPredicate("gecode_constraint_path_369", gecode_constraint_path_369, 7); +YAP_UserCPredicate("gecode_constraint_path_370", gecode_constraint_path_370, 7); +YAP_UserCPredicate("gecode_constraint_path_372", gecode_constraint_path_372, 7); +YAP_UserCPredicate("gecode_constraint_path_371", gecode_constraint_path_371, 8); +YAP_UserCPredicate("gecode_constraint_path_373", gecode_constraint_path_373, 8); +YAP_UserCPredicate("gecode_constraint_path_374", gecode_constraint_path_374, 8); +YAP_UserCPredicate("gecode_constraint_path_375", gecode_constraint_path_375, 9); +YAP_UserCPredicate("gecode_constraint_path_376", gecode_constraint_path_376, 4); +YAP_UserCPredicate("gecode_constraint_path_377", gecode_constraint_path_377, 5); +YAP_UserCPredicate("gecode_constraint_path_378", gecode_constraint_path_378, 5); +YAP_UserCPredicate("gecode_constraint_pow_380", gecode_constraint_pow_380, 4); +YAP_UserCPredicate("gecode_constraint_pow_381", gecode_constraint_pow_381, 4); +YAP_UserCPredicate("gecode_constraint_pow_382", gecode_constraint_pow_382, 5); +YAP_UserCPredicate("gecode_constraint_precede_383", gecode_constraint_precede_383, 3); +YAP_UserCPredicate("gecode_constraint_precede_384", gecode_constraint_precede_384, 4); +YAP_UserCPredicate("gecode_constraint_precede_385", gecode_constraint_precede_385, 4); +YAP_UserCPredicate("gecode_constraint_precede_386", gecode_constraint_precede_386, 5); +YAP_UserCPredicate("gecode_constraint_rel_387", gecode_constraint_rel_387, 4); +YAP_UserCPredicate("gecode_constraint_rel_389", gecode_constraint_rel_389, 4); +YAP_UserCPredicate("gecode_constraint_rel_395", gecode_constraint_rel_395, 4); +YAP_UserCPredicate("gecode_constraint_rel_399", gecode_constraint_rel_399, 4); +YAP_UserCPredicate("gecode_constraint_rel_403", gecode_constraint_rel_403, 4); +YAP_UserCPredicate("gecode_constraint_rel_405", gecode_constraint_rel_405, 4); +YAP_UserCPredicate("gecode_constraint_rel_407", gecode_constraint_rel_407, 4); +YAP_UserCPredicate("gecode_constraint_rel_411", gecode_constraint_rel_411, 4); +YAP_UserCPredicate("gecode_constraint_rel_415", gecode_constraint_rel_415, 4); +YAP_UserCPredicate("gecode_constraint_rel_417", gecode_constraint_rel_417, 4); +YAP_UserCPredicate("gecode_constraint_rel_419", gecode_constraint_rel_419, 4); +YAP_UserCPredicate("gecode_constraint_rel_421", gecode_constraint_rel_421, 4); +YAP_UserCPredicate("gecode_constraint_rel_423", gecode_constraint_rel_423, 4); +YAP_UserCPredicate("gecode_constraint_rel_426", gecode_constraint_rel_426, 4); +YAP_UserCPredicate("gecode_constraint_rel_427", gecode_constraint_rel_427, 4); +YAP_UserCPredicate("gecode_constraint_rel_429", gecode_constraint_rel_429, 4); +YAP_UserCPredicate("gecode_constraint_rel_431", gecode_constraint_rel_431, 4); +YAP_UserCPredicate("gecode_constraint_rel_433", gecode_constraint_rel_433, 4); +YAP_UserCPredicate("gecode_constraint_rel_434", gecode_constraint_rel_434, 4); +YAP_UserCPredicate("gecode_constraint_rel_435", gecode_constraint_rel_435, 4); +YAP_UserCPredicate("gecode_constraint_rel_437", gecode_constraint_rel_437, 4); +YAP_UserCPredicate("gecode_constraint_rel_440", gecode_constraint_rel_440, 4); +YAP_UserCPredicate("gecode_constraint_rel_441", gecode_constraint_rel_441, 4); +YAP_UserCPredicate("gecode_constraint_rel_443", gecode_constraint_rel_443, 4); +YAP_UserCPredicate("gecode_constraint_rel_445", gecode_constraint_rel_445, 4); +YAP_UserCPredicate("gecode_constraint_rel_447", gecode_constraint_rel_447, 4); +YAP_UserCPredicate("gecode_constraint_rel_388", gecode_constraint_rel_388, 5); +YAP_UserCPredicate("gecode_constraint_rel_390", gecode_constraint_rel_390, 5); +YAP_UserCPredicate("gecode_constraint_rel_391", gecode_constraint_rel_391, 5); +YAP_UserCPredicate("gecode_constraint_rel_393", gecode_constraint_rel_393, 5); +YAP_UserCPredicate("gecode_constraint_rel_396", gecode_constraint_rel_396, 5); +YAP_UserCPredicate("gecode_constraint_rel_397", gecode_constraint_rel_397, 5); +YAP_UserCPredicate("gecode_constraint_rel_400", gecode_constraint_rel_400, 5); +YAP_UserCPredicate("gecode_constraint_rel_401", gecode_constraint_rel_401, 5); +YAP_UserCPredicate("gecode_constraint_rel_404", gecode_constraint_rel_404, 5); +YAP_UserCPredicate("gecode_constraint_rel_406", gecode_constraint_rel_406, 5); +YAP_UserCPredicate("gecode_constraint_rel_408", gecode_constraint_rel_408, 5); +YAP_UserCPredicate("gecode_constraint_rel_409", gecode_constraint_rel_409, 5); +YAP_UserCPredicate("gecode_constraint_rel_412", gecode_constraint_rel_412, 5); +YAP_UserCPredicate("gecode_constraint_rel_413", gecode_constraint_rel_413, 5); +YAP_UserCPredicate("gecode_constraint_rel_416", gecode_constraint_rel_416, 5); +YAP_UserCPredicate("gecode_constraint_rel_418", gecode_constraint_rel_418, 5); +YAP_UserCPredicate("gecode_constraint_rel_420", gecode_constraint_rel_420, 5); +YAP_UserCPredicate("gecode_constraint_rel_422", gecode_constraint_rel_422, 5); +YAP_UserCPredicate("gecode_constraint_rel_424", gecode_constraint_rel_424, 5); +YAP_UserCPredicate("gecode_constraint_rel_428", gecode_constraint_rel_428, 5); +YAP_UserCPredicate("gecode_constraint_rel_430", gecode_constraint_rel_430, 5); +YAP_UserCPredicate("gecode_constraint_rel_432", gecode_constraint_rel_432, 5); +YAP_UserCPredicate("gecode_constraint_rel_436", gecode_constraint_rel_436, 5); +YAP_UserCPredicate("gecode_constraint_rel_438", gecode_constraint_rel_438, 5); +YAP_UserCPredicate("gecode_constraint_rel_442", gecode_constraint_rel_442, 5); +YAP_UserCPredicate("gecode_constraint_rel_444", gecode_constraint_rel_444, 5); +YAP_UserCPredicate("gecode_constraint_rel_446", gecode_constraint_rel_446, 5); +YAP_UserCPredicate("gecode_constraint_rel_448", gecode_constraint_rel_448, 5); +YAP_UserCPredicate("gecode_constraint_rel_392", gecode_constraint_rel_392, 6); +YAP_UserCPredicate("gecode_constraint_rel_394", gecode_constraint_rel_394, 6); +YAP_UserCPredicate("gecode_constraint_rel_398", gecode_constraint_rel_398, 6); +YAP_UserCPredicate("gecode_constraint_rel_402", gecode_constraint_rel_402, 6); +YAP_UserCPredicate("gecode_constraint_rel_410", gecode_constraint_rel_410, 6); +YAP_UserCPredicate("gecode_constraint_rel_414", gecode_constraint_rel_414, 6); +YAP_UserCPredicate("gecode_constraint_rel_425", gecode_constraint_rel_425, 3); +YAP_UserCPredicate("gecode_constraint_rel_439", gecode_constraint_rel_439, 3); +YAP_UserCPredicate("gecode_constraint_relax_449", gecode_constraint_relax_449, 5); +YAP_UserCPredicate("gecode_constraint_sequence_450", gecode_constraint_sequence_450, 6); +YAP_UserCPredicate("gecode_constraint_sequence_452", gecode_constraint_sequence_452, 6); +YAP_UserCPredicate("gecode_constraint_sequence_451", gecode_constraint_sequence_451, 7); +YAP_UserCPredicate("gecode_constraint_sequence_453", gecode_constraint_sequence_453, 7); +YAP_UserCPredicate("gecode_constraint_sorted_454", gecode_constraint_sorted_454, 3); +YAP_UserCPredicate("gecode_constraint_sorted_455", gecode_constraint_sorted_455, 4); +YAP_UserCPredicate("gecode_constraint_sorted_456", gecode_constraint_sorted_456, 4); +YAP_UserCPredicate("gecode_constraint_sorted_457", gecode_constraint_sorted_457, 5); +YAP_UserCPredicate("gecode_constraint_sqr_458", gecode_constraint_sqr_458, 3); +YAP_UserCPredicate("gecode_constraint_sqr_459", gecode_constraint_sqr_459, 3); +YAP_UserCPredicate("gecode_constraint_sqr_460", gecode_constraint_sqr_460, 4); +YAP_UserCPredicate("gecode_constraint_sqrt_461", gecode_constraint_sqrt_461, 3); +YAP_UserCPredicate("gecode_constraint_sqrt_462", gecode_constraint_sqrt_462, 3); +YAP_UserCPredicate("gecode_constraint_sqrt_463", gecode_constraint_sqrt_463, 4); +YAP_UserCPredicate("gecode_constraint_unary_464", gecode_constraint_unary_464, 3); +YAP_UserCPredicate("gecode_constraint_unary_465", gecode_constraint_unary_465, 4); +YAP_UserCPredicate("gecode_constraint_unary_466", gecode_constraint_unary_466, 4); +YAP_UserCPredicate("gecode_constraint_unary_468", gecode_constraint_unary_468, 4); +YAP_UserCPredicate("gecode_constraint_unary_472", gecode_constraint_unary_472, 4); +YAP_UserCPredicate("gecode_constraint_unary_467", gecode_constraint_unary_467, 5); +YAP_UserCPredicate("gecode_constraint_unary_469", gecode_constraint_unary_469, 5); +YAP_UserCPredicate("gecode_constraint_unary_470", gecode_constraint_unary_470, 5); +YAP_UserCPredicate("gecode_constraint_unary_473", gecode_constraint_unary_473, 5); +YAP_UserCPredicate("gecode_constraint_unary_474", gecode_constraint_unary_474, 5); +YAP_UserCPredicate("gecode_constraint_unary_471", gecode_constraint_unary_471, 6); +YAP_UserCPredicate("gecode_constraint_unary_475", gecode_constraint_unary_475, 6); +YAP_UserCPredicate("gecode_constraint_unshare_476", gecode_constraint_unshare_476, 2); +YAP_UserCPredicate("gecode_constraint_unshare_478", gecode_constraint_unshare_478, 2); +YAP_UserCPredicate("gecode_constraint_unshare_477", gecode_constraint_unshare_477, 3); +YAP_UserCPredicate("gecode_constraint_unshare_479", gecode_constraint_unshare_479, 3); +YAP_UserCPredicate("gecode_constraint_when_480", gecode_constraint_when_480, 3); +YAP_UserCPredicate("gecode_constraint_when_481", gecode_constraint_when_481, 4); +YAP_UserCPredicate("gecode_constraint_when_482", gecode_constraint_when_482, 4); +YAP_UserCPredicate("gecode_constraint_when_483", gecode_constraint_when_483, 5); diff --git a/packages/gecode/dev/extractor/Makefile b/packages/gecode/dev/extractor/Makefile index 0221be9e2..42dba97c5 100644 --- a/packages/gecode/dev/extractor/Makefile +++ b/packages/gecode/dev/extractor/Makefile @@ -1,5 +1,4 @@ GECODEDIR := $(shell g++ $(CPPFLAGS) $(CXXFLAGS) -H -E gecodedir.hh 2>&1 >/dev/null | grep gecode/kernel.hh | awk '{print $$2}' | sed 's|/kernel.hh||') -GECODEDIR=/usr/include/gecode GECODECONFIG := $(GECODEDIR)/support/config.hpp GECODEVERSION := $(shell cat $(GECODECONFIG) | egrep '\' | awk '{print $$3}' | sed 's/"//g') PROTOTYPES = ../gecode-prototypes-$(GECODEVERSION).hh From 8070e65354290ea18b4246f914191fed434662c1 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Fri, 12 Apr 2019 10:48:01 +0100 Subject: [PATCH 03/29] goal --- C/absmi_insts.h | 1 + C/c_interface.c | 67 ++++++++++++++++------------- C/exec.c | 104 ++++++++++++++++++++++++++-------------------- C/stack.c | 2 + CXX/yapi.cpp | 3 +- H/Yapproto.h | 2 +- H/absmi.h | 2 +- include/YapDefs.h | 2 +- pl/boot.yap | 2 +- 9 files changed, 107 insertions(+), 78 deletions(-) diff --git a/C/absmi_insts.h b/C/absmi_insts.h index a26eb830b..6aeaff66f 100644 --- a/C/absmi_insts.h +++ b/C/absmi_insts.h @@ -25,6 +25,7 @@ ENDBOp(); BOp(Nstop, e); + //B= B->cp_b; //SET_ASP(YREG, E_CB * sizeof(CELL)); saveregs(); #if PUSH_REGS diff --git a/C/c_interface.c b/C/c_interface.c index 6efe45e64..a538433c8 100755 --- a/C/c_interface.c +++ b/C/c_interface.c @@ -1755,7 +1755,7 @@ static int run_emulator(USES_REGS1) { X_API bool YAP_EnterGoal(YAP_PredEntryPtr ape, CELL *ptr, YAP_dogoalinfo *dgi) { CACHE_REGS PredEntry *pe = ape; - bool out; + bool out; fprintf(stderr,"EnterGoal: H=%ld ENV=%ld B=%ld TR=%ld P=%p CP=%p, Slots=%ld\n",HR-H0,LCL0-ENV,LCL0-(CELL*)B,(CELL*)TR-LCL0, P, CP, LOCAL_CurSlot); @@ -1764,7 +1764,7 @@ X_API bool YAP_EnterGoal(YAP_PredEntryPtr ape, CELL *ptr, YAP_dogoalinfo *dgi) { LOCAL_PrologMode = UserMode; dgi->p = P; dgi->cp = CP; - dgi->b0 = LCL0 - (CELL *)B; + dgi->b_top = LCL0 - (CELL *)B; dgi->e = LCL0-ENV; dgi->CurSlot = LOCAL_CurSlot; // ensure our current ENV receives current P. @@ -1774,17 +1774,15 @@ X_API bool YAP_EnterGoal(YAP_PredEntryPtr ape, CELL *ptr, YAP_dogoalinfo *dgi) { // __android_log_print(ANDROID_LOG_INFO, "YAP ", "ap=%p %ld %x %x args=%x,%x // slot=%ld", pe, pe->CodeOfPred->opc, FAILCODE, Deref(ARG1), Deref(ARG2), // LOCAL_CurSlot); - dgi->b = LCL0 - (CELL *)B; dgi->h = HR - H0; dgi->tr = (CELL *)TR - LCL0; - // fprintf(stderr,"PrepGoal: H=%ld ENV=%p B=%ld TR=%ld P=%p CP=%p Slots=%ld\n", - // HR-H0,LCL0-ENV,LCL0-(CELL*)B,(CELL*)TR-LCL0, P, CP, LOCAL_CurSlot); - out = Yap_exec_absmi(true, false); - // fprintf(stderr,"EnterGoal success=%ld: H=%ld ENV=%p B=%ld TR=%ld P=%p CP=%p - // Slots=%ld\n", out,HR-H0,LCL0-ENV,LCL0-(CELL*)B,(CELL*)TR-LCL0, P, CP, - // LOCAL_CurSlot); - dgi->b = (LCL0 - (CELL*)B); - dgi->e = LCL0 - (CELL *)B; + // HR-H0,LCL0-ENV,LCL0-(CELL*)B,(CELL*)TR-LCL0, P11= (LCL0 - (CELL*)B); + out = Yap_exec_absmi(true, false); + // fprintf(stderr,"EnterGoal success=%ld: H=%ld ENV=%p B=%ld TR=%ld P=%p CP=%p + // Slots=%ld\n", out,HR-H0,LCL0-ENV,LCL0-(CELL*)B,(CELL*)TR-LCL0, P, CP, + // LOCAL_CurSlot); + dgi->b_bottom = (LCL0 - (CELL*)B); + dgi->e = LCL0 - (CELL *)ENV; dgi->a = LCL0 - (CELL *)ASP; if (out) { dgi->EndSlot = LOCAL_CurSlot; @@ -1803,8 +1801,8 @@ X_API bool YAP_RetryGoal(YAP_dogoalinfo *dgi) { bool out; BACKUP_MACHINE_REGS(); - myB = (choiceptr)(LCL0 - dgi->b); - myB0 = (choiceptr)(LCL0 - dgi->b0); + myB = (choiceptr)(LCL0 - dgi->b_top); + myB0 = (choiceptr)(LCL0 - dgi->b_bottom); CP = myB->cp_cp; /* sanity check */ if (B >= myB0) { @@ -1822,7 +1820,7 @@ X_API bool YAP_RetryGoal(YAP_dogoalinfo *dgi) { out = Yap_exec_absmi(true, true ); if (out) { dgi->EndSlot = LOCAL_CurSlot; - dgi->b = LCL0-CellPtr(myB); + dgi->b_bottom = LCL0-CellPtr(myB); } else { LOCAL_CurSlot = dgi->CurSlot; // ignore any slots created within the called goal @@ -1840,7 +1838,7 @@ X_API bool YAP_LeaveGoal(bool successful, YAP_dogoalinfo *dgi) { // successful,HR-H0,LCL0-ENV,LCL0-(CELL*)B,dgi->b0,(CELL*)TR-LCL0, P, CP, // LOCAL_CurSlot); BACKUP_MACHINE_REGS(); - myB = (choiceptr)(LCL0 - dgi->b); + myB = (choiceptr)(LCL0 - dgi->b_bottom); if (LOCAL_PrologMode & AsyncIntMode) { Yap_signal(YAP_FAIL_SIGNAL); } @@ -1868,7 +1866,7 @@ X_API bool YAP_LeaveGoal(bool successful, YAP_dogoalinfo *dgi) { CP = dgi->cp; ENV = LCL0-dgi->e; ASP = LCL0-dgi->a; - B = (choiceptr)(LCL0-dgi->b) + B = (choiceptr)(LCL0-dgi->b_top) RECOVER_MACHINE_REGS(); fprintf(stderr,"LeftGoal success=%d: H=%ld ENV=%ld B=%ld TR=%ld P=%p CP=%p, Slots=%ld\n", successful,HR-H0,LCL0-ENV,LCL0-(CELL*)B,(CELL*)TR-LCL0, P, CP, LOCAL_CurSlot); @@ -1878,12 +1876,19 @@ X_API bool YAP_LeaveGoal(bool successful, YAP_dogoalinfo *dgi) { X_API Int YAP_RunGoal(Term t) { CACHE_REGS Term out; - yhandle_t cslot = LOCAL_CurSlot; + YAP_dogoalinfo gi; + gi.p = P; + gi.cp = CP; + gi.b_top = LCL0-CellPtr(B); + gi.CurSlot = Yap_CurrentHandle(); + gi.a = LCL0-ASP; + gi.e = LCL0-ENV; + yhandle_t cslot = LOCAL_CurSlot; BACKUP_MACHINE_REGS(); LOCAL_AllowRestart = FALSE; LOCAL_PrologMode = UserMode; - out = Yap_RunTopGoal(t, true); + out = Yap_RunTopGoal(t, &gi, true); LOCAL_PrologMode = UserCCallMode; // should we catch the exception or pass it through? // We'll pass it through @@ -1962,15 +1967,21 @@ X_API CELL *YAP_HeapStoreOpaqueTerm(Term t) { X_API Int YAP_RunGoalOnce(Term t) { CACHE_REGS Term out; - yamop *old_CP = CP; - Int oldPrologMode = LOCAL_PrologMode; + YAP_dogoalinfo gi; + gi.p = P; + gi.cp = CP; + gi.b_top = LCL0-CellPtr(B); + gi.CurSlot = Yap_CurrentHandle(); + gi.a = LCL0-ASP; + gi.e = LCL0-ENV; + Int oldPrologMode = LOCAL_PrologMode; yhandle_t CSlot; BACKUP_MACHINE_REGS(); CSlot = Yap_StartSlots(); LOCAL_PrologMode = UserMode; // Yap_heap_regs->yap_do_low_level_trace=true; - out = Yap_RunTopGoal(t, true); + out = Yap_RunTopGoal(t, &gi, true); LOCAL_PrologMode = oldPrologMode; // Yap_CloseSlots(CSlot); if (!(oldPrologMode & UserCCallMode)) { @@ -2006,14 +2017,14 @@ X_API Int YAP_RunGoalOnce(Term t) { } else { Yap_CloseSlots(CSlot); } - ASP = B->cp_env; - ENV = (CELL *)ASP[E_E]; - B = (choiceptr)ASP[E_CB]; -#ifdef DEPTH_LIMITxs + ASP = LCL0-gi.a; + ENV = LCL0-gi.e; + B = (choiceptr)(LCL0-gi.b_top); +#ifdef DEPTH_LIMIT DEPTH = ASP[E_DEPTH]; #endif - P = (yamop *)ASP[E_CP]; - CP = old_CP; + P = gi.p; + CP = gi.cp; LOCAL_AllowRestart = FALSE; RECOVER_MACHINE_REGS(); return out; @@ -2098,7 +2109,7 @@ X_API void YAP_PruneGoal(YAP_dogoalinfo *gi) { CACHE_REGS BACKUP_B(); - choiceptr myB = (choiceptr)(LCL0 - gi->b); + choiceptr myB = (choiceptr)(LCL0 - gi->b_top); while (B != myB) { /* make sure we prune C-choicepoints */ if (POP_CHOICE_POINT(B->cp_b)) { diff --git a/C/exec.c b/C/exec.c index c0c51f72c..13cf8b254 100755 --- a/C/exec.c +++ b/C/exec.c @@ -808,7 +808,7 @@ static void prune_inner_computation(choiceptr parent) { Int oENV = LCL0 - ENV; cut_pt = B; - while (cut_pt && cut_pt->cp_b < parent) { + while (cut_pt && cut_pt->cp_b < parent && cut_pt->cp_b->cp_ap != NOCODE) { cut_pt = cut_pt->cp_b; } if (!cut_pt) @@ -853,25 +853,34 @@ static void complete_inner_computation(choiceptr old_B) { } static Int Yap_ignore(Term t, bool fail USES_REGS) { - yamop *oP = P, *oCP = CP; - Int oENV = LCL0 - ENV; - Int oYENV = LCL0 - YENV; - Int oB = LCL0 - (CELL *)B; + YAP_dogoalinfo gi; + gi.p = P; + gi.cp = CP; + gi.b_top = LCL0-CellPtr(B); + gi.CurSlot = Yap_CurrentHandle(); + gi.a = LCL0-ASP; + gi.e = LCL0-ENV; + // gi. = LCL0-YENV; yap_error_descriptor_t *ctx = malloc(sizeof(yap_error_descriptor_t)); bool newxp = Yap_pushErrorContext(true, ctx); - bool rc = Yap_RunTopGoal(t, false); + bool rc = Yap_RunTopGoal(t, &gi, false); + choiceptr B0 = (choiceptr)(LCL0-gi.b_top); if (!rc) { - complete_inner_computation((choiceptr)(LCL0 - oB)); + complete_inner_computation(B0); // We'll pass it through } else { - prune_inner_computation((choiceptr)(LCL0 - oB)); + prune_inner_computation(B0); } Yap_popErrorContext(newxp, true); - P = oP; - CP = oCP; - ENV = LCL0 - oENV; - YENV = LCL0 - oYENV; - B = (choiceptr)(LCL0 - oB); + ASP = LCL0-gi.a; + ENV = LCL0-gi.e; + B = (choiceptr)(LCL0-gi.b_top); +#ifdef DEPTH_LIMIT + DEPTH = ASP[E_DEPTH]; +#endif + P = gi.p; + CP = gi.cp; + //YENV? return true; } @@ -1001,18 +1010,22 @@ static bool watch_retry(Term d0 USES_REGS) { static Int setup_call_catcher_cleanup(USES_REGS1) { Term Setup = Deref(ARG1); - choiceptr B0 = B; - yamop *oP = P, *oCP = CP; - Int oENV = LCL0 - ENV; - Int oYENV = LCL0 - YENV; - bool rc; + YAP_dogoalinfo gi; + gi.p = P; + gi.cp = CP; + gi.b_top = LCL0-CellPtr(B); + gi.CurSlot = Yap_CurrentHandle(); + gi.a = LCL0-ASP; + gi.e = LCL0-ENV; + bool rc; Yap_DisableInterrupts(worker_id); - rc = Yap_RunTopGoal(Setup, false); + rc = Yap_RunTopGoal(Setup, &gi, false); Yap_EnableInterrupts(worker_id); if (Yap_RaiseException()) { return false; } + choiceptr B0=(choiceptr)(LCL0-gi.b_top); if (!rc) { complete_inner_computation(B0); // We'll pass it throughs @@ -1021,11 +1034,15 @@ static Int setup_call_catcher_cleanup(USES_REGS1) { } else { prune_inner_computation(B0); } - P = oP; - CP = oCP; - ENV = LCL0 - oENV; - YENV = LCL0 - oYENV; - return rc; + ASP = LCL0-gi.a; + ENV = LCL0-gi.e; + B = (choiceptr)(LCL0-gi.b_top); +#ifdef DEPTH_LIMIT + DEPTH = ASP[E_DEPTH]; +#endif + P = gi.p; + CP = gi.cp; + return rc; } static Int tag_cleanup(USES_REGS1) { @@ -1628,7 +1645,7 @@ void Yap_PrepGoal(arity_t arity, CELL *pt, YAP_dogoalinfo *gip USES_REGS) { Yap_ResetException(worker_id); // sl = Yap_InitSlot(t); YENV = ASP; - YENV[E_CP] = (CELL)YESCODE; + YENV[E_CP] = (CELL)CP; YENV[E_CB] = (CELL)B; YENV[E_E] = (CELL)ENV; #ifdef TABLING @@ -1648,20 +1665,24 @@ void Yap_PrepGoal(arity_t arity, CELL *pt, YAP_dogoalinfo *gip USES_REGS) { XREGS[i + 1] = *pt++; } } + choiceptr oB = B; B = (choiceptr)ASP; B--; B->cp_h = HR; B->cp_tr = TR; - B->cp_cp = CP; + B->cp_cp = YESCODE; B->cp_ap = NOCODE; B->cp_env = ENV; + B->cp_b = oB; #ifdef DEPTH_LIMIT B->cp_depth = DEPTH; #endif /* DEPTH_LIMIT */ - YENV = ASP = (CELL *)B; - YENV[E_CB] = (CELL)B; + ASP = (CELL *)B; + ASP[E_CB] = (CELL)B; HB = HR; - gip->b = LCL0-CellPtr(B); + CP = YESCODE; + ASP -= EnvSizeInCells; + gip->b_bottom = LCL0-CellPtr(B); } static bool do_goal(yamop *CodeAdr, int arity, CELL *pt, YAP_dogoalinfo *gi, bool top USES_REGS) { @@ -1743,7 +1764,7 @@ bool Yap_execute_pred(PredEntry *ppe, CELL *pt, bool pass_ex USES_REGS) { YAP_dogoalinfo gi; gi.p = P; gi.cp = CP; - gi.b0 = LCL0-CellPtr(B); + gi.b_top = LCL0-CellPtr(B); gi.CurSlot = Yap_CurrentHandle(); gi.a = LCL0-ASP; gi.e = LCL0-ENV; @@ -1773,7 +1794,7 @@ bool Yap_execute_pred(PredEntry *ppe, CELL *pt, bool pass_ex USES_REGS) { #endif } #endif /* TABLING */ - B = (choiceptr)(LCL0-gi.b0); + B = (choiceptr)(LCL0-gi.b_top); CP = gi.cp; P = gi.p; ASP = LCL0-gi.a; @@ -1810,7 +1831,7 @@ bool Yap_execute_pred(PredEntry *ppe, CELL *pt, bool pass_ex USES_REGS) { ASP = LCL0-gi.a; /* YENV should be set to the current environment */ YENV = ENV = LCL0-gi.e; - B =(choiceptr)(LCL0-gi.b); + B =(choiceptr)(LCL0-gi.b_top); SET_BB(B); HB = PROTECT_FROZEN_H(B); // should we catch the exception or pass it through? @@ -1885,7 +1906,7 @@ void Yap_trust_last(void) { } } -Term Yap_RunTopGoal(Term t, bool handle_errors) { +Term Yap_RunTopGoal(Term t, YAP_dogoalinfo *gip, bool handle_errors) { CACHE_REGS yamop *CodeAdr; Prop pe; @@ -1894,13 +1915,6 @@ Term Yap_RunTopGoal(Term t, bool handle_errors) { UInt arity; Term tmod = CurrentModule; Term goal_out = 0; - YAP_dogoalinfo gi; - gi.p = P; - gi.cp = CP; - gi.b0 = gi.b = LCL0-CellPtr(B); - gi.CurSlot = Yap_CurrentHandle(); - gi.a = LCL0-ASP; - gi.e = LCL0-ENV; LOCAL_PrologMode |= TopGoalMode; t = Yap_YapStripModule(t, &tmod); @@ -1971,7 +1985,7 @@ Term Yap_RunTopGoal(Term t, bool handle_errors) { "unable to boot because of too little Trail space"); } #endif - goal_out = do_goal(CodeAdr, arity, pt, &gi, handle_errors PASS_REGS); + goal_out = do_goal(CodeAdr, arity, pt, gip, handle_errors PASS_REGS); return goal_out; } @@ -2137,11 +2151,13 @@ bool Yap_Reset(yap_reset_t mode, bool hard) { Yap_ResetException(worker_id); /* first, backtrack to the root */ - while (B) { + while (B->cp_b) { + if (B->cp_ap == NOCODE) + break; + B = B->cp_b; + } P = FAILCODE; Yap_exec_absmi(true, mode); - B = B->cp_b; - } /* reinitialize the engine */ Yap_InitYaamRegs(worker_id, false); GLOBAL_Initialised = true; diff --git a/C/stack.c b/C/stack.c index 62e411d85..ef8bdc5c0 100644 --- a/C/stack.c +++ b/C/stack.c @@ -304,6 +304,8 @@ bool Yap_search_for_static_predicate_in_use(PredEntry *p, return true; } env_ptr = b_ptr->cp_env; + if (b_ptr->cp_ap == NOCODE) + return false; b_ptr = b_ptr->cp_b; } while (b_ptr != NULL); return (FALSE); diff --git a/CXX/yapi.cpp b/CXX/yapi.cpp index c0a907381..d8b592cbe 100644 --- a/CXX/yapi.cpp +++ b/CXX/yapi.cpp @@ -254,7 +254,6 @@ YAPApplTerm::YAPApplTerm(YAPFunctor f, YAPTerm ts[]) { arity_t arity = ArityOfFunctor(f.f); Term o = AbsAppl(HR); *HR++ = (CELL)f.f; - Term *tt = RepAppl(o) + 1; for (arity_t i = 0; i < arity; i++) *HR++ = ts[i].term(); mk(o); @@ -834,7 +833,7 @@ bool YAPQuery::deterministic() { BACKUP_MACHINE_REGS(); if (!q_open || q_state == 0) return false; - choiceptr myB = (choiceptr)(LCL0 - q_h.b); + choiceptr myB = (choiceptr)(LCL0 - q_h.b_top); return (B >= myB); RECOVER_MACHINE_REGS(); } diff --git a/H/Yapproto.h b/H/Yapproto.h index 2e27c7f29..a41236919 100755 --- a/H/Yapproto.h +++ b/H/Yapproto.h @@ -203,7 +203,7 @@ extern void Yap_fail_all(choiceptr bb USES_REGS); extern Term Yap_ExecuteCallMetaCall(Term,Term); extern void Yap_InitExecFs(void); extern bool Yap_JumpToEnv(void); -extern Term Yap_RunTopGoal(Term, bool); +extern Term Yap_RunTopGoal(Term, struct goal_info *, bool); extern bool Yap_execute_goal(Term, int, Term, bool); extern bool Yap_exec_absmi(bool, yap_reset_t); extern void Yap_trust_last(void); diff --git a/H/absmi.h b/H/absmi.h index b05baa93a..30bfafd19 100755 --- a/H/absmi.h +++ b/H/absmi.h @@ -2322,7 +2322,7 @@ static inline void prune(choiceptr cp USES_REGS) { POP_EXECUTE(); } if (B->cp_b == NULL) - break; + return; B = B->cp_b; } if (POP_CHOICE_POINT(B->cp_b)) { diff --git a/include/YapDefs.h b/include/YapDefs.h index b2b684e1e..43ac14687 100755 --- a/include/YapDefs.h +++ b/include/YapDefs.h @@ -138,7 +138,7 @@ typedef enum { /* this should be opaque to the user */ typedef struct goal_info { - unsigned long b, b0, e, a; //> choice-point at entry + unsigned long b_top, b_bottom, m, e, a; //> choice-point at entry YAP_handle_t CurSlot; //> variables at entry YAP_handle_t EndSlot; //> variables at successful execution struct yami *p; //> Program Counter at entry diff --git a/pl/boot.yap b/pl/boot.yap index 89188051e..941e1c8c7 100644 --- a/pl/boot.yap +++ b/pl/boot.yap @@ -267,7 +267,7 @@ initialize_prolog :- :- c_compile( 'protect.yap' ). :- ['absf.yap']. - +%:- stop_low_level_trace. :- use_module('error.yap'). :- [ From 9172f2994b0cad28c79d196627441970b1f79ba4 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Fri, 12 Apr 2019 17:32:26 +0100 Subject: [PATCH 04/29] interfacing --- C/c_interface.c | 42 ++++++++++++++--------------- C/exec.c | 64 +++++++++++++++++++++++--------------------- CXX/yapi.cpp | 68 +++++++++++++++++++---------------------------- include/YapDefs.h | 2 +- 4 files changed, 82 insertions(+), 94 deletions(-) diff --git a/C/c_interface.c b/C/c_interface.c index a538433c8..6ff8209e2 100755 --- a/C/c_interface.c +++ b/C/c_interface.c @@ -1,3 +1,4 @@ + /************************************************************************* * * YAP Prolog * * Yap Prolog was developed at NCCUP - Universidade do Porto * @@ -1783,7 +1784,7 @@ X_API bool YAP_EnterGoal(YAP_PredEntryPtr ape, CELL *ptr, YAP_dogoalinfo *dgi) { // LOCAL_CurSlot); dgi->b_bottom = (LCL0 - (CELL*)B); dgi->e = LCL0 - (CELL *)ENV; - dgi->a = LCL0 - (CELL *)ASP; + dgi->y = LCL0 - (CELL *)YENV; if (out) { dgi->EndSlot = LOCAL_CurSlot; Yap_StartSlots(); @@ -1865,7 +1866,11 @@ X_API bool YAP_LeaveGoal(bool successful, YAP_dogoalinfo *dgi) { P = dgi->p; CP = dgi->cp; ENV = LCL0-dgi->e; - ASP = LCL0-dgi->a; + YENV = LCL0-dgi->y; + /* ASP should be set to the top of the local stack when we + did the call */ + SET_ASP(YENV, E_CB * sizeof(CELL)); + B = (choiceptr)(LCL0-dgi->b_top) RECOVER_MACHINE_REGS(); fprintf(stderr,"LeftGoal success=%d: H=%ld ENV=%ld B=%ld TR=%ld P=%p CP=%p, Slots=%ld\n", successful,HR-H0,LCL0-ENV,LCL0-(CELL*)B,(CELL*)TR-LCL0, P, @@ -1881,7 +1886,7 @@ X_API Int YAP_RunGoal(Term t) { gi.cp = CP; gi.b_top = LCL0-CellPtr(B); gi.CurSlot = Yap_CurrentHandle(); - gi.a = LCL0-ASP; + gi.y = LCL0-YENV; gi.e = LCL0-ENV; yhandle_t cslot = LOCAL_CurSlot; BACKUP_MACHINE_REGS(); @@ -1892,6 +1897,7 @@ X_API Int YAP_RunGoal(Term t) { LOCAL_PrologMode = UserCCallMode; // should we catch the exception or pass it through? // We'll pass it through + SET_ASP(YENV, E_CB * sizeof(CELL)); RECOVER_MACHINE_REGS(); LOCAL_CurSlot = cslot; return out; @@ -1972,7 +1978,7 @@ X_API Int YAP_RunGoalOnce(Term t) { gi.cp = CP; gi.b_top = LCL0-CellPtr(B); gi.CurSlot = Yap_CurrentHandle(); - gi.a = LCL0-ASP; + gi.y = LCL0-YENV; gi.e = LCL0-ENV; Int oldPrologMode = LOCAL_PrologMode; yhandle_t CSlot; @@ -1994,37 +2000,31 @@ X_API Int YAP_RunGoalOnce(Term t) { // We'll pass it through // Yap_RaiseException(); if (out) { - choiceptr cut_pt, ob; + choiceptr cut_pt; - ob = NULL; cut_pt = B; - while (cut_pt->cp_ap != NOCODE) { + B = (choiceptr)(LCL0-gi.b_top); + while (cut_pt->cp_ap != NOCODE && cut_pt < B) { /* make sure we prune C-choicepoints */ - if (POP_CHOICE_POINT(cut_pt->cp_b)) { - POP_EXECUTE(); - } - ob = cut_pt; - cut_pt = cut_pt->cp_b; - } -#ifdef YAPOR - CUT_prune_to(cut_pt); -#endif - if (ob) { - B = ob; - Yap_TrimTrail(); + cut_pt = cut_pt->cp_b; } B = cut_pt; + Yap_TrimTrail(); } else { Yap_CloseSlots(CSlot); } - ASP = LCL0-gi.a; +#ifdef YAPOR + CUT_prune_to(cut_pt); +#endif ENV = LCL0-gi.e; + YENV = LCL0-gi.y; B = (choiceptr)(LCL0-gi.b_top); #ifdef DEPTH_LIMIT - DEPTH = ASP[E_DEPTH]; + DEPTH = ENV[E_DEPTH]; #endif P = gi.p; CP = gi.cp; + SET_ASP(YENV, E_CB * sizeof(CELL)); LOCAL_AllowRestart = FALSE; RECOVER_MACHINE_REGS(); return out; diff --git a/C/exec.c b/C/exec.c index 13cf8b254..9d5ba1072 100755 --- a/C/exec.c +++ b/C/exec.c @@ -801,14 +801,13 @@ static Int execute_in_mod(USES_REGS1) { /* '$execute'(Goal) */ * * @method prune_inner_computation */ -static void prune_inner_computation(choiceptr parent) { +static void prune_inner_computation(choiceptr parent, YAP_dogoalinfo *gi) { /* code */ choiceptr cut_pt; - yamop *oP = P, *oCP = CP; - Int oENV = LCL0 - ENV; - cut_pt = B; - while (cut_pt && cut_pt->cp_b < parent && cut_pt->cp_b->cp_ap != NOCODE) { + while (cut_pt && cut_pt->cp_b + && cut_pt->cp_ap != NOCODE && + cut_pt->cp_b <= parent) { cut_pt = cut_pt->cp_b; } if (!cut_pt) @@ -819,9 +818,9 @@ static void prune_inner_computation(choiceptr parent) { B = cut_pt; Yap_TrimTrail(); LOCAL_AllowRestart = FALSE; - P = oP; - CP = oCP; - ENV = LCL0 - oENV; + P = gi->p; + CP = gi->cp; + ENV = LCL0-gi->e; B = parent; } @@ -830,7 +829,7 @@ static void prune_inner_computation(choiceptr parent) { * after completing a computation. * @method complete_inner_computation */ -static void complete_inner_computation(choiceptr old_B) { +static void complete_inner_computation(choiceptr old_B, YAP_dogoalinfo *gi) { choiceptr myB = B; if (myB == NULL) { return; @@ -848,8 +847,11 @@ static void complete_inner_computation(choiceptr old_B) { return; } // restore environment at call... - CP = myB->cp_cp; - ENV = myB->cp_env; + CP = gi->cp; + P = gi->p; + ENV = LCL0-gi->e; + YENV = LCL0-gi->y; + } static Int Yap_ignore(Term t, bool fail USES_REGS) { @@ -858,23 +860,23 @@ static Int Yap_ignore(Term t, bool fail USES_REGS) { gi.cp = CP; gi.b_top = LCL0-CellPtr(B); gi.CurSlot = Yap_CurrentHandle(); - gi.a = LCL0-ASP; + gi.y = LCL0-YENV; gi.e = LCL0-ENV; // gi. = LCL0-YENV; yap_error_descriptor_t *ctx = malloc(sizeof(yap_error_descriptor_t)); bool newxp = Yap_pushErrorContext(true, ctx); - bool rc = Yap_RunTopGoal(t, &gi, false); + bool rc = Yap_RunTopGoal(t, &gi, false); choiceptr B0 = (choiceptr)(LCL0-gi.b_top); if (!rc) { - complete_inner_computation(B0); + complete_inner_computation(B0, &gi); // We'll pass it through } else { - prune_inner_computation(B0); + prune_inner_computation(B0, &gi); } Yap_popErrorContext(newxp, true); - ASP = LCL0-gi.a; ENV = LCL0-gi.e; B = (choiceptr)(LCL0-gi.b_top); + SET_ASP(ENV, E_CB * sizeof(CELL)); #ifdef DEPTH_LIMIT DEPTH = ASP[E_DEPTH]; #endif @@ -1015,7 +1017,7 @@ static Int setup_call_catcher_cleanup(USES_REGS1) { gi.cp = CP; gi.b_top = LCL0-CellPtr(B); gi.CurSlot = Yap_CurrentHandle(); - gi.a = LCL0-ASP; + gi.y = LCL0-YENV; gi.e = LCL0-ENV; bool rc; Yap_DisableInterrupts(worker_id); @@ -1027,22 +1029,23 @@ static Int setup_call_catcher_cleanup(USES_REGS1) { } choiceptr B0=(choiceptr)(LCL0-gi.b_top); if (!rc) { - complete_inner_computation(B0); + complete_inner_computation(B0, &gi); // We'll pass it throughs return false; } else { - prune_inner_computation(B0); + prune_inner_computation(B0, &gi); } - ASP = LCL0-gi.a; - ENV = LCL0-gi.e; - B = (choiceptr)(LCL0-gi.b_top); + YENV = LCL0-gi.y; + ENV = LCL0-gi.e; + B = (choiceptr)(LCL0-gi.b_top); + SET_ASP(YENV, E_CB * sizeof(CELL)); #ifdef DEPTH_LIMIT - DEPTH = ASP[E_DEPTH]; + DEPTH = ENV[E_DEPTH]; #endif - P = gi.p; - CP = gi.cp; - return rc; + P = gi.p; + CP = gi.cp; + return rc; } static Int tag_cleanup(USES_REGS1) { @@ -1766,7 +1769,7 @@ bool Yap_execute_pred(PredEntry *ppe, CELL *pt, bool pass_ex USES_REGS) { gi.cp = CP; gi.b_top = LCL0-CellPtr(B); gi.CurSlot = Yap_CurrentHandle(); - gi.a = LCL0-ASP; + gi.y = LCL0-YENV; gi.e = LCL0-ENV; LOCAL_PrologMode |= TopGoalMode; @@ -1797,7 +1800,6 @@ bool Yap_execute_pred(PredEntry *ppe, CELL *pt, bool pass_ex USES_REGS) { B = (choiceptr)(LCL0-gi.b_top); CP = gi.cp; P = gi.p; - ASP = LCL0-gi.a; #ifdef DEPTH_LIMIT DEPTH = ENV[E_DEPTH]; #endif @@ -1826,11 +1828,11 @@ bool Yap_execute_pred(PredEntry *ppe, CELL *pt, bool pass_ex USES_REGS) { #ifdef DEPTH_LIMIT DEPTH = B->cp_depth; #endif - /* ASP should be set to the top of the local stack when we - did the call */ - ASP = LCL0-gi.a; /* YENV should be set to the current environment */ YENV = ENV = LCL0-gi.e; + /* ASP should be set to the top of the local stack when we + did the call */ + SET_ASP(YENV, E_CB * sizeof(CELL)); B =(choiceptr)(LCL0-gi.b_top); SET_BB(B); HB = PROTECT_FROZEN_H(B); diff --git a/CXX/yapi.cpp b/CXX/yapi.cpp index d8b592cbe..9733eadc3 100644 --- a/CXX/yapi.cpp +++ b/CXX/yapi.cpp @@ -613,6 +613,7 @@ bool YAPEngine::mgoal(Term t, Term tmod, bool release) { CACHE_REGS BACKUP_MACHINE_REGS(); bool rc = YAP_RunGoalOnce(t); + RECOVER_MACHINE_REGS(); return rc; } /** @@ -630,64 +631,49 @@ Term YAPEngine::fun(Term t) { CACHE_REGS BACKUP_MACHINE_REGS(); Term tmod = Yap_CurrentModule(), *ts = nullptr; - PredEntry *ap; arity_t arity; Functor f; Atom name; - YAP_dogoalinfo backup = q; + yhandle_t yt = Yap_NewHandles(1); if (IsApplTerm(t)) { ts = RepAppl(t) + 1; f = (Functor)ts[-1]; name = NameOfFunctor(f); arity = ArityOfFunctor(f); - for (arity_t i = 0; i < arity; i++) - XREGS[i + 1] = ts[i]; + t = AbsAppl(HR); + HR[0] = (CELL)Yap_MkFunctor(name, arity+1); + for (arity_t i = 0; i < arity; i++) { + HR[i + 1] = ts[i]; + } + HR[arity] = Yap_GetFromHandle(yt); + HR += (arity+2); } else if (IsAtomTerm(t)) { name = AtomOfTerm(t); - f = nullptr; - arity = 0; + t = AbsAppl(HR); + HR[0] = (CELL)Yap_MkFunctor(name, 1); + HR[1] = Yap_GetFromHandle(yt); + HR += 2; } else if (IsPairTerm(t)) { - XREGS[1] = ts[0]; - XREGS[2] = ts[1]; - arity = 2; - name = AtomDot; - f = FunctorDot; + HR[0] = (CELL)Yap_MkFunctor(AtomDot, 3); + HR[1] = ts[0]; + HR[2] = ts[1]; + HR[3] = Yap_GetFromHandle(yt); } else { throw YAPError(SOURCE(), TYPE_ERROR_CALLABLE, t, 0); return 0L; } - Term ot = XREGS[arity + 1] = MkVarTerm(); - yhandle_t h = Yap_InitHandle(ot); - arity++; - HR += arity; - f = Yap_MkFunctor(name, arity); - ap = (PredEntry *)(PredPropByFunc(f, tmod)); - if (ap == nullptr || ap->OpcodeOfPred == UNDEF_OPCODE) { - Term g = (Yap_MkApplTerm(f, arity, ts)); - ap = rewriteUndefEngineQuery(ap, g, (ap->ModuleOfPred)); - } - q.CurSlot = Yap_StartSlots(); - q.p = P; - q.cp = CP; - // make sure this is safe - // allow Prolog style exception handling - //__android_log_print(ANDROID_LOG_INFO, "YAPDroid", "exec "); - - bool result = (bool)YAP_EnterGoal(ap, nullptr, &q); - if (result) - ot = Yap_GetFromHandle(h); - else - ot = TermNone; - YAPCatchError(); - { - YAP_LeaveGoal(result, &q); - // PyEval_RestoreThread(_save); - RECOVER_MACHINE_REGS(); - q = backup; - return ot; - } + CACHE_REGS + BACKUP_MACHINE_REGS(); + bool rc = YAP_RunGoalOnce(t); + Term ot; + if (rc) + ot = Yap_GetFromHandle(yt); + else + ot = TermNone; + RECOVER_MACHINE_REGS(); + return ot; } YAPQuery::YAPQuery(YAPFunctor f, YAPTerm mod, YAPTerm ts[]) diff --git a/include/YapDefs.h b/include/YapDefs.h index 43ac14687..a3b2af2f4 100755 --- a/include/YapDefs.h +++ b/include/YapDefs.h @@ -138,7 +138,7 @@ typedef enum { /* this should be opaque to the user */ typedef struct goal_info { - unsigned long b_top, b_bottom, m, e, a; //> choice-point at entry + unsigned long b_top, b_bottom, m, e, y; //> choice-point at entry YAP_handle_t CurSlot; //> variables at entry YAP_handle_t EndSlot; //> variables at successful execution struct yami *p; //> Program Counter at entry From 7d85bbfa27cb93a23008e49c722538b2bea6447b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Sat, 13 Apr 2019 14:05:31 +0100 Subject: [PATCH 05/29] py --- CXX/yapi.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CXX/yapi.cpp b/CXX/yapi.cpp index 9733eadc3..92e12894b 100644 --- a/CXX/yapi.cpp +++ b/CXX/yapi.cpp @@ -636,7 +636,6 @@ Term YAPEngine::fun(Term t) { Atom name; yhandle_t yt = Yap_NewHandles(1); - if (IsApplTerm(t)) { ts = RepAppl(t) + 1; f = (Functor)ts[-1]; @@ -647,29 +646,32 @@ Term YAPEngine::fun(Term t) { for (arity_t i = 0; i < arity; i++) { HR[i + 1] = ts[i]; } - HR[arity] = Yap_GetFromHandle(yt); HR += (arity+2); + arity++; } else if (IsAtomTerm(t)) { name = AtomOfTerm(t); t = AbsAppl(HR); HR[0] = (CELL)Yap_MkFunctor(name, 1); - HR[1] = Yap_GetFromHandle(yt); HR += 2; + arity = 1; } else if (IsPairTerm(t)) { HR[0] = (CELL)Yap_MkFunctor(AtomDot, 3); HR[1] = ts[0]; HR[2] = ts[1]; - HR[3] = Yap_GetFromHandle(yt); + HR += 4; + arity = 3; } else { throw YAPError(SOURCE(), TYPE_ERROR_CALLABLE, t, 0); return 0L; } + RESET_VARIABLE(HR-1); + yt = Yap_InitHandle(t); CACHE_REGS BACKUP_MACHINE_REGS(); bool rc = YAP_RunGoalOnce(t); Term ot; if (rc) - ot = Yap_GetFromHandle(yt); + ot = ArgOfTerm(arity,Yap_GetFromHandle(yt)); else ot = TermNone; RECOVER_MACHINE_REGS(); From d8b4d1c878abd5d00502e5fc51d06f53986ec91b Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Tue, 16 Apr 2019 09:53:20 +0100 Subject: [PATCH 06/29] fixes --- C/c_interface.c | 41 +++++--------------------------- C/exec.c | 14 +---------- H/Regs.h | 5 ++-- H/YapHandles.h | 31 +++++++++++++++++++++++++ H/absmi.h | 7 +++--- H/amiops.h | 1 + include/YapDefs.h | 2 +- library/maplist.yap | 54 +++++++++++++++++++++---------------------- packages/real/real.c | 1 - packages/real/real.pl | 2 +- 10 files changed, 75 insertions(+), 83 deletions(-) diff --git a/C/c_interface.c b/C/c_interface.c index 6ff8209e2..6113a0b29 100755 --- a/C/c_interface.c +++ b/C/c_interface.c @@ -1,4 +1,3 @@ - /************************************************************************* * * YAP Prolog * * Yap Prolog was developed at NCCUP - Universidade do Porto * @@ -995,6 +994,10 @@ static Int execute_cargs(PredEntry *pe, CPredicate exec_code USES_REGS) { "YAP only supports SWI C-call with arity =< 10"); return false; } + arity_t i; + for (i = 0; i < pe->ArityOfPE; i++) { + XREGS[i+1] = Yap_GetFromSlot(a1+i); + } Yap_RecoverSlots(pe->ArityOfPE, a1); return rc; } @@ -1974,22 +1977,16 @@ X_API Int YAP_RunGoalOnce(Term t) { CACHE_REGS Term out; YAP_dogoalinfo gi; - gi.p = P; - gi.cp = CP; - gi.b_top = LCL0-CellPtr(B); - gi.CurSlot = Yap_CurrentHandle(); - gi.y = LCL0-YENV; - gi.e = LCL0-ENV; Int oldPrologMode = LOCAL_PrologMode; - yhandle_t CSlot; BACKUP_MACHINE_REGS(); - CSlot = Yap_StartSlots(); + Yap_push_state(&gi PASS_REGS); LOCAL_PrologMode = UserMode; // Yap_heap_regs->yap_do_low_level_trace=true; out = Yap_RunTopGoal(t, &gi, true); LOCAL_PrologMode = oldPrologMode; // Yap_CloseSlots(CSlot); + Yap_pop_state(out, &gi PASS_REGS); if (!(oldPrologMode & UserCCallMode)) { /* called from top-level */ LOCAL_AllowRestart = FALSE; @@ -1999,32 +1996,6 @@ X_API Int YAP_RunGoalOnce(Term t) { // should we catch the exception or pass it through? // We'll pass it through // Yap_RaiseException(); - if (out) { - choiceptr cut_pt; - - cut_pt = B; - B = (choiceptr)(LCL0-gi.b_top); - while (cut_pt->cp_ap != NOCODE && cut_pt < B) { - /* make sure we prune C-choicepoints */ - cut_pt = cut_pt->cp_b; - } - B = cut_pt; - Yap_TrimTrail(); - } else { - Yap_CloseSlots(CSlot); - } -#ifdef YAPOR - CUT_prune_to(cut_pt); -#endif - ENV = LCL0-gi.e; - YENV = LCL0-gi.y; - B = (choiceptr)(LCL0-gi.b_top); -#ifdef DEPTH_LIMIT - DEPTH = ENV[E_DEPTH]; -#endif - P = gi.p; - CP = gi.cp; - SET_ASP(YENV, E_CB * sizeof(CELL)); LOCAL_AllowRestart = FALSE; RECOVER_MACHINE_REGS(); return out; diff --git a/C/exec.c b/C/exec.c index 9d5ba1072..27a873971 100755 --- a/C/exec.c +++ b/C/exec.c @@ -856,13 +856,7 @@ static void complete_inner_computation(choiceptr old_B, YAP_dogoalinfo *gi) { static Int Yap_ignore(Term t, bool fail USES_REGS) { YAP_dogoalinfo gi; - gi.p = P; - gi.cp = CP; - gi.b_top = LCL0-CellPtr(B); - gi.CurSlot = Yap_CurrentHandle(); - gi.y = LCL0-YENV; - gi.e = LCL0-ENV; - // gi. = LCL0-YENV; + Yap_push_state(&gi); yap_error_descriptor_t *ctx = malloc(sizeof(yap_error_descriptor_t)); bool newxp = Yap_pushErrorContext(true, ctx); bool rc = Yap_RunTopGoal(t, &gi, false); @@ -874,12 +868,6 @@ static Int Yap_ignore(Term t, bool fail USES_REGS) { prune_inner_computation(B0, &gi); } Yap_popErrorContext(newxp, true); - ENV = LCL0-gi.e; - B = (choiceptr)(LCL0-gi.b_top); - SET_ASP(ENV, E_CB * sizeof(CELL)); -#ifdef DEPTH_LIMIT - DEPTH = ASP[E_DEPTH]; -#endif P = gi.p; CP = gi.cp; //YENV? diff --git a/H/Regs.h b/H/Regs.h index e4c3ef110..7d850b650 100755 --- a/H/Regs.h +++ b/H/Regs.h @@ -681,8 +681,9 @@ CalculateStackGap( USES_REGS1 ) #define SET_ASP(Y,S) SET_ASP__(Y,S PASS_REGS) -static inline -void SET_ASP__(CELL *yreg, Int sz USES_REGS) { +INLINE_ONLY void SET_ASP__(CELL *yreg, Int sz USES_REGS); + +INLINE_ONLY void SET_ASP__(CELL *yreg, Int sz USES_REGS) { ASP = (CELL *) (((char *) yreg) + sz); if (ASP > (CELL *)PROTECT_FROZEN_B(B)) ASP = (CELL *)PROTECT_FROZEN_B(B); diff --git a/H/YapHandles.h b/H/YapHandles.h index f7a6be6d3..bfc212dfc 100755 --- a/H/YapHandles.h +++ b/H/YapHandles.h @@ -304,4 +304,35 @@ static inline Term Yap_PopHandle__(yhandle_t topHandle USES_REGS) { return Deref(LOCAL_HandleBase[topHandle]); } } +INLINE_ONLY void Yap_push_state(YAP_dogoalinfo *gi USES_REGS); + + INLINE_ONLY void Yap_push_state(YAP_dogoalinfo *gi USES_REGS) +{ + gi->p = P; + gi->cp = CP; + gi->b_top = LCL0-CellPtr(B); + gi->CurSlot = Yap_CurrentHandle(); + gi->y = LCL0-YENV; + gi->e = LCL0-ENV; + gi->a = LCL0-ASP; +} + +INLINE_ONLY void Yap_pop_state(bool out, YAP_dogoalinfo *gi USES_REGS); + +INLINE_ONLY void Yap_pop_state(bool out, YAP_dogoalinfo *gi USES_REGS) +{ + B = (choiceptr)(LCL0-gi->b_top); + YENV = LCL0-gi->y; + ENV = LCL0-gi->e; + if (out) { + Yap_TrimTrail(); + } + ASP = LCL0-gi->a; + Yap_CloseHandles(gi->CurSlot); + SET_ASP(YENV, E_CB * sizeof(CELL)); +#ifdef DEPTH_LIMIT + DEPTH = ENV[E_DEPTH]; +#endif +} + #endif diff --git a/H/absmi.h b/H/absmi.h index 30bfafd19..01884cc3d 100755 --- a/H/absmi.h +++ b/H/absmi.h @@ -2398,6 +2398,7 @@ Int (*Yap_traced_absmi)(void); extern JIT_Compiler *J; #endif + extern NativeContext *NativeArea; extern IntermediatecodeContext *IntermediatecodeArea; @@ -2421,7 +2422,7 @@ extern yamop *headoftrace; #ifdef SHADOW_S #define PROCESS_INT(F, C) \ BEGD(d0); \ - Yap_REGS.S_ = SREG; \ + Yap_REGSS_ = SREG; \ saveregs(); \ d0 = F(PASS_REGS1); \ setregs(); \ @@ -2444,8 +2445,8 @@ extern yamop *headoftrace; FAIL(); \ if (d0 == 2) \ goto C; \ - JMPNext(); \ - ENDD(d0); + JMPNext();\ + ENDD(d0); #endif #define Yap_AsmError(e, d) \ diff --git a/H/amiops.h b/H/amiops.h index 44718dae2..6c05af2db 100644 --- a/H/amiops.h +++ b/H/amiops.h @@ -577,4 +577,5 @@ static inline int do_cut(int i) { #define cut_fail() return do_cut(FALSE) + #endif diff --git a/include/YapDefs.h b/include/YapDefs.h index a3b2af2f4..840814886 100755 --- a/include/YapDefs.h +++ b/include/YapDefs.h @@ -138,7 +138,7 @@ typedef enum { /* this should be opaque to the user */ typedef struct goal_info { - unsigned long b_top, b_bottom, m, e, y; //> choice-point at entry + unsigned long b_top, b_bottom, m, e, y, a; //> choice-point at entry YAP_handle_t CurSlot; //> variables at entry YAP_handle_t EndSlot; //> variables at successful execution struct yami *p; //> Program Counter at entry diff --git a/library/maplist.yap b/library/maplist.yap index 5583d446c..a79eed3a9 100644 --- a/library/maplist.yap +++ b/library/maplist.yap @@ -710,7 +710,7 @@ scanl_([H1|T1], [H2|T2], [H3|T3], [H4|T4], Goal, V, [VH|VT]) :- goal_expansion(checklist(Meta, List), Mod:Goal) :- goal_expansion_allowed, - is_callable(Meta), + callable(Meta), current_source_module(Mod,Mod), aux_preds(Meta, MetaVars, Pred, PredVars, Proto), !, @@ -731,7 +731,7 @@ goal_expansion(checklist(Meta, List), Mod:Goal) :- goal_expansion(maplist(Meta, List), Mod:Goal) :- goal_expansion_allowed, - is_callable(Meta), + callable(Meta), current_source_module(Mod,Mod), aux_preds(Meta, MetaVars, Pred, PredVars, Proto), !, @@ -752,7 +752,7 @@ goal_expansion(maplist(Meta, List), Mod:Goal) :- goal_expansion(maplist(Meta, ListIn, ListOut), Mod:Goal) :- goal_expansion_allowed, - is_callable(Meta), + callable(Meta), current_source_module(Mod,Mod), aux_preds(Meta, MetaVars, Pred, PredVars, Proto), !, @@ -773,7 +773,7 @@ goal_expansion(maplist(Meta, ListIn, ListOut), Mod:Goal) :- goal_expansion(maplist(Meta, L1, L2, L3), Mod:Goal) :- goal_expansion_allowed, - is_callable(Meta), + callable(Meta), current_source_module(Mod,Mod), aux_preds(Meta, MetaVars, Pred, PredVars, Proto), !, @@ -794,7 +794,7 @@ goal_expansion(maplist(Meta, L1, L2, L3), Mod:Goal) :- goal_expansion(maplist(Meta, L1, L2, L3, L4), Mod:Goal) :- goal_expansion_allowed, - is_callable(Meta), + callable(Meta), current_source_module(Mod,Mod), aux_preds(Meta, MetaVars, Pred, PredVars, Proto), !, @@ -815,7 +815,7 @@ goal_expansion(maplist(Meta, L1, L2, L3, L4), Mod:Goal) :- goal_expansion(maplist(Meta, L1, L2, L3, L4, L5), Mod:Goal) :- goal_expansion_allowed, - is_callable(Meta), + callable(Meta), current_source_module(Mod,Mod), aux_preds(Meta, MetaVars, Pred, PredVars, Proto), !, @@ -836,7 +836,7 @@ goal_expansion(maplist(Meta, L1, L2, L3, L4, L5), Mod:Goal) :- goal_expansion(selectlist(Meta, ListIn, ListOut), Mod:Goal) :- goal_expansion_allowed, - is_callable(Meta), + callable(Meta), current_source_module(Mod,Mod), aux_preds(Meta, MetaVars, Pred, PredVars, Proto), !, @@ -859,7 +859,7 @@ goal_expansion(selectlist(Meta, ListIn, ListOut), Mod:Goal) :- goal_expansion(selectlist(Meta, ListIn, ListIn1, ListOut), Mod:Goal) :- goal_expansion_allowed, - is_callable(Meta), + callable(Meta), current_source_module(Mod,Mod), aux_preds(Meta, MetaVars, Pred, PredVars, Proto), !, @@ -882,7 +882,7 @@ goal_expansion(selectlist(Meta, ListIn, ListIn1, ListOut), Mod:Goal) :- goal_expansion(selectlists(Meta, ListIn, ListIn1, ListOut, ListOut1), Mod:Goal) :- goal_expansion_allowed, - is_callable(Meta), + callable(Meta), current_source_module(Mod,Mod), aux_preds(Meta, MetaVars, Pred, PredVars, Proto), !, @@ -906,7 +906,7 @@ goal_expansion(selectlists(Meta, ListIn, ListIn1, ListOut, ListOut1), Mod:Goal) % same as selectlist goal_expansion(include(Meta, ListIn, ListOut), Mod:Goal) :- goal_expansion_allowed, - is_callable(Meta), + callable(Meta), current_source_module(Mod,Mod), aux_preds(Meta, MetaVars, Pred, PredVars, Proto), !, @@ -929,7 +929,7 @@ goal_expansion(include(Meta, ListIn, ListOut), Mod:Goal) :- goal_expansion(exclude(Meta, ListIn, ListOut), Mod:Goal) :- goal_expansion_allowed, - is_callable(Meta), + callable(Meta), current_source_module(Mod,Mod), aux_preds(Meta, MetaVars, Pred, PredVars, Proto), !, @@ -952,7 +952,7 @@ goal_expansion(exclude(Meta, ListIn, ListOut), Mod:Goal) :- goal_expansion(partition(Meta, ListIn, List1, List2), Mod:Goal) :- goal_expansion_allowed, - is_callable(Meta), + callable(Meta), current_source_module(Mod,Mod), aux_preds(Meta, MetaVars, Pred, PredVars, Proto), !, @@ -975,7 +975,7 @@ goal_expansion(partition(Meta, ListIn, List1, List2), Mod:Goal) :- goal_expansion(partition(Meta, ListIn, List1, List2, List3), Mod:Goal) :- goal_expansion_allowed, - is_callable(Meta), + callable(Meta), current_source_module(Mod,Mod), aux_preds(Meta, MetaVars, Pred, PredVars, Proto), !, @@ -1015,7 +1015,7 @@ goal_expansion(partition(Meta, ListIn, List1, List2, List3), Mod:Goal) :- goal_expansion(convlist(Meta, ListIn, ListOut), Mod:Goal) :- goal_expansion_allowed, - is_callable(Meta), + callable(Meta), current_source_module(Mod,Mod), aux_preds(Meta, MetaVars, Pred, PredVars, Proto), !, @@ -1038,7 +1038,7 @@ goal_expansion(convlist(Meta, ListIn, ListOut), Mod:Goal) :- goal_expansion(convlist(Meta, ListIn, ListExtra, ListOut), Mod:Goal) :- goal_expansion_allowed, - is_callable(Meta), + callable(Meta), current_source_module(Mod,Mod), aux_preds(Meta, MetaVars, Pred, PredVars, Proto), !, @@ -1061,7 +1061,7 @@ goal_expansion(convlist(Meta, ListIn, ListExtra, ListOut), Mod:Goal) :- goal_expansion(sumlist(Meta, List, AccIn, AccOut), Mod:Goal) :- goal_expansion_allowed, - is_callable(Meta), + callable(Meta), current_source_module(Mod,Mod), aux_preds(Meta, MetaVars, Pred, PredVars, Proto), !, @@ -1082,7 +1082,7 @@ goal_expansion(sumlist(Meta, List, AccIn, AccOut), Mod:Goal) :- goal_expansion(foldl(Meta, List, AccIn, AccOut), Mod:Goal) :- goal_expansion_allowed, - is_callable(Meta), + callable(Meta), current_source_module(Mod,Mod), aux_preds(Meta, MetaVars, Pred, PredVars, Proto), !, @@ -1103,7 +1103,7 @@ goal_expansion(foldl(Meta, List, AccIn, AccOut), Mod:Goal) :- goal_expansion(foldl(Meta, List1, List2, AccIn, AccOut), Mod:Goal) :- goal_expansion_allowed, - is_callable(Meta), + callable(Meta), current_source_module(Mod,Mod), aux_preds(Meta, MetaVars, Pred, PredVars, Proto), !, @@ -1124,7 +1124,7 @@ goal_expansion(foldl(Meta, List1, List2, AccIn, AccOut), Mod:Goal) :- goal_expansion(foldl(Meta, List1, List2, List3, AccIn, AccOut), Mod:Goal) :- goal_expansion_allowed, - is_callable(Meta), + callable(Meta), current_source_module(Mod,Mod), aux_preds(Meta, MetaVars, Pred, PredVars, Proto), !, @@ -1145,7 +1145,7 @@ goal_expansion(foldl(Meta, List1, List2, List3, AccIn, AccOut), Mod:Goal) :- goal_expansion(foldl2(Meta, List, AccIn, AccOut, W0, W), Mod:Goal) :- goal_expansion_allowed, - is_callable(Meta), + callable(Meta), current_source_module(Mod,Mod), aux_preds(Meta, MetaVars, Pred, PredVars, Proto), !, @@ -1166,7 +1166,7 @@ goal_expansion(foldl2(Meta, List, AccIn, AccOut, W0, W), Mod:Goal) :- goal_expansion(foldl2(Meta, List1, List2, AccIn, AccOut, W0, W), Mod:Goal) :- goal_expansion_allowed, - is_callable(Meta), + callable(Meta), current_source_module(Mod,Mod), aux_preds(Meta, MetaVars, Pred, PredVars, Proto), !, @@ -1187,7 +1187,7 @@ goal_expansion(foldl2(Meta, List1, List2, AccIn, AccOut, W0, W), Mod:Goal) :- goal_expansion(foldl2(Meta, List1, List2, List3, AccIn, AccOut, W0, W), Mod:Goal) :- goal_expansion_allowed, - is_callable(Meta), + callable(Meta), current_source_module(Mod,Mod), aux_preds(Meta, MetaVars, Pred, PredVars, Proto), !, @@ -1208,7 +1208,7 @@ goal_expansion(foldl2(Meta, List1, List2, List3, AccIn, AccOut, W0, W), Mod:Goal goal_expansion(foldl3(Meta, List, AccIn, AccOut, W0, W, X0, X), Mod:Goal) :- goal_expansion_allowed, - is_callable(Meta), + callable(Meta), current_source_module(Mod,Mod), aux_preds(Meta, MetaVars, Pred, PredVars, Proto), !, @@ -1229,7 +1229,7 @@ goal_expansion(foldl3(Meta, List, AccIn, AccOut, W0, W, X0, X), Mod:Goal) :- goal_expansion(foldl4(Meta, List, AccIn, AccOut, W0, W, X0, X, Y0, Y), Mod:Goal) :- goal_expansion_allowed, - is_callable(Meta), + callable(Meta), current_source_module(Mod,Mod), aux_preds(Meta, MetaVars, Pred, PredVars, Proto), !, @@ -1250,7 +1250,7 @@ goal_expansion(foldl4(Meta, List, AccIn, AccOut, W0, W, X0, X, Y0, Y), Mod:Goal) goal_expansion(mapnodes(Meta, InTerm, OutTerm), Mod:Goal) :- goal_expansion_allowed, - is_callable(Meta), + callable(Meta), current_source_module(Mod,Mod), aux_preds(Meta, MetaVars, Pred, PredVars, Proto), !, @@ -1282,7 +1282,7 @@ goal_expansion(mapnodes(Meta, InTerm, OutTerm), Mod:Goal) :- goal_expansion(checknodes(Meta, Term), Mod:Goal) :- goal_expansion_allowed, - is_callable(Meta), + callable(Meta), current_source_module(Mod,Mod), aux_preds(Meta, MetaVars, Pred, PredVars, Proto), !, @@ -1312,7 +1312,7 @@ goal_expansion(checknodes(Meta, Term), Mod:Goal) :- goal_expansion(sumnodes(Meta, Term, AccIn, AccOut), Mod:Goal) :- goal_expansion_allowed, - is_callable(Meta), + callable(Meta), current_source_module(Mod,Mod), aux_preds(Meta, MetaVars, Pred, PredVars, Proto), !, diff --git a/packages/real/real.c b/packages/real/real.c index d0d4706ae..0f7c3d7e5 100644 --- a/packages/real/real.c +++ b/packages/real/real.c @@ -1,4 +1,3 @@ - /** * @file real.c * @date Sat May 19 13:44:04 2018 diff --git a/packages/real/real.pl b/packages/real/real.pl index 8e8905676..c39a7fcc2 100755 --- a/packages/real/real.pl +++ b/packages/real/real.pl @@ -956,7 +956,7 @@ prolog:message( r_root ) --> eval_text( Text ) :- - atomic_to_term( Text, Goal, VarNames ), + atomic_to_term( Text, Goal, _VarNames ), call(user:Goal). :- at_halt(halt_r). From 91016209748d81f8285e96bcdc5c687a6f57546b Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Sat, 20 Apr 2019 03:25:12 -0500 Subject: [PATCH 07/29] conda --- info/build.sh | 4 ++-- info/meta.yaml | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/info/build.sh b/info/build.sh index bba74fa52..cc1fdc7c9 100644 --- a/info/build.sh +++ b/info/build.sh @@ -13,11 +13,11 @@ mkdir $PREFIX/conda cd $PREFIX/conda # The datarootdir option places the docs into a temp folder that won't $CMAKE --build=. --target=install \ - -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_BUILD_TYPE=Debug -GNinja \ -DCMAKE_INSTALL_PREFIX="$PREFIX" \ $RECIPE_DIR/.. -DWITH_CUDD=NO -DWITH_GECODE=NO -DWITH_JAVA=NO -DWITH_RAPTOR=NO - make -j install + ninja install # Remove the created lib64 directory diff --git a/info/meta.yaml b/info/meta.yaml index 8a51f5bbd..25d2122e3 100644 --- a/info/meta.yaml +++ b/info/meta.yaml @@ -15,7 +15,6 @@ requirements: - r - notebook - pkgconfig - - make - libxml2 run: - jupyterlab From 1f7835c5efda292a662582ac2f594859e4afcb5d Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Sat, 20 Apr 2019 12:48:33 +0100 Subject: [PATCH 08/29] fix_dbload --- C/cdmgr.c | 440 +------------------------------------------------- C/stdpreds.c | 1 + H/clause.h | 2 + pl/dbload.yap | 14 +- 4 files changed, 16 insertions(+), 441 deletions(-) diff --git a/C/cdmgr.c b/C/cdmgr.c index 7feda492c..e880251b7 100644 --- a/C/cdmgr.c +++ b/C/cdmgr.c @@ -202,210 +202,6 @@ restart: return NULL; } -/****************************************************************** - - Mega Clauses - -******************************************************************/ - -#define OrArgAdjust(P) -#define TabEntryAdjust(P) -#define DoubleInCodeAdjust(D) -#define IntegerInCodeAdjust(D) -#define IntegerAdjust(D) (D) -#define PtoPredAdjust(X) (X) -#define PtoOpAdjust(X) (X) -#define PtoLUClauseAdjust(P) (P) -#define PtoLUIndexAdjust(P) (P) -#define XAdjust(X) (X) -#define YAdjust(X) (X) -#define AtomTermAdjust(X) (X) -#define CellPtoHeapAdjust(X) (X) -#define FuncAdjust(X) (X) -#define CodeAddrAdjust(X) (X) -#define CodeComposedTermAdjust(X) (X) -#define ConstantAdjust(X) (X) -#define ArityAdjust(X) (X) -#define OpcodeAdjust(X) (X) -#define ModuleAdjust(X) (X) -#define ExternalFunctionAdjust(X) (X) -#define AdjustSwitchTable(X, Y, Z) -#define DBGroundTermAdjust(X) (X) -#define rehash(A, B, C) - -static Term BlobTermInCodeAdjust(Term t) { - CACHE_REGS -#if TAGS_FAST_OPS - return t - LOCAL_ClDiff; -#else - return t + LOCAL_ClDiff; -#endif -} - -static Term ConstantTermAdjust(Term t) { - if (IsAtomTerm(t)) - return AtomTermAdjust(t); - return t; -} - -#include "rclause.h" - -#ifdef DEBUG -static UInt total_megaclause, total_released, nof_megaclauses; -#endif - -void Yap_BuildMegaClause(PredEntry *ap) { - CACHE_REGS - StaticClause *cl; - UInt sz; - MegaClause *mcl; - yamop *ptr; - size_t required; - UInt has_blobs = 0; - - if (ap->PredFlags & (DynamicPredFlag | LogUpdatePredFlag | MegaClausePredFlag -#ifdef TABLING - | TabledPredFlag -#endif /* TABLING */ - | UDIPredFlag) || - ap->cs.p_code.FirstClause == NULL || ap->cs.p_code.NOfClauses < 16) { - return; - } - cl = ClauseCodeToStaticClause(ap->cs.p_code.FirstClause); - sz = cl->ClSize; - while (TRUE) { - if (!(cl->ClFlags & FactMask)) - return; /* no mega clause, sorry */ - if (cl->ClSize != sz) - return; /* no mega clause, sorry */ - if (cl->ClCode == ap->cs.p_code.LastClause) - break; - has_blobs |= (cl->ClFlags & HasBlobsMask); - cl = cl->ClNext; - } - /* ok, we got the chance for a mega clause */ - if (has_blobs) { - sz -= sizeof(StaticClause); - } else { - sz -= (UInt)NEXTOP((yamop *)NULL, p) + sizeof(StaticClause); - } - required = sz * ap->cs.p_code.NOfClauses + sizeof(MegaClause) + - (UInt)NEXTOP((yamop *)NULL, l); - while (!(mcl = (MegaClause *)Yap_AllocCodeSpace(required))) { - if (!Yap_growheap(FALSE, required, NULL)) { - /* just fail, the system will keep on going */ - return; - } - } -#ifdef DEBUG - total_megaclause += required; - cl = ClauseCodeToStaticClause(ap->cs.p_code.FirstClause); - total_released += ap->cs.p_code.NOfClauses * cl->ClSize; - nof_megaclauses++; -#endif - Yap_ClauseSpace += required; - /* cool, it's our turn to do the conversion */ - mcl->ClFlags = MegaMask | has_blobs; - mcl->ClSize = required; - mcl->ClPred = ap; - mcl->ClItemSize = sz; - mcl->ClNext = NULL; - cl = ClauseCodeToStaticClause(ap->cs.p_code.FirstClause); - mcl->ClLine = cl->usc.ClLine; - ptr = mcl->ClCode; - while (TRUE) { - memmove((void *)ptr, (void *)cl->ClCode, sz); - if (has_blobs) { - LOCAL_ClDiff = (char *)(ptr) - (char *)cl->ClCode; - restore_opcodes(ptr, NULL PASS_REGS); - } - ptr = (yamop *)((char *)ptr + sz); - if (cl->ClCode == ap->cs.p_code.LastClause) - break; - cl = cl->ClNext; - } - ptr->opc = Yap_opcode(_Ystop); - cl = ClauseCodeToStaticClause(ap->cs.p_code.FirstClause); - /* recover the space spent on the original clauses */ - while (TRUE) { - StaticClause *ncl, *curcl = cl; - - ncl = cl->ClNext; - Yap_InformOfRemoval(cl); - Yap_ClauseSpace -= cl->ClSize; - Yap_FreeCodeSpace((ADDR)cl); - if (curcl->ClCode == ap->cs.p_code.LastClause) - break; - cl = ncl; - } - ap->cs.p_code.FirstClause = ap->cs.p_code.LastClause = mcl->ClCode; - ap->PredFlags |= MegaClausePredFlag; - Yap_inform_profiler_of_clause(mcl, (char *)mcl + required, ap, GPROF_MEGA); -} - -static void split_megaclause(PredEntry *ap) { - StaticClause *start = NULL, *prev = NULL; - MegaClause *mcl; - yamop *ptr; - UInt ncls = ap->cs.p_code.NOfClauses, i; - - mcl = ClauseCodeToMegaClause(ap->cs.p_code.FirstClause); - if (mcl->ClFlags & ExoMask) { - Yap_Error(PERMISSION_ERROR_MODIFY_STATIC_PROCEDURE, Yap_PredicateToIndicator(ap), - "while deleting clause from exo predicate %s/%d\n", - RepAtom(NameOfFunctor(ap->FunctorOfPred))->StrOfAE, - ap->ArityOfPE); - return; - } - RemoveIndexation(ap); - for (i = 0, ptr = mcl->ClCode; i < ncls; i++) { - StaticClause *new = (StaticClause *)Yap_AllocCodeSpace( - sizeof(StaticClause) + mcl->ClItemSize + - (UInt)NEXTOP((yamop *)NULL, p)); - if (new == NULL) { - if (!Yap_growheap(FALSE, - (sizeof(StaticClause) + mcl->ClItemSize) * (ncls - i), - NULL)) { - while (start) { - StaticClause *cl = start; - start = cl->ClNext; - Yap_InformOfRemoval(cl); - Yap_ClauseSpace -= cl->ClSize; - Yap_FreeCodeSpace((char *)cl); - } - if (ap->ArityOfPE) { - Yap_Error(RESOURCE_ERROR_HEAP, TermNil, - "while breaking up mega clause for %s/%d\n", - RepAtom(NameOfFunctor(ap->FunctorOfPred))->StrOfAE, - ap->ArityOfPE); - } else { - Yap_Error(RESOURCE_ERROR_HEAP, TermNil, - "while breaking up mega clause for %s\n", - RepAtom((Atom)ap->FunctorOfPred)->StrOfAE); - } - return; - } - break; - } - Yap_ClauseSpace += - sizeof(StaticClause) + mcl->ClItemSize + (UInt)NEXTOP((yamop *)NULL, p); - new->ClFlags = StaticMask | FactMask; - new->ClSize = mcl->ClItemSize; - new->usc.ClLine = Yap_source_line_no(); - new->ClNext = NULL; - memmove((void *)new->ClCode, (void *)ptr, mcl->ClItemSize); - if (prev) { - prev->ClNext = new; - } else { - start = new; - } - ptr = (yamop *)((char *)ptr + mcl->ClItemSize); - prev = new; - } - ap->PredFlags &= ~MegaClausePredFlag; - ap->cs.p_code.FirstClause = start->ClCode; - ap->cs.p_code.LastClause = prev->ClCode; -} /****************************************************************** @@ -1763,7 +1559,7 @@ bool Yap_addclause(Term t, yamop *cp, Term tmode, Term mod, Term *t4ref) pflags = p->PredFlags; /* we are redefining a prolog module predicate */ if (pflags & MegaClausePredFlag) { - split_megaclause(p); + Yap_split_megaclause(p); } /* The only problem we have now is when we need to throw away Indexing blocks @@ -1929,11 +1725,11 @@ void Yap_EraseMegaClause(yamop *cl, PredEntry *ap) { void Yap_EraseStaticClause(StaticClause *cl, PredEntry *ap, Term mod) { /* ok, first I need to find out the parent predicate */ - if (ap->PredFlags & MegaClausePredFlag) { - split_megaclause(ap); - } if (ap->PredFlags & IndexedPredFlag) RemoveIndexation(ap); + if (ap->PredFlags & MegaClausePredFlag) { + Yap_split_megaclause(ap); + } ap->cs.p_code.NOfClauses--; if (ap->cs.p_code.FirstClause == cl->ClCode) { /* got rid of first clause */ @@ -3937,224 +3733,6 @@ p_continue_static_clause(USES_REGS1) { return fetch_next_static_clause(pe, ipc, Deref(ARG3), ARG4, ARG5, B->cp_ap, false); } - -static UInt compute_dbcl_size(arity_t arity) { - UInt sz; - switch (arity) { - case 2: - sz = (UInt)NEXTOP((yamop *)NULL, cc); - break; - case 3: - sz = (UInt)NEXTOP((yamop *)NULL, ccc); - break; - case 4: - sz = (UInt)NEXTOP((yamop *)NULL, cccc); - break; - case 5: - sz = (UInt)NEXTOP((yamop *)NULL, ccccc); - break; - case 6: - sz = (UInt)NEXTOP((yamop *)NULL, cccccc); - break; - default: - sz = arity * (UInt)NEXTOP((yamop *)NULL, xc); - break; - } - return (UInt)NEXTOP((yamop *)sz, p); -} - -#define DerefAndCheck(t, V) \ - t = Deref(V); \ - if (IsVarTerm(t) || !(IsAtomOrIntTerm(t))) \ - Yap_Error(TYPE_ERROR_ATOM, t0, "load_db"); - -static int store_dbcl_size(yamop *pc, arity_t arity, Term t0, PredEntry *pe) { - Term t; - CELL *tp = RepAppl(t0) + 1; - switch (arity) { - case 2: - pc->opc = Yap_opcode(_get_2atoms); - DerefAndCheck(t, tp[0]); - pc->y_u.cc.c1 = t; - DerefAndCheck(t, tp[1]); - pc->y_u.cc.c2 = t; - pc = NEXTOP(pc, cc); - break; - case 3: - pc->opc = Yap_opcode(_get_3atoms); - DerefAndCheck(t, tp[0]); - pc->y_u.ccc.c1 = t; - DerefAndCheck(t, tp[1]); - pc->y_u.ccc.c2 = t; - DerefAndCheck(t, tp[2]); - pc->y_u.ccc.c3 = t; - pc = NEXTOP(pc, ccc); - break; - case 4: - pc->opc = Yap_opcode(_get_4atoms); - DerefAndCheck(t, tp[0]); - pc->y_u.cccc.c1 = t; - DerefAndCheck(t, tp[1]); - pc->y_u.cccc.c2 = t; - DerefAndCheck(t, tp[2]); - pc->y_u.cccc.c3 = t; - DerefAndCheck(t, tp[3]); - pc->y_u.cccc.c4 = t; - pc = NEXTOP(pc, cccc); - break; - case 5: - pc->opc = Yap_opcode(_get_5atoms); - DerefAndCheck(t, tp[0]); - pc->y_u.ccccc.c1 = t; - DerefAndCheck(t, tp[1]); - pc->y_u.ccccc.c2 = t; - DerefAndCheck(t, tp[2]); - pc->y_u.ccccc.c3 = t; - DerefAndCheck(t, tp[3]); - pc->y_u.ccccc.c4 = t; - DerefAndCheck(t, tp[4]); - pc->y_u.ccccc.c5 = t; - pc = NEXTOP(pc, ccccc); - break; - case 6: - pc->opc = Yap_opcode(_get_6atoms); - DerefAndCheck(t, tp[0]); - pc->y_u.cccccc.c1 = t; - DerefAndCheck(t, tp[1]); - pc->y_u.cccccc.c2 = t; - DerefAndCheck(t, tp[2]); - pc->y_u.cccccc.c3 = t; - DerefAndCheck(t, tp[3]); - pc->y_u.cccccc.c4 = t; - DerefAndCheck(t, tp[4]); - pc->y_u.cccccc.c5 = t; - DerefAndCheck(t, tp[5]); - pc->y_u.cccccc.c6 = t; - pc = NEXTOP(pc, cccccc); - break; - default: { - arity_t i; - for (i = 0; i < arity; i++) { - pc->opc = Yap_opcode(_get_atom); -#if PRECOMPUTE_REGADDRESS - pc->y_u.xc.x = (CELL)(XREGS + (i + 1)); -#else - pc->y_u.xc.x = i + 1; -#endif - DerefAndCheck(t, tp[0]); - pc->y_u.xc.c = t; - tp++; - pc = NEXTOP(pc, xc); - } - } break; - } - pc->opc = Yap_opcode(_procceed); - pc->y_u.p.p = pe; - return TRUE; -} - -static Int - p_dbload_get_space(USES_REGS1) { /* '$number_of_clauses'(Predicate,M,N) */ - Term t = Deref(ARG1); - Term mod = Deref(ARG2); - Term tn = Deref(ARG3); - arity_t arity; - Prop pe; - PredEntry *ap; - UInt sz; - MegaClause *mcl; - yamop *ptr; - UInt ncls; - UInt required; - - if (IsVarTerm(mod) || !IsAtomTerm(mod)) { - return (FALSE); - } - if (IsAtomTerm(t)) { - Atom a = AtomOfTerm(t); - arity = 0; - pe = PredPropByAtom(a, mod); - } else if (IsApplTerm(t)) { - register Functor f = FunctorOfTerm(t); - arity = ArityOfFunctor(f); - pe = PredPropByFunc(f, mod); - } else { - return FALSE; - } - if (EndOfPAEntr(pe)) - return FALSE; - ap = RepPredProp(pe); - if (ap->PredFlags & (DynamicPredFlag | LogUpdatePredFlag -#ifdef TABLING - | TabledPredFlag -#endif /* TABLING */ - )) { - Yap_Error(PERMISSION_ERROR_MODIFY_STATIC_PROCEDURE, Yap_PredicateToIndicator(ap), - "dbload_get_space/4"); - return FALSE; - } - if (IsVarTerm(tn) || !IsIntegerTerm(tn)) { - return FALSE; - } - ncls = IntegerOfTerm(tn); - if (ncls <= 1) { - return FALSE; - } - - sz = compute_dbcl_size(arity); - required = sz * ncls + sizeof(MegaClause) + (UInt)NEXTOP((yamop *)NULL, l); -#ifdef DEBUG - total_megaclause += required; - nof_megaclauses++; -#endif - while (!(mcl = (MegaClause *)Yap_AllocCodeSpace(required))) { - if (!Yap_growheap(FALSE, required, NULL)) { - /* just fail, the system will keep on going */ - return FALSE; - } - } - Yap_ClauseSpace += required; - /* cool, it's our turn to do the conversion */ - mcl->ClFlags = MegaMask; - mcl->ClSize = sz * ncls; - mcl->ClPred = ap; - mcl->ClItemSize = sz; - mcl->ClNext = NULL; - ap->cs.p_code.FirstClause = ap->cs.p_code.LastClause = mcl->ClCode; - ap->PredFlags |= (MegaClausePredFlag); - ap->cs.p_code.NOfClauses = ncls; - if (ap->PredFlags & (SpiedPredFlag | CountPredFlag | ProfiledPredFlag)) { - ap->OpcodeOfPred = Yap_opcode(_spy_pred); - } else { - ap->OpcodeOfPred = INDEX_OPCODE; - } - ap->CodeOfPred = ap->cs.p_code.TrueCodeOfPred = - (yamop *)(&(ap->OpcodeOfPred)); - ptr = (yamop *)((ADDR)mcl->ClCode + ncls * sz); - ptr->opc = Yap_opcode(_Ystop); - return Yap_unify(ARG4, MkIntegerTerm((Int)mcl)); -} - -static Int p_dbassert(USES_REGS1) { /* '$number_of_clauses'(Predicate,M,N) */ - Term thandle = Deref(ARG2); - Term tn = Deref(ARG3); - PredEntry *pe; - MegaClause *mcl; - Int n; - - if (IsVarTerm(thandle) || !IsIntegerTerm(thandle)) { - return FALSE; - } - mcl = (MegaClause *)IntegerOfTerm(thandle); - if (IsVarTerm(tn) || !IsIntegerTerm(tn)) { - return FALSE; - } - n = IntegerOfTerm(tn); - pe = mcl->ClPred; - return store_dbcl_size((yamop *)((ADDR)mcl->ClCode + n * (mcl->ClItemSize)), - pe->ArityOfPE, Deref(ARG1), pe); -} - #define CL_PROP_ERASED 0 #define CL_PROP_PRED 1 #define CL_PROP_FILE 2 @@ -4698,8 +4276,6 @@ static Int init_pred_flag_vals(USES_REGS1) { void Yap_InitCdMgr(void) { CACHE_REGS - Term cm = CurrentModule; - Yap_InitCPred("$init_pred_flag_vals", 2, init_pred_flag_vals, SyncPredFlag); Yap_InitCPred("$start_consult", 3, p_startconsult, SafePredFlag | SyncPredFlag); @@ -4792,10 +4368,6 @@ void Yap_InitCdMgr(void) { Yap_InitCPred("instance_property", 3, instance_property, SafePredFlag | SyncPredFlag); Yap_InitCPred("$fetch_nth_clause", 4, p_nth_instance, SyncPredFlag); - CurrentModule = DBLOAD_MODULE; - Yap_InitCPred("dbload_get_space", 4, p_dbload_get_space, 0L); - Yap_InitCPred("dbassert", 3, p_dbassert, 0L); - CurrentModule = cm; Yap_InitCPred("$predicate_erased_statistics", 5, p_predicate_erased_statistics, SyncPredFlag); Yap_InitCPred("$including", 2, including, SyncPredFlag | HiddenPredFlag); @@ -4804,3 +4376,7 @@ void Yap_InitCdMgr(void) { Yap_InitCPred("$predicate_lu_cps", 4, p_predicate_lu_cps, 0L); #endif } + +void Yap_InitCLoadDB(void) { + +} diff --git a/C/stdpreds.c b/C/stdpreds.c index e14d54e9d..9e87d82a7 100755 --- a/C/stdpreds.c +++ b/C/stdpreds.c @@ -1579,6 +1579,7 @@ void Yap_InitCPreds(void) { Yap_InitGlobals(); Yap_InitInlines(); Yap_InitIOPreds(); + Yap_InitDBLoadPreds(); Yap_InitExoPreds(); Yap_InitLoadForeign(); Yap_InitModulesC(); diff --git a/H/clause.h b/H/clause.h index 0889798d6..06256b84c 100644 --- a/H/clause.h +++ b/H/clause.h @@ -465,6 +465,8 @@ extern yap_error_descriptor_t *Yap_bug_location(yap_error_descriptor_t *t, yamop extern yap_error_descriptor_t *Yap_pc_add_location(yap_error_descriptor_t *t, void *p, void *b_ptr, void *env); extern yap_error_descriptor_t * Yap_env_add_location(yap_error_descriptor_t *t, void *p, void *b_ptr, void *env, YAP_Int ignore_first); +void Yap_split_megaclause(PredEntry *ap); + #if LOW_PROF void Yap_InformOfRemoval(void *); void Yap_dump_code_area_for_profiler(void); diff --git a/pl/dbload.yap b/pl/dbload.yap index 75cd96d99..7cceb32f4 100644 --- a/pl/dbload.yap +++ b/pl/dbload.yap @@ -91,7 +91,7 @@ check_dbload_stream(R, M0) :- ). dbload_count(T0, M0) :- - gemodule(T0,M0,T,M), + '$yap_strip_module'(M0:T0,M,T), functor(T,Na,Arity), % dbload_check_term(T), ( @@ -105,10 +105,6 @@ dbload_count(T0, M0) :- nb_setval(NaAr,1) ). -get_module(M1:T0,_,T,M) :- !, - get_module(T0, M1, T , M). -get_module(T,M,T,M). - load_facts :- !, % yap_flag(exo_compilation, on), !. @@ -116,7 +112,7 @@ load_facts :- load_facts :- retract(dbloading(Na,Arity,M,T,NaAr,_)), nb_getval(NaAr,Size), - dbload_get_space(T, M, Size, Handle), + prolog:'$dbload_get_space'(T, M, Size, Handle), assertz(dbloading(Na,Arity,M,T,NaAr,Handle)), nb_setval(NaAr,0), fail. @@ -137,13 +133,13 @@ dbload_add_facts(R, M) :- ). dbload_add_fact(T0, M0) :- - get_module(T0,M0,T,M), + '$yap_strip_module'(M0:T0,M,T), functor(T,Na,Arity), dbloading(Na,Arity,M,_,NaAr,Handle), nb_getval(NaAr,I0), I is I0+1, nb_setval(NaAr,I), - dbassert(T,Handle,I0). + prolog:'$dbassert'(T,Handle,I0). load_exofacts :- retract(dbloading(Na,Arity,M,T,NaAr,_)), @@ -174,7 +170,7 @@ protected_exodb_add_fact(R, M) :- ). exodb_add_fact(T0, M0) :- - get_module(T0,M0,T,M), + '$yap_strip_module'(T0,M0,T,M), functor(T,Na,Arity), dbloading(Na,Arity,M,_,NaAr,Handle), nb_getval(NaAr,I0), From 6a65977b0fdcddbb42ddba6fe844cc77d442eb5f Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Sat, 20 Apr 2019 12:49:35 +0100 Subject: [PATCH 09/29] reuse buffer --- C/scanner.c | 122 +++++++++++++++++----------------------------------- 1 file changed, 39 insertions(+), 83 deletions(-) diff --git a/C/scanner.c b/C/scanner.c index eea251712..960c41cfd 100755 --- a/C/scanner.c +++ b/C/scanner.c @@ -435,7 +435,7 @@ writing, writing a BOM can be requested using the option #define my_islower(C) (C >= 'a' && C <= 'z') static Term float_send(char *, int); -static Term get_num(int *, int *, struct stream_desc *, int); +static Term get_num(int *, int *, struct stream_desc *, int, char **, size_t *); static void Yap_setCurrentSourceLocation(struct stream_desc *s) { CACHE_REGS @@ -579,21 +579,6 @@ static TokEntry *TrailSpaceError__(TokEntry *t, TokEntry *l USES_REGS) { return l; } -#define AuxSpaceError(p, l, msg) AuxSpaceError__(p, l, msg PASS_REGS) -static TokEntry *AuxSpaceError__(TokEntry *p, TokEntry *l, - const char *msg USES_REGS) { - /* huge atom or variable, we are in trouble */ - LOCAL_ErrorMessage = (char *)msg; - LOCAL_Error_TYPE = RESOURCE_ERROR_AUXILIARY_STACK; - Yap_ReleasePreAllocCodeSpace((COBEADDR)TokImage); - if (p) { - p->Tok = eot_tok; - p->TokInfo = TermOutOfAuxspaceError; - } - /* serious error now */ - return l; -} - static void *InitScannerMemory(void) { CACHE_REGS LOCAL_ErrorMessage = NULL; @@ -879,32 +864,22 @@ static int num_send_error_message(char s[]) { #define number_overflow() \ { \ - size_t nsz = Yap_Min(max_size * 2, max_size); \ + imgsz = Yap_Min(imgsz * 2, imgsz); \ char *nbuf; \ - \ - if (buf == buf0) { \ - nbuf = Malloc(nsz); \ - } else { \ - nbuf = realloc(buf, nsz); \ - } \ - if (!nbuf) { \ - return num_send_error_message("Number Too Long"); \ - } else { \ - left = nsz - max_size; \ - max_size = nsz; \ + nbuf = Realloc(buf, imgsz); left = imgsz - max_size; \ + max_size = imgsz; \ buf = nbuf; \ - } \ } /* reads a number, either integer or float */ -static Term get_num(int *chp, int *chbuffp, StreamDesc *st, int sign) { +static Term get_num(int *chp, int *chbuffp, StreamDesc *st, int sign, char **bufp, size_t *szp) { int ch = *chp; Int val = 0L, base = ch - '0'; int might_be_float = TRUE, has_overflow = FALSE; const unsigned char *decimalpoint; - char buf0[256], *sp = buf0, *buf = buf0; - int max_size = 254, left = 254; + char *buf0 = *bufp, *sp = buf0, *buf = buf0; + size_t imgsz = *szp, max_size = imgsz, left = max_size-2; *sp++ = ch; ch = getchr(st); @@ -1167,7 +1142,11 @@ Term Yap_scan_num(StreamDesc *inp, bool error_on) { LOCAL_Error_TYPE = RESOURCE_ERROR_STACK; return 0; } - out = get_num(&ch, &cherr, inp, sign); /* */ + size_t sz = 1024; + char *buf = Malloc(sz); + int lvl = push_text_stack(); + out = get_num(&ch, &cherr, inp, sign, &buf, &sz); /* */ + pop_text_stack(lvl); } else { out = 0; } @@ -1343,6 +1322,9 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, int32_t ch, och = ' '; struct qq_struct_t *cur_qq = NULL; int sign = 1; + size_t imgsz = 1024; + char *TokImage = Malloc(imgsz PASS_REGS); + InitScannerMemory(); LOCAL_VarTable = NULL; @@ -1362,7 +1344,6 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, int quote, isvar; unsigned char *charp, *mp; size_t len; - unsigned char *TokImage = NULL; t = (TokEntry *)AllocScannerMemory(sizeof(TokEntry)); t->TokNext = NULL; @@ -1428,20 +1409,18 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, ch = getchr(st); scan_name: { - size_t sz = 1024; - TokImage = Malloc(sz PASS_REGS); charp = (unsigned char *)TokImage; isvar = (chtype(och) != LC); add_ch_to_buff(och); for (; chtype(ch) <= NU; ch = getchr(st)) { - if (charp == TokImage + (sz - 1)) { - unsigned char *p0 = TokImage; - sz = Yap_Min(sz * 2, sz + MBYTE); - TokImage = Realloc(p0, sz); + if (charp == (unsigned char *)TokImage + (imgsz - 1)) { + unsigned char *p0 = (unsigned char *)TokImage; + imgsz = Yap_Min(imgsz * 2, imgsz + MBYTE); + TokImage = Realloc(p0, imgsz); if (TokImage == NULL) { return CodeSpaceError(t, p, l); } - charp = TokImage + (charp - p0); + charp =(unsigned char *) TokImage + (charp - p0); } add_ch_to_buff(ch); } @@ -1457,8 +1436,7 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, if (!isvar) { Atom ae; /* don't do this in iso */ - ae = Yap_ULookupAtom(TokImage); - Free(TokImage); + ae = Yap_LookupAtom(TokImage); if (ae == NIL) { return CodeSpaceError(t, p, l); } @@ -1468,7 +1446,6 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, t->Tok = Ord(kind = Name_tok); } else { VarEntry *ve = Yap_LookupVar((const char *)TokImage); - Free(TokImage); t->TokInfo = Unsigned(ve); if (cur_qq) { ve->refs++; @@ -1487,7 +1464,7 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, cha = ch; cherr = 0; CHECK_SPACE(); - if ((t->TokInfo = get_num(&cha, &cherr, st, sign)) == 0L) { + if ((t->TokInfo = get_num(&cha, &cherr, st, sign,&TokImage,&imgsz)) == 0L) { if (t->TokInfo == 0) { p->Tok = eot_tok; t->TokInfo = TermError; @@ -1583,21 +1560,19 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, case QT: case DC: quoted_string: - TokImage = Malloc(1048); - charp = TokImage; + charp =(unsigned char *) TokImage; quote = ch; len = 0; ch = getchrq(st); - size_t sz = 1024; while (TRUE) { - if (charp > TokImage + (sz - 1)) { - size_t sz = charp-TokImage; - TokImage = Realloc(TokImage, Yap_Min(sz * 2, sz + MBYTE)); + if (charp > (unsigned char *)TokImage + (imgsz - 1)) { + size_t sz = charp-(unsigned char *)TokImage; + TokImage = Realloc(TokImage, (imgsz = Yap_Min(imgsz * 2, imgsz + MBYTE))); if (TokImage == NULL) { return CodeSpaceError(t, p, l); } - charp = TokImage+sz; + charp = (unsigned char *)TokImage+sz; break; } if (ch == 10 && trueGlobalPrologFlag(ISO_FLAG)) { @@ -1645,11 +1620,10 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, } t->Tok = Ord(kind = String_tok); } else { - t->TokInfo = MkAtomTerm(Yap_ULookupAtom(TokImage)); + t->TokInfo = MkAtomTerm(Yap_LookupAtom(TokImage)); if (!(t->TokInfo)) { return CodeSpaceError(t, p, l); } - Free(TokImage); t->Tok = Ord(kind = Name_tok); if (ch == '(') solo_flag = false; @@ -1763,21 +1737,21 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, return l; } else { Atom ae; - sz = 1024; - TokImage = Malloc(sz); - charp = TokImage; + charp = (unsigned char *)TokImage; add_ch_to_buff(och); for (; chtype(ch) == SY; ch = getchr(st)) { - if (charp >= TokImage + (sz - 10)) { - sz = Yap_Min(sz * 2, sz + MBYTE); - TokImage = Realloc(TokImage, sz); + if (charp >= (unsigned char *)TokImage + (imgsz - 10)) { + size_t sz = charp - (unsigned char *)TokImage; + imgsz = Yap_Min(imgsz * 2, imgsz + MBYTE); + TokImage = Realloc(TokImage, imgsz); if (!TokImage) return CodeSpaceError(t, p, l); + charp = (unsigned char *)TokImage+sz; } add_ch_to_buff(ch); } add_ch_to_buff('\0'); - ae = Yap_ULookupAtom(TokImage); + ae = Yap_LookupAtom(TokImage); if (ae == NIL) { return CodeSpaceError(t, p, l); } @@ -1785,7 +1759,6 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, if (t->TokInfo == (CELL)NIL) { return CodeSpaceError(t, p, l); } - Free(TokImage); t->Tok = Ord(kind = Name_tok); if (ch == '(') solo_flag = false; @@ -1809,8 +1782,8 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, och = ch; ch = getchr(st); { - unsigned char chs[10]; - TokImage = charp = chs; + unsigned char *chs; + charp = chs = (unsigned char *)TokImage; add_ch_to_buff(och); charp[0] = '\0'; t->TokInfo = MkAtomTerm(Yap_ULookupAtom(chs)); @@ -1906,16 +1879,7 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, qq->mid.charno = st->charcount - 1; t->Tok = Ord(kind = QuasiQuotes_tok); ch = getchr(st); - sz = 1024; - TokImage = Malloc(sz); - if (!TokImage) { - LOCAL_ErrorMessage = - "not enough heap space to read in a quasi quoted atom"; - t->Tok = Ord(kind = eot_tok); - t->TokInfo = TermError; - return l; - } - charp = TokImage; + charp = (unsigned char *)TokImage; quote = ch; len = 0; ch = getchrq(st); @@ -1931,7 +1895,6 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, break; } } else if (chtype(ch) == EF) { - Free(TokImage); mark_eof(st); t->Tok = Ord(kind = eot_tok); t->TokInfo = TermOutOfHeapError; @@ -1940,24 +1903,17 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, charp += put_utf8(charp, ch); ch = getchrq(st); } - if (charp > (unsigned char *)AuxSp - 1024) { - /* Not enough space to read in the string. */ - return AuxSpaceError( - t, l, "not enough space to read in string or quoted atom"); - } } len = charp - (unsigned char *)TokImage; - mp = Malloc(len + 1); + mp = malloc(len + 1); if (mp == NULL) { LOCAL_ErrorMessage = "not enough heap space to read in quasi quote"; - Yap_ReleasePreAllocCodeSpace((CODEADDR)TokImage); t->Tok = Ord(kind = eot_tok); t->TokInfo = TermOutOfHeapError; return l; } strncpy((char *)mp, (const char *)TokImage, len + 1); qq->text = (unsigned char *)mp; - Yap_ReleasePreAllocCodeSpace((CODEADDR)TokImage); if (st->status & Seekable_Stream_f) { qq->end.byteno = fseek(st->file, 0, 0); } else { From 73b6dd4faca8eca6e084365388c73c3a1031e3d4 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Sat, 20 Apr 2019 13:27:37 +0100 Subject: [PATCH 10/29] gecode 6.2 dbload --- C/dbload.c | 459 ++ packages/gecode/6.2.0/gecode-version.txt | 1 + .../6.2.0/gecode_yap_auto_generated.yap | 3906 +++++++++++ .../gecode_yap_cc_forward_auto_generated.icc | 28 + .../gecode_yap_cc_impl_auto_generated.icc | 5768 +++++++++++++++++ .../gecode_yap_cc_init_auto_generated.icc | 712 ++ 6 files changed, 10874 insertions(+) create mode 100644 C/dbload.c create mode 100644 packages/gecode/6.2.0/gecode-version.txt create mode 100644 packages/gecode/6.2.0/gecode_yap_auto_generated.yap create mode 100644 packages/gecode/6.2.0/gecode_yap_cc_forward_auto_generated.icc create mode 100644 packages/gecode/6.2.0/gecode_yap_cc_impl_auto_generated.icc create mode 100644 packages/gecode/6.2.0/gecode_yap_cc_init_auto_generated.icc diff --git a/C/dbload.c b/C/dbload.c new file mode 100644 index 000000000..c4a9273b2 --- /dev/null +++ b/C/dbload.c @@ -0,0 +1,459 @@ +/************************************************************************* + * * + * YAP Prolog * + * * + * Yap Prolog was developed at NCCUP - Universidade do Porto * + * * + * Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 * + * * + ************************************************************************** + * * + * File: cdmgr.c * + * comments: Code manager * + * * + * Last rev: $Date: 2008-07-22 23:34:44 $,$Author: vsc $ 8 + *************************************************************************/ + +#include "Yap.h" +#include "YapEval.h" +#include "clause.h" +#include "tracer.h" +#include "yapio.h" + +#include +#include +#include +#include + + + +#ifdef DEBUG +static UInt total_megaclause, total_released, nof_megaclauses; +#endif + +/****************************************************************** + + Mega Clauses + +******************************************************************/ + +#define OrArgAdjust(P) +#define TabEntryAdjust(P) +#define DoubleInCodeAdjust(D) +#define IntegerInCodeAdjust(D) +#define IntegerAdjust(D) (D) +#define PtoPredAdjust(X) (X) +#define PtoOpAdjust(X) (X) +#define PtoLUClauseAdjust(P) (P) +#define PtoLUIndexAdjust(P) (P) +#define XAdjust(X) (X) +#define YAdjust(X) (X) +#define AtomTermAdjust(X) (X) +#define CellPtoHeapAdjust(X) (X) +#define FuncAdjust(X) (X) +#define CodeAddrAdjust(X) (X) +#define CodeComposedTermAdjust(X) (X) +#define ConstantAdjust(X) (X) +#define ArityAdjust(X) (X) +#define OpcodeAdjust(X) (X) +#define ModuleAdjust(X) (X) +#define ExternalFunctionAdjust(X) (X) +#define AdjustSwitchTable(X, Y, Z) +#define DBGroundTermAdjust(X) (X) +#define rehash(A, B, C) + +static Term BlobTermInCodeAdjust(Term t) { + CACHE_REGS +#if TAGS_FAST_OPS + return t - LOCAL_ClDiff; +#else + return t + LOCAL_ClDiff; +#endif +} + +static Term ConstantTermAdjust(Term t) { + if (IsAtomTerm(t)) + return AtomTermAdjust(t); + return t; +} + +#include "rclause.h" + + +void Yap_BuildMegaClause(PredEntry *ap) { + CACHE_REGS + StaticClause *cl; + UInt sz; + MegaClause *mcl; + yamop *ptr; + size_t required; + UInt has_blobs = 0; + + if (ap->PredFlags & (DynamicPredFlag | LogUpdatePredFlag | MegaClausePredFlag +#ifdef TABLING + | TabledPredFlag +#endif /* TABLING */ + | UDIPredFlag) || + ap->cs.p_code.FirstClause == NULL || ap->cs.p_code.NOfClauses < 16) { + return; + } + cl = ClauseCodeToStaticClause(ap->cs.p_code.FirstClause); + sz = cl->ClSize; + while (TRUE) { + if (!(cl->ClFlags & FactMask)) + return; /* no mega clause, sorry */ + if (cl->ClSize != sz) + return; /* no mega clause, sorry */ + if (cl->ClCode == ap->cs.p_code.LastClause) + break; + has_blobs |= (cl->ClFlags & HasBlobsMask); + cl = cl->ClNext; + } + /* ok, we got the chance for a mega clause */ + if (has_blobs) { + sz -= sizeof(StaticClause); + } else { + sz -= (UInt)NEXTOP((yamop *)NULL, p) + sizeof(StaticClause); + } + required = sz * ap->cs.p_code.NOfClauses + sizeof(MegaClause) + + (UInt)NEXTOP((yamop *)NULL, l); + while (!(mcl = (MegaClause *)Yap_AllocCodeSpace(required))) { + if (!Yap_growheap(FALSE, required, NULL)) { + /* just fail, the system will keep on going */ + return; + } + } +#ifdef DEBUG + total_megaclause += required; + cl = ClauseCodeToStaticClause(ap->cs.p_code.FirstClause); + total_released += ap->cs.p_code.NOfClauses * cl->ClSize; + nof_megaclauses++; +#endif + Yap_ClauseSpace += required; + /* cool, it's our turn to do the conversion */ + mcl->ClFlags = MegaMask | has_blobs; + mcl->ClSize = required; + mcl->ClPred = ap; + mcl->ClItemSize = sz; + mcl->ClNext = NULL; + cl = ClauseCodeToStaticClause(ap->cs.p_code.FirstClause); + mcl->ClLine = cl->usc.ClLine; + ptr = mcl->ClCode; + while (TRUE) { + memmove((void *)ptr, (void *)cl->ClCode, sz); + if (has_blobs) { + LOCAL_ClDiff = (char *)(ptr) - (char *)cl->ClCode; + restore_opcodes(ptr, NULL PASS_REGS); + } + ptr = (yamop *)((char *)ptr + sz); + if (cl->ClCode == ap->cs.p_code.LastClause) + break; + cl = cl->ClNext; + } + ptr->opc = Yap_opcode(_Ystop); + cl = ClauseCodeToStaticClause(ap->cs.p_code.FirstClause); + /* recover the space spent on the original clauses */ + while (TRUE) { + StaticClause *ncl, *curcl = cl; + + ncl = cl->ClNext; + Yap_InformOfRemoval(cl); + Yap_ClauseSpace -= cl->ClSize; + Yap_FreeCodeSpace((ADDR)cl); + if (curcl->ClCode == ap->cs.p_code.LastClause) + break; + cl = ncl; + } + ap->cs.p_code.FirstClause = ap->cs.p_code.LastClause = mcl->ClCode; + ap->PredFlags |= MegaClausePredFlag; + Yap_inform_profiler_of_clause(mcl, (char *)mcl + required, ap, GPROF_MEGA); +} + +void Yap_split_megaclause(PredEntry *ap) { + StaticClause *start = NULL, *prev = NULL; + MegaClause *mcl; + yamop *ptr; + UInt ncls = ap->cs.p_code.NOfClauses, i; + + mcl = ClauseCodeToMegaClause(ap->cs.p_code.FirstClause); + if (mcl->ClFlags & ExoMask) { + Yap_Error(PERMISSION_ERROR_MODIFY_STATIC_PROCEDURE, Yap_PredicateToIndicator(ap), + "while deleting clause from exo predicate %s/%d\n", + RepAtom(NameOfFunctor(ap->FunctorOfPred))->StrOfAE, + ap->ArityOfPE); + return; + } + for (i = 0, ptr = mcl->ClCode; i < ncls; i++) { + StaticClause *new = (StaticClause *)Yap_AllocCodeSpace( + sizeof(StaticClause) + mcl->ClItemSize + + (UInt)NEXTOP((yamop *)NULL, p)); + if (new == NULL) { + if (!Yap_growheap(FALSE, + (sizeof(StaticClause) + mcl->ClItemSize) * (ncls - i), + NULL)) { + while (start) { + StaticClause *cl = start; + start = cl->ClNext; + Yap_InformOfRemoval(cl); + Yap_ClauseSpace -= cl->ClSize; + Yap_FreeCodeSpace((char *)cl); + } + if (ap->ArityOfPE) { + Yap_Error(RESOURCE_ERROR_HEAP, TermNil, + "while breaking up mega clause for %s/%d\n", + RepAtom(NameOfFunctor(ap->FunctorOfPred))->StrOfAE, + ap->ArityOfPE); + } else { + Yap_Error(RESOURCE_ERROR_HEAP, TermNil, + "while breaking up mega clause for %s\n", + RepAtom((Atom)ap->FunctorOfPred)->StrOfAE); + } + return; + } + break; + } + Yap_ClauseSpace += + sizeof(StaticClause) + mcl->ClItemSize + (UInt)NEXTOP((yamop *)NULL, p); + new->ClFlags = StaticMask | FactMask; + new->ClSize = mcl->ClItemSize; + new->usc.ClLine = Yap_source_line_no(); + new->ClNext = NULL; + memmove((void *)new->ClCode, (void *)ptr, mcl->ClItemSize); + if (prev) { + prev->ClNext = new; + } else { + start = new; + } + ptr = (yamop *)((char *)ptr + mcl->ClItemSize); + prev = new; + } + ap->PredFlags &= ~MegaClausePredFlag; + ap->cs.p_code.FirstClause = start->ClCode; + ap->cs.p_code.LastClause = prev->ClCode; +} + + +static UInt compute_dbcl_size(arity_t arity) { + UInt sz; + switch (arity) { + case 2: + sz = (UInt)NEXTOP((yamop *)NULL, cc); + break; + case 3: + sz = (UInt)NEXTOP((yamop *)NULL, ccc); + break; + case 4: + sz = (UInt)NEXTOP((yamop *)NULL, cccc); + break; + case 5: + sz = (UInt)NEXTOP((yamop *)NULL, ccccc); + break; + case 6: + sz = (UInt)NEXTOP((yamop *)NULL, cccccc); + break; + default: + sz = arity * (UInt)NEXTOP((yamop *)NULL, xc); + break; + } + return (UInt)NEXTOP((yamop *)sz, p); +} + +#define DerefAndCheck(t, V) \ + t = Deref(V); \ + if (IsVarTerm(t) || !(IsAtomOrIntTerm(t))) \ + Yap_Error(TYPE_ERROR_ATOM, t0, "load_db"); + +static int store_dbcl_size(yamop *pc, arity_t arity, Term t0, PredEntry *pe) { + Term t; + CELL *tp = RepAppl(t0) + 1; + switch (arity) { + case 2: + pc->opc = Yap_opcode(_get_2atoms); + DerefAndCheck(t, tp[0]); + pc->y_u.cc.c1 = t; + DerefAndCheck(t, tp[1]); + pc->y_u.cc.c2 = t; + pc = NEXTOP(pc, cc); + break; + case 3: + pc->opc = Yap_opcode(_get_3atoms); + DerefAndCheck(t, tp[0]); + pc->y_u.ccc.c1 = t; + DerefAndCheck(t, tp[1]); + pc->y_u.ccc.c2 = t; + DerefAndCheck(t, tp[2]); + pc->y_u.ccc.c3 = t; + pc = NEXTOP(pc, ccc); + break; + case 4: + pc->opc = Yap_opcode(_get_4atoms); + DerefAndCheck(t, tp[0]); + pc->y_u.cccc.c1 = t; + DerefAndCheck(t, tp[1]); + pc->y_u.cccc.c2 = t; + DerefAndCheck(t, tp[2]); + pc->y_u.cccc.c3 = t; + DerefAndCheck(t, tp[3]); + pc->y_u.cccc.c4 = t; + pc = NEXTOP(pc, cccc); + break; + case 5: + pc->opc = Yap_opcode(_get_5atoms); + DerefAndCheck(t, tp[0]); + pc->y_u.ccccc.c1 = t; + DerefAndCheck(t, tp[1]); + pc->y_u.ccccc.c2 = t; + DerefAndCheck(t, tp[2]); + pc->y_u.ccccc.c3 = t; + DerefAndCheck(t, tp[3]); + pc->y_u.ccccc.c4 = t; + DerefAndCheck(t, tp[4]); + pc->y_u.ccccc.c5 = t; + pc = NEXTOP(pc, ccccc); + break; + case 6: + pc->opc = Yap_opcode(_get_6atoms); + DerefAndCheck(t, tp[0]); + pc->y_u.cccccc.c1 = t; + DerefAndCheck(t, tp[1]); + pc->y_u.cccccc.c2 = t; + DerefAndCheck(t, tp[2]); + pc->y_u.cccccc.c3 = t; + DerefAndCheck(t, tp[3]); + pc->y_u.cccccc.c4 = t; + DerefAndCheck(t, tp[4]); + pc->y_u.cccccc.c5 = t; + DerefAndCheck(t, tp[5]); + pc->y_u.cccccc.c6 = t; + pc = NEXTOP(pc, cccccc); + break; + default: { + arity_t i; + for (i = 0; i < arity; i++) { + pc->opc = Yap_opcode(_get_atom); +#if PRECOMPUTE_REGADDRESS + pc->y_u.xc.x = (CELL)(XREGS + (i + 1)); +#else + pc->y_u.xc.x = i + 1; +#endif + DerefAndCheck(t, tp[0]); + pc->y_u.xc.c = t; + tp++; + pc = NEXTOP(pc, xc); + } + } break; + } + pc->opc = Yap_opcode(_procceed); + pc->y_u.p.p = pe; + return TRUE; +} + +static Int + p_dbload_get_space(USES_REGS1) { /* '$number_of_clauses'(Predicate,M,N) */ + Term t = Deref(ARG1); + Term mod = Deref(ARG2); + Term tn = Deref(ARG3); + arity_t arity; + Prop pe; + PredEntry *ap; + UInt sz; + MegaClause *mcl; + yamop *ptr; + UInt ncls; + UInt required; + + if (IsVarTerm(mod) || !IsAtomTerm(mod)) { + return (FALSE); + } + if (IsAtomTerm(t)) { + Atom a = AtomOfTerm(t); + arity = 0; + pe = PredPropByAtom(a, mod); + } else if (IsApplTerm(t)) { + register Functor f = FunctorOfTerm(t); + arity = ArityOfFunctor(f); + pe = PredPropByFunc(f, mod); + } else { + return FALSE; + } + if (EndOfPAEntr(pe)) + return FALSE; + ap = RepPredProp(pe); + if (ap->PredFlags & (DynamicPredFlag | LogUpdatePredFlag +#ifdef TABLING + | TabledPredFlag +#endif /* TABLING */ + )) { + Yap_Error(PERMISSION_ERROR_MODIFY_STATIC_PROCEDURE, Yap_PredicateToIndicator(ap), + "dbload_get_space/4"); + return FALSE; + } + if (IsVarTerm(tn) || !IsIntegerTerm(tn)) { + return FALSE; + } + ncls = IntegerOfTerm(tn); + if (ncls <= 1) { + return FALSE; + } + + sz = compute_dbcl_size(arity); + required = sz * ncls + sizeof(MegaClause) + (UInt)NEXTOP((yamop *)NULL, l); +#ifdef DEBUG + total_megaclause += required; + nof_megaclauses++; +#endif + while (!(mcl = (MegaClause *)Yap_AllocCodeSpace(required))) { + if (!Yap_growheap(FALSE, required, NULL)) { + /* just fail, the system will keep on going */ + return FALSE; + } + } + Yap_ClauseSpace += required; + /* cool, it's our turn to do the conversion */ + mcl->ClFlags = MegaMask; + mcl->ClSize = sz * ncls; + mcl->ClPred = ap; + mcl->ClItemSize = sz; + mcl->ClNext = NULL; + ap->cs.p_code.FirstClause = ap->cs.p_code.LastClause = mcl->ClCode; + ap->PredFlags |= (MegaClausePredFlag); + ap->cs.p_code.NOfClauses = ncls; + if (ap->PredFlags & (SpiedPredFlag | CountPredFlag | ProfiledPredFlag)) { + ap->OpcodeOfPred = Yap_opcode(_spy_pred); + } else { + ap->OpcodeOfPred = INDEX_OPCODE; + } + ap->CodeOfPred = ap->cs.p_code.TrueCodeOfPred = + (yamop *)(&(ap->OpcodeOfPred)); + ptr = (yamop *)((ADDR)mcl->ClCode + ncls * sz); + ptr->opc = Yap_opcode(_Ystop); + return Yap_unify(ARG4, MkIntegerTerm((Int)mcl)); +} + +static Int p_dbassert(USES_REGS1) { /* '$number_of_clauses'(Predicate,M,N) */ + Term thandle = Deref(ARG2); + Term tn = Deref(ARG3); + PredEntry *pe; + MegaClause *mcl; + Int n; + + if (IsVarTerm(thandle) || !IsIntegerTerm(thandle)) { + return FALSE; + } + mcl = (MegaClause *)IntegerOfTerm(thandle); + if (IsVarTerm(tn) || !IsIntegerTerm(tn)) { + return FALSE; + } + n = IntegerOfTerm(tn); + pe = mcl->ClPred; + return store_dbcl_size((yamop *)((ADDR)mcl->ClCode + n * (mcl->ClItemSize)), + pe->ArityOfPE, Deref(ARG1), pe); +} + +void Yap_InitDBLoadPreds(void) { + CACHE_REGS + //CurrentModule = DBLOAD_MODULE; + Yap_InitCPred("$dbload_get_space", 4, p_dbload_get_space, 0L); + Yap_InitCPred("$dbassert", 3, p_dbassert, 0L); + //CurrentModule = cm; +} diff --git a/packages/gecode/6.2.0/gecode-version.txt b/packages/gecode/6.2.0/gecode-version.txt new file mode 100644 index 000000000..6abaeb2f9 --- /dev/null +++ b/packages/gecode/6.2.0/gecode-version.txt @@ -0,0 +1 @@ +6.2.0 diff --git a/packages/gecode/6.2.0/gecode_yap_auto_generated.yap b/packages/gecode/6.2.0/gecode_yap_auto_generated.yap new file mode 100644 index 000000000..f56328b54 --- /dev/null +++ b/packages/gecode/6.2.0/gecode_yap_auto_generated.yap @@ -0,0 +1,3906 @@ +%% -*- prolog -*- +%%============================================================================= +%% Copyright (C) 2011 by Denys Duchier +%% +%% This program is free software: you can redistribute it and/or modify it +%% under the terms of the GNU Lesser General Public License as published by the +%% Free Software Foundation, either version 3 of the License, or (at your +%% option) any later version. +%% +%% This program is distributed in the hope that it will be useful, but WITHOUT +%% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +%% FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +%% more details. +%% +%% You should have received a copy of the GNU Lesser General Public License +%% along with this program. If not, see . +%%============================================================================= + +is_RestartMode_('RM_NONE'). +is_RestartMode_('RM_CONSTANT'). +is_RestartMode_('RM_LINEAR'). +is_RestartMode_('RM_LUBY'). +is_RestartMode_('RM_GEOMETRIC'). + + +is_RestartMode_('RM_NONE','RM_NONE'). +is_RestartMode_('RM_CONSTANT','RM_CONSTANT'). +is_RestartMode_('RM_LINEAR','RM_LINEAR'). +is_RestartMode_('RM_LUBY','RM_LUBY'). +is_RestartMode_('RM_GEOMETRIC','RM_GEOMETRIC'). + + +is_RestartMode(X,Y) :- nonvar(X), is_RestartMode_(X,Y). +is_RestartMode(X) :- is_RestartMode_(X,_). + + +is_FloatRelType_('FRT_EQ'). +is_FloatRelType_('FRT_NQ'). +is_FloatRelType_('FRT_LQ'). +is_FloatRelType_('FRT_LE'). +is_FloatRelType_('FRT_GQ'). +is_FloatRelType_('FRT_GR'). + + +is_FloatRelType_('FRT_EQ','FRT_EQ'). +is_FloatRelType_('FRT_NQ','FRT_NQ'). +is_FloatRelType_('FRT_LQ','FRT_LQ'). +is_FloatRelType_('FRT_LE','FRT_LE'). +is_FloatRelType_('FRT_GQ','FRT_GQ'). +is_FloatRelType_('FRT_GR','FRT_GR'). + + +is_FloatRelType(X,Y) :- nonvar(X), is_FloatRelType_(X,Y). +is_FloatRelType(X) :- is_FloatRelType_(X,_). + + +is_ReifyMode_('RM_EQV'). +is_ReifyMode_('RM_IMP'). +is_ReifyMode_('RM_PMI'). + + +is_ReifyMode_('RM_EQV','RM_EQV'). +is_ReifyMode_('RM_IMP','RM_IMP'). +is_ReifyMode_('RM_PMI','RM_PMI'). + + +is_ReifyMode(X,Y) :- nonvar(X), is_ReifyMode_(X,Y). +is_ReifyMode(X) :- is_ReifyMode_(X,_). + + +is_IntRelType_('IRT_EQ'). +is_IntRelType_('IRT_NQ'). +is_IntRelType_('IRT_LQ'). +is_IntRelType_('IRT_LE'). +is_IntRelType_('IRT_GQ'). +is_IntRelType_('IRT_GR'). + + +is_IntRelType_('IRT_EQ','IRT_EQ'). +is_IntRelType_('IRT_NQ','IRT_NQ'). +is_IntRelType_('IRT_LQ','IRT_LQ'). +is_IntRelType_('IRT_LE','IRT_LE'). +is_IntRelType_('IRT_GQ','IRT_GQ'). +is_IntRelType_('IRT_GR','IRT_GR'). + + +is_IntRelType(X,Y) :- nonvar(X), is_IntRelType_(X,Y). +is_IntRelType(X) :- is_IntRelType_(X,_). + + +is_BoolOpType_('BOT_AND'). +is_BoolOpType_('BOT_OR'). +is_BoolOpType_('BOT_IMP'). +is_BoolOpType_('BOT_EQV'). +is_BoolOpType_('BOT_XOR'). + + +is_BoolOpType_('BOT_AND','BOT_AND'). +is_BoolOpType_('BOT_OR','BOT_OR'). +is_BoolOpType_('BOT_IMP','BOT_IMP'). +is_BoolOpType_('BOT_EQV','BOT_EQV'). +is_BoolOpType_('BOT_XOR','BOT_XOR'). + + +is_BoolOpType(X,Y) :- nonvar(X), is_BoolOpType_(X,Y). +is_BoolOpType(X) :- is_BoolOpType_(X,_). + + +is_IntPropLevel_('IPL_DEF'). +is_IntPropLevel_('IPL_VAL'). +is_IntPropLevel_('IPL_BND'). +is_IntPropLevel_('IPL_DOM'). +is_IntPropLevel_('IPL_BASIC'). +is_IntPropLevel_('IPL_ADVANCED'). +is_IntPropLevel_('IPL_BASIC_ADVANCED'). +is_IntPropLevel_('_IPL_BITS'). + + +is_IntPropLevel_('IPL_DEF','IPL_DEF'). +is_IntPropLevel_('IPL_VAL','IPL_VAL'). +is_IntPropLevel_('IPL_BND','IPL_BND'). +is_IntPropLevel_('IPL_DOM','IPL_DOM'). +is_IntPropLevel_('IPL_BASIC','IPL_BASIC'). +is_IntPropLevel_('IPL_ADVANCED','IPL_ADVANCED'). +is_IntPropLevel_('IPL_BASIC_ADVANCED','IPL_BASIC_ADVANCED'). +is_IntPropLevel_('_IPL_BITS','_IPL_BITS'). + + +is_IntPropLevel(X,Y) :- nonvar(X), is_IntPropLevel_(X,Y). +is_IntPropLevel(X) :- is_IntPropLevel_(X,_). + + +is_TaskType_('TT_FIXP'). +is_TaskType_('TT_FIXS'). +is_TaskType_('TT_FIXE'). + + +is_TaskType_('TT_FIXP','TT_FIXP'). +is_TaskType_('TT_FIXS','TT_FIXS'). +is_TaskType_('TT_FIXE','TT_FIXE'). + + +is_TaskType(X,Y) :- nonvar(X), is_TaskType_(X,Y). +is_TaskType(X) :- is_TaskType_(X,_). + + +is_TraceEvent_('TE_INIT'). +is_TraceEvent_('TE_PRUNE'). +is_TraceEvent_('TE_FIX'). +is_TraceEvent_('TE_FAIL'). +is_TraceEvent_('TE_DONE'). +is_TraceEvent_('TE_PROPAGATE'). +is_TraceEvent_('TE_COMMIT'). +is_TraceEvent_('TE_POST'). + + +is_TraceEvent_('TE_INIT','TE_INIT'). +is_TraceEvent_('TE_PRUNE','TE_PRUNE'). +is_TraceEvent_('TE_FIX','TE_FIX'). +is_TraceEvent_('TE_FAIL','TE_FAIL'). +is_TraceEvent_('TE_DONE','TE_DONE'). +is_TraceEvent_('TE_PROPAGATE','TE_PROPAGATE'). +is_TraceEvent_('TE_COMMIT','TE_COMMIT'). +is_TraceEvent_('TE_POST','TE_POST'). + + +is_TraceEvent(X,Y) :- nonvar(X), is_TraceEvent_(X,Y). +is_TraceEvent(X) :- is_TraceEvent_(X,_). + + +is_SetRelType_('SRT_EQ'). +is_SetRelType_('SRT_NQ'). +is_SetRelType_('SRT_SUB'). +is_SetRelType_('SRT_SUP'). +is_SetRelType_('SRT_DISJ'). +is_SetRelType_('SRT_CMPL'). +is_SetRelType_('SRT_LQ'). +is_SetRelType_('SRT_LE'). +is_SetRelType_('SRT_GQ'). +is_SetRelType_('SRT_GR'). + + +is_SetRelType_('SRT_EQ','SRT_EQ'). +is_SetRelType_('SRT_NQ','SRT_NQ'). +is_SetRelType_('SRT_SUB','SRT_SUB'). +is_SetRelType_('SRT_SUP','SRT_SUP'). +is_SetRelType_('SRT_DISJ','SRT_DISJ'). +is_SetRelType_('SRT_CMPL','SRT_CMPL'). +is_SetRelType_('SRT_LQ','SRT_LQ'). +is_SetRelType_('SRT_LE','SRT_LE'). +is_SetRelType_('SRT_GQ','SRT_GQ'). +is_SetRelType_('SRT_GR','SRT_GR'). + + +is_SetRelType(X,Y) :- nonvar(X), is_SetRelType_(X,Y). +is_SetRelType(X) :- is_SetRelType_(X,_). + + +is_SetOpType_('SOT_UNION'). +is_SetOpType_('SOT_DUNION'). +is_SetOpType_('SOT_INTER'). +is_SetOpType_('SOT_MINUS'). + + +is_SetOpType_('SOT_UNION','SOT_UNION'). +is_SetOpType_('SOT_DUNION','SOT_DUNION'). +is_SetOpType_('SOT_INTER','SOT_INTER'). +is_SetOpType_('SOT_MINUS','SOT_MINUS'). + + +is_SetOpType(X,Y) :- nonvar(X), is_SetOpType_(X,Y). +is_SetOpType(X) :- is_SetOpType_(X,_). + + +branch(X0,X1) :- + (is_Space_or_Clause(X0,Y0) + -> (is_std_function(X1,Y1) + -> gecode_constraint_branch_1(Y0,Y1) + ; throw(error(type_error('std::function'(X1)),gecode_argument_error(branch(X0,X1),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(branch(X0,X1),arg=1)))). + +convex(X0,X1) :- + (is_Space_or_Clause(X0,Y0) + -> (is_SetVar(X1,Y1) + -> gecode_constraint_convex_2(Y0,Y1) + ; throw(error(type_error('SetVar'(X1)),gecode_argument_error(convex(X0,X1),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(convex(X0,X1),arg=1)))). + +convex(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_SetVar(X1,Y1) + -> (is_SetVar(X2,Y2) + -> gecode_constraint_convex_3(Y0,Y1,Y2) + ; throw(error(type_error('SetVar'(X2)),gecode_argument_error(convex(X0,X1,X2),arg=3)))) + ; throw(error(type_error('SetVar'(X1)),gecode_argument_error(convex(X0,X1,X2),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(convex(X0,X1,X2),arg=1)))). + +abs(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_FloatVar(X1,Y1) + -> (is_FloatVar(X2,Y2) + -> gecode_constraint_abs_4(Y0,Y1,Y2) + ; throw(error(type_error('FloatVar'(X2)),gecode_argument_error(abs(X0,X1,X2),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> gecode_constraint_abs_5(Y0,Y1,Y2) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(abs(X0,X1,X2),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(abs(X0,X1,X2),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(abs(X0,X1,X2),arg=1)))). + +abs(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_abs_6(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(abs(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(abs(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(abs(X0,X1,X2,X3),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(abs(X0,X1,X2,X3),arg=1)))). + +argmax(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_argmax_7(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(argmax(X0,X1,X2,X3),arg=4)))) + ; (is_IntVar(X2,Y2) + -> (is_bool(X3,Y3) + -> gecode_constraint_argmax_11(Y0,Y1,Y2,Y3) + ; throw(error(type_error(bool(X3)),gecode_argument_error(argmax(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(argmax(X0,X1,X2,X3),arg=3))))) + ; (is_IntVarArgs(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_argmax_13(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(argmax(X0,X1,X2,X3),arg=4)))) + ; (is_IntVar(X2,Y2) + -> (is_bool(X3,Y3) + -> gecode_constraint_argmax_17(Y0,Y1,Y2,Y3) + ; throw(error(type_error(bool(X3)),gecode_argument_error(argmax(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(argmax(X0,X1,X2,X3),arg=3))))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(argmax(X0,X1,X2,X3),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(argmax(X0,X1,X2,X3),arg=1)))). + +argmax(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_bool(X4,Y4) + -> gecode_constraint_argmax_8(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error(bool(X4)),gecode_argument_error(argmax(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(argmax(X0,X1,X2,X3,X4),arg=4)))) + ; (is_IntVar(X2,Y2) + -> (is_bool(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_argmax_12(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(argmax(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error(bool(X3)),gecode_argument_error(argmax(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(argmax(X0,X1,X2,X3,X4),arg=3))))) + ; (is_IntVarArgs(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_bool(X4,Y4) + -> gecode_constraint_argmax_14(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error(bool(X4)),gecode_argument_error(argmax(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(argmax(X0,X1,X2,X3,X4),arg=4)))) + ; (is_IntVar(X2,Y2) + -> (is_bool(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_argmax_18(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(argmax(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error(bool(X3)),gecode_argument_error(argmax(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(argmax(X0,X1,X2,X3,X4),arg=3))))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(argmax(X0,X1,X2,X3,X4),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(argmax(X0,X1,X2,X3,X4),arg=1)))). + +argmax(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_bool(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_argmax_9(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(argmax(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error(bool(X4)),gecode_argument_error(argmax(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(argmax(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(argmax(X0,X1,X2,X3,X4,X5),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_bool(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_argmax_15(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(argmax(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error(bool(X4)),gecode_argument_error(argmax(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(argmax(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(argmax(X0,X1,X2,X3,X4,X5),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(argmax(X0,X1,X2,X3,X4,X5),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(argmax(X0,X1,X2,X3,X4,X5),arg=1)))). + +argmax(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> gecode_constraint_argmax_10(Y0,Y1,Y2) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(argmax(X0,X1,X2),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> gecode_constraint_argmax_16(Y0,Y1,Y2) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(argmax(X0,X1,X2),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(argmax(X0,X1,X2),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(argmax(X0,X1,X2),arg=1)))). + +argmin(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_argmin_19(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(argmin(X0,X1,X2,X3),arg=4)))) + ; (is_IntVar(X2,Y2) + -> (is_bool(X3,Y3) + -> gecode_constraint_argmin_23(Y0,Y1,Y2,Y3) + ; throw(error(type_error(bool(X3)),gecode_argument_error(argmin(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(argmin(X0,X1,X2,X3),arg=3))))) + ; (is_IntVarArgs(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_argmin_25(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(argmin(X0,X1,X2,X3),arg=4)))) + ; (is_IntVar(X2,Y2) + -> (is_bool(X3,Y3) + -> gecode_constraint_argmin_29(Y0,Y1,Y2,Y3) + ; throw(error(type_error(bool(X3)),gecode_argument_error(argmin(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(argmin(X0,X1,X2,X3),arg=3))))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(argmin(X0,X1,X2,X3),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(argmin(X0,X1,X2,X3),arg=1)))). + +argmin(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_bool(X4,Y4) + -> gecode_constraint_argmin_20(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error(bool(X4)),gecode_argument_error(argmin(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(argmin(X0,X1,X2,X3,X4),arg=4)))) + ; (is_IntVar(X2,Y2) + -> (is_bool(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_argmin_24(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(argmin(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error(bool(X3)),gecode_argument_error(argmin(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(argmin(X0,X1,X2,X3,X4),arg=3))))) + ; (is_IntVarArgs(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_bool(X4,Y4) + -> gecode_constraint_argmin_26(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error(bool(X4)),gecode_argument_error(argmin(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(argmin(X0,X1,X2,X3,X4),arg=4)))) + ; (is_IntVar(X2,Y2) + -> (is_bool(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_argmin_30(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(argmin(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error(bool(X3)),gecode_argument_error(argmin(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(argmin(X0,X1,X2,X3,X4),arg=3))))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(argmin(X0,X1,X2,X3,X4),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(argmin(X0,X1,X2,X3,X4),arg=1)))). + +argmin(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_bool(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_argmin_21(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(argmin(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error(bool(X4)),gecode_argument_error(argmin(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(argmin(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(argmin(X0,X1,X2,X3,X4,X5),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_bool(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_argmin_27(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(argmin(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error(bool(X4)),gecode_argument_error(argmin(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(argmin(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(argmin(X0,X1,X2,X3,X4,X5),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(argmin(X0,X1,X2,X3,X4,X5),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(argmin(X0,X1,X2,X3,X4,X5),arg=1)))). + +argmin(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> gecode_constraint_argmin_22(Y0,Y1,Y2) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(argmin(X0,X1,X2),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> gecode_constraint_argmin_28(Y0,Y1,Y2) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(argmin(X0,X1,X2),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(argmin(X0,X1,X2),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(argmin(X0,X1,X2),arg=1)))). + +assign(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVar(X1,Y1) + -> (is_BoolAssign(X2,Y2) + -> gecode_constraint_assign_31(Y0,Y1,Y2) + ; throw(error(type_error('BoolAssign'(X2)),gecode_argument_error(assign(X0,X1,X2),arg=3)))) + ; (is_FloatVar(X1,Y1) + -> (is_FloatAssign(X2,Y2) + -> gecode_constraint_assign_57(Y0,Y1,Y2) + ; throw(error(type_error('FloatAssign'(X2)),gecode_argument_error(assign(X0,X1,X2),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_IntAssign(X2,Y2) + -> gecode_constraint_assign_59(Y0,Y1,Y2) + ; throw(error(type_error('IntAssign'(X2)),gecode_argument_error(assign(X0,X1,X2),arg=3)))) + ; (is_SetVar(X1,Y1) + -> (is_SetAssign(X2,Y2) + -> gecode_constraint_assign_61(Y0,Y1,Y2) + ; throw(error(type_error('SetAssign'(X2)),gecode_argument_error(assign(X0,X1,X2),arg=3)))) + ; throw(error(type_error('SetVar'(X1)),gecode_argument_error(assign(X0,X1,X2),arg=2))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(assign(X0,X1,X2),arg=1)))). + +assign(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVar(X1,Y1) + -> (is_BoolAssign(X2,Y2) + -> (is_BoolVarValPrint(X3,Y3) + -> gecode_constraint_assign_32(Y0,Y1,Y2,Y3) + ; throw(error(type_error('BoolVarValPrint'(X3)),gecode_argument_error(assign(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('BoolAssign'(X2)),gecode_argument_error(assign(X0,X1,X2,X3),arg=3)))) + ; (is_BoolVarArgs(X1,Y1) + -> (is_BoolVarBranch(X2,Y2) + -> (is_BoolAssign(X3,Y3) + -> gecode_constraint_assign_33(Y0,Y1,Y2,Y3) + ; throw(error(type_error('BoolAssign'(X3)),gecode_argument_error(assign(X0,X1,X2,X3),arg=4)))) + ; (is_BoolVarBranch(X2,Y2) + -> (is_BoolAssign(X3,Y3) + -> gecode_constraint_assign_36(Y0,Y1,Y2,Y3) + ; throw(error(type_error('BoolAssign'(X3)),gecode_argument_error(assign(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(assign(X0,X1,X2,X3),arg=3))))) + ; (is_FloatVarArgs(X1,Y1) + -> (is_FloatVarBranch(X2,Y2) + -> (is_FloatAssign(X3,Y3) + -> gecode_constraint_assign_39(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatAssign'(X3)),gecode_argument_error(assign(X0,X1,X2,X3),arg=4)))) + ; (is_FloatVarBranch(X2,Y2) + -> (is_FloatAssign(X3,Y3) + -> gecode_constraint_assign_42(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatAssign'(X3)),gecode_argument_error(assign(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(assign(X0,X1,X2,X3),arg=3))))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVarBranch(X2,Y2) + -> (is_IntAssign(X3,Y3) + -> gecode_constraint_assign_45(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntAssign'(X3)),gecode_argument_error(assign(X0,X1,X2,X3),arg=4)))) + ; (is_IntVarBranch(X2,Y2) + -> (is_IntAssign(X3,Y3) + -> gecode_constraint_assign_48(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntAssign'(X3)),gecode_argument_error(assign(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(assign(X0,X1,X2,X3),arg=3))))) + ; (is_SetVarArgs(X1,Y1) + -> (is_SetVarBranch(X2,Y2) + -> (is_SetAssign(X3,Y3) + -> gecode_constraint_assign_51(Y0,Y1,Y2,Y3) + ; throw(error(type_error('SetAssign'(X3)),gecode_argument_error(assign(X0,X1,X2,X3),arg=4)))) + ; (is_SetVarBranch(X2,Y2) + -> (is_SetAssign(X3,Y3) + -> gecode_constraint_assign_54(Y0,Y1,Y2,Y3) + ; throw(error(type_error('SetAssign'(X3)),gecode_argument_error(assign(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(assign(X0,X1,X2,X3),arg=3))))) + ; (is_FloatVar(X1,Y1) + -> (is_FloatAssign(X2,Y2) + -> (is_FloatVarValPrint(X3,Y3) + -> gecode_constraint_assign_58(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatVarValPrint'(X3)),gecode_argument_error(assign(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('FloatAssign'(X2)),gecode_argument_error(assign(X0,X1,X2,X3),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_IntAssign(X2,Y2) + -> (is_IntVarValPrint(X3,Y3) + -> gecode_constraint_assign_60(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVarValPrint'(X3)),gecode_argument_error(assign(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntAssign'(X2)),gecode_argument_error(assign(X0,X1,X2,X3),arg=3)))) + ; (is_SetVar(X1,Y1) + -> (is_SetAssign(X2,Y2) + -> (is_SetVarValPrint(X3,Y3) + -> gecode_constraint_assign_62(Y0,Y1,Y2,Y3) + ; throw(error(type_error('SetVarValPrint'(X3)),gecode_argument_error(assign(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('SetAssign'(X2)),gecode_argument_error(assign(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('SetVar'(X1)),gecode_argument_error(assign(X0,X1,X2,X3),arg=2))))))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(assign(X0,X1,X2,X3),arg=1)))). + +assign(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_BoolVarBranch(X2,Y2) + -> (is_BoolAssign(X3,Y3) + -> (is_BoolBranchFilter(X4,Y4) + -> gecode_constraint_assign_34(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('BoolBranchFilter'(X4)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('BoolAssign'(X3)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=4)))) + ; (is_BoolVarBranch(X2,Y2) + -> (is_BoolAssign(X3,Y3) + -> (is_IntBranchFilter(X4,Y4) + -> gecode_constraint_assign_37(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntBranchFilter'(X4)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('BoolAssign'(X3)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=3))))) + ; (is_FloatVarArgs(X1,Y1) + -> (is_FloatVarBranch(X2,Y2) + -> (is_FloatAssign(X3,Y3) + -> (is_FloatBranchFilter(X4,Y4) + -> gecode_constraint_assign_40(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('FloatBranchFilter'(X4)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('FloatAssign'(X3)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=4)))) + ; (is_FloatVarBranch(X2,Y2) + -> (is_FloatAssign(X3,Y3) + -> (is_FloatBranchFilter(X4,Y4) + -> gecode_constraint_assign_43(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('FloatBranchFilter'(X4)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('FloatAssign'(X3)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=3))))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVarBranch(X2,Y2) + -> (is_IntAssign(X3,Y3) + -> (is_IntBranchFilter(X4,Y4) + -> gecode_constraint_assign_46(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntBranchFilter'(X4)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntAssign'(X3)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=4)))) + ; (is_IntVarBranch(X2,Y2) + -> (is_IntAssign(X3,Y3) + -> (is_IntBranchFilter(X4,Y4) + -> gecode_constraint_assign_49(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntBranchFilter'(X4)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntAssign'(X3)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=3))))) + ; (is_SetVarArgs(X1,Y1) + -> (is_SetVarBranch(X2,Y2) + -> (is_SetAssign(X3,Y3) + -> (is_SetBranchFilter(X4,Y4) + -> gecode_constraint_assign_52(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('SetBranchFilter'(X4)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('SetAssign'(X3)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=4)))) + ; (is_SetVarBranch(X2,Y2) + -> (is_SetAssign(X3,Y3) + -> (is_SetBranchFilter(X4,Y4) + -> gecode_constraint_assign_55(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('SetBranchFilter'(X4)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('SetAssign'(X3)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=3))))) + ; throw(error(type_error('SetVarArgs'(X1)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=2))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(assign(X0,X1,X2,X3,X4),arg=1)))). + +assign(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_BoolVarBranch(X2,Y2) + -> (is_BoolAssign(X3,Y3) + -> (is_BoolBranchFilter(X4,Y4) + -> (is_BoolVarValPrint(X5,Y5) + -> gecode_constraint_assign_35(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('BoolVarValPrint'(X5)),gecode_argument_error(assign(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('BoolBranchFilter'(X4)),gecode_argument_error(assign(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('BoolAssign'(X3)),gecode_argument_error(assign(X0,X1,X2,X3,X4,X5),arg=4)))) + ; (is_BoolVarBranch(X2,Y2) + -> (is_BoolAssign(X3,Y3) + -> (is_IntBranchFilter(X4,Y4) + -> (is_IntVarValPrint(X5,Y5) + -> gecode_constraint_assign_38(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntVarValPrint'(X5)),gecode_argument_error(assign(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('IntBranchFilter'(X4)),gecode_argument_error(assign(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('BoolAssign'(X3)),gecode_argument_error(assign(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(assign(X0,X1,X2,X3,X4,X5),arg=3))))) + ; (is_FloatVarArgs(X1,Y1) + -> (is_FloatVarBranch(X2,Y2) + -> (is_FloatAssign(X3,Y3) + -> (is_FloatBranchFilter(X4,Y4) + -> (is_FloatVarValPrint(X5,Y5) + -> gecode_constraint_assign_41(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('FloatVarValPrint'(X5)),gecode_argument_error(assign(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('FloatBranchFilter'(X4)),gecode_argument_error(assign(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('FloatAssign'(X3)),gecode_argument_error(assign(X0,X1,X2,X3,X4,X5),arg=4)))) + ; (is_FloatVarBranch(X2,Y2) + -> (is_FloatAssign(X3,Y3) + -> (is_FloatBranchFilter(X4,Y4) + -> (is_FloatVarValPrint(X5,Y5) + -> gecode_constraint_assign_44(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('FloatVarValPrint'(X5)),gecode_argument_error(assign(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('FloatBranchFilter'(X4)),gecode_argument_error(assign(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('FloatAssign'(X3)),gecode_argument_error(assign(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(assign(X0,X1,X2,X3,X4,X5),arg=3))))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVarBranch(X2,Y2) + -> (is_IntAssign(X3,Y3) + -> (is_IntBranchFilter(X4,Y4) + -> (is_IntVarValPrint(X5,Y5) + -> gecode_constraint_assign_47(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntVarValPrint'(X5)),gecode_argument_error(assign(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('IntBranchFilter'(X4)),gecode_argument_error(assign(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntAssign'(X3)),gecode_argument_error(assign(X0,X1,X2,X3,X4,X5),arg=4)))) + ; (is_IntVarBranch(X2,Y2) + -> (is_IntAssign(X3,Y3) + -> (is_IntBranchFilter(X4,Y4) + -> (is_IntVarValPrint(X5,Y5) + -> gecode_constraint_assign_50(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntVarValPrint'(X5)),gecode_argument_error(assign(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('IntBranchFilter'(X4)),gecode_argument_error(assign(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntAssign'(X3)),gecode_argument_error(assign(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(assign(X0,X1,X2,X3,X4,X5),arg=3))))) + ; (is_SetVarArgs(X1,Y1) + -> (is_SetVarBranch(X2,Y2) + -> (is_SetAssign(X3,Y3) + -> (is_SetBranchFilter(X4,Y4) + -> (is_SetVarValPrint(X5,Y5) + -> gecode_constraint_assign_53(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('SetVarValPrint'(X5)),gecode_argument_error(assign(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('SetBranchFilter'(X4)),gecode_argument_error(assign(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('SetAssign'(X3)),gecode_argument_error(assign(X0,X1,X2,X3,X4,X5),arg=4)))) + ; (is_SetVarBranch(X2,Y2) + -> (is_SetAssign(X3,Y3) + -> (is_SetBranchFilter(X4,Y4) + -> (is_SetVarValPrint(X5,Y5) + -> gecode_constraint_assign_56(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('SetVarValPrint'(X5)),gecode_argument_error(assign(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('SetBranchFilter'(X4)),gecode_argument_error(assign(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('SetAssign'(X3)),gecode_argument_error(assign(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(assign(X0,X1,X2,X3,X4,X5),arg=3))))) + ; throw(error(type_error('SetVarArgs'(X1)),gecode_argument_error(assign(X0,X1,X2,X3,X4,X5),arg=2))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(assign(X0,X1,X2,X3,X4,X5),arg=1)))). + +binpacking(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> gecode_constraint_binpacking_63(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntArgs'(X3)),gecode_argument_error(binpacking(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(binpacking(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(binpacking(X0,X1,X2,X3),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(binpacking(X0,X1,X2,X3),arg=1)))). + +binpacking(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_binpacking_64(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(binpacking(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntArgs'(X3)),gecode_argument_error(binpacking(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(binpacking(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(binpacking(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(binpacking(X0,X1,X2,X3,X4),arg=1)))). + +branch(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVar(X1,Y1) + -> (is_BoolValBranch(X2,Y2) + -> gecode_constraint_branch_65(Y0,Y1,Y2) + ; throw(error(type_error('BoolValBranch'(X2)),gecode_argument_error(branch(X0,X1,X2),arg=3)))) + ; (is_FloatVar(X1,Y1) + -> (is_FloatValBranch(X2,Y2) + -> gecode_constraint_branch_109(Y0,Y1,Y2) + ; throw(error(type_error('FloatValBranch'(X2)),gecode_argument_error(branch(X0,X1,X2),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_IntValBranch(X2,Y2) + -> gecode_constraint_branch_111(Y0,Y1,Y2) + ; throw(error(type_error('IntValBranch'(X2)),gecode_argument_error(branch(X0,X1,X2),arg=3)))) + ; (is_SetVar(X1,Y1) + -> (is_SetValBranch(X2,Y2) + -> gecode_constraint_branch_113(Y0,Y1,Y2) + ; throw(error(type_error('SetValBranch'(X2)),gecode_argument_error(branch(X0,X1,X2),arg=3)))) + ; throw(error(type_error('SetVar'(X1)),gecode_argument_error(branch(X0,X1,X2),arg=2))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(branch(X0,X1,X2),arg=1)))). + +branch(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVar(X1,Y1) + -> (is_BoolValBranch(X2,Y2) + -> (is_BoolVarValPrint(X3,Y3) + -> gecode_constraint_branch_66(Y0,Y1,Y2,Y3) + ; throw(error(type_error('BoolVarValPrint'(X3)),gecode_argument_error(branch(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('BoolValBranch'(X2)),gecode_argument_error(branch(X0,X1,X2,X3),arg=3)))) + ; (is_BoolVarArgs(X1,Y1) + -> (is_BoolVarBranch(X2,Y2) + -> (is_BoolValBranch(X3,Y3) + -> gecode_constraint_branch_67(Y0,Y1,Y2,Y3) + ; throw(error(type_error('BoolValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3),arg=4)))) + ; (is_BoolVarBranch(X2,Y2) + -> (is_BoolValBranch(X3,Y3) + -> gecode_constraint_branch_73(Y0,Y1,Y2,Y3) + ; throw(error(type_error('BoolValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(branch(X0,X1,X2,X3),arg=3))))) + ; (is_FloatVarArgs(X1,Y1) + -> (is_FloatVarBranch(X2,Y2) + -> (is_FloatValBranch(X3,Y3) + -> gecode_constraint_branch_79(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3),arg=4)))) + ; (is_FloatVarBranch(X2,Y2) + -> (is_FloatValBranch(X3,Y3) + -> gecode_constraint_branch_82(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(branch(X0,X1,X2,X3),arg=3))))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVarBranch(X2,Y2) + -> (is_IntValBranch(X3,Y3) + -> gecode_constraint_branch_88(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3),arg=4)))) + ; (is_IntVarBranch(X2,Y2) + -> (is_IntValBranch(X3,Y3) + -> gecode_constraint_branch_94(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(branch(X0,X1,X2,X3),arg=3))))) + ; (is_SetVarArgs(X1,Y1) + -> (is_SetVarBranch(X2,Y2) + -> (is_SetValBranch(X3,Y3) + -> gecode_constraint_branch_100(Y0,Y1,Y2,Y3) + ; throw(error(type_error('SetValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3),arg=4)))) + ; (is_SetVarBranch(X2,Y2) + -> (is_SetValBranch(X3,Y3) + -> gecode_constraint_branch_106(Y0,Y1,Y2,Y3) + ; throw(error(type_error('SetValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(branch(X0,X1,X2,X3),arg=3))))) + ; (is_FloatVar(X1,Y1) + -> (is_FloatValBranch(X2,Y2) + -> (is_FloatVarValPrint(X3,Y3) + -> gecode_constraint_branch_110(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatVarValPrint'(X3)),gecode_argument_error(branch(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('FloatValBranch'(X2)),gecode_argument_error(branch(X0,X1,X2,X3),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_IntValBranch(X2,Y2) + -> (is_IntVarValPrint(X3,Y3) + -> gecode_constraint_branch_112(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVarValPrint'(X3)),gecode_argument_error(branch(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntValBranch'(X2)),gecode_argument_error(branch(X0,X1,X2,X3),arg=3)))) + ; (is_SetVar(X1,Y1) + -> (is_SetValBranch(X2,Y2) + -> (is_SetVarValPrint(X3,Y3) + -> gecode_constraint_branch_114(Y0,Y1,Y2,Y3) + ; throw(error(type_error('SetVarValPrint'(X3)),gecode_argument_error(branch(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('SetValBranch'(X2)),gecode_argument_error(branch(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('SetVar'(X1)),gecode_argument_error(branch(X0,X1,X2,X3),arg=2))))))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(branch(X0,X1,X2,X3),arg=1)))). + +branch(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_BoolVarBranch(X2,Y2) + -> (is_BoolValBranch(X3,Y3) + -> (is_BoolBranchFilter(X4,Y4) + -> gecode_constraint_branch_68(Y0,Y1,Y2,Y3,Y4) + ; (is_Symmetries(X4,Y4) + -> gecode_constraint_branch_70(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Symmetries'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('BoolValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=4)))) + ; (is_BoolVarBranch(X2,Y2) + -> (is_BoolValBranch(X3,Y3) + -> (is_BoolBranchFilter(X4,Y4) + -> gecode_constraint_branch_74(Y0,Y1,Y2,Y3,Y4) + ; (is_Symmetries(X4,Y4) + -> gecode_constraint_branch_76(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Symmetries'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('BoolValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=3))))) + ; (is_FloatVarArgs(X1,Y1) + -> (is_FloatVarBranch(X2,Y2) + -> (is_FloatValBranch(X3,Y3) + -> (is_FloatBranchFilter(X4,Y4) + -> gecode_constraint_branch_80(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('FloatBranchFilter'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('FloatValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=4)))) + ; (is_FloatVarBranch(X2,Y2) + -> (is_FloatValBranch(X3,Y3) + -> (is_FloatBranchFilter(X4,Y4) + -> gecode_constraint_branch_83(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('FloatBranchFilter'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('FloatValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=3))))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVarBranch(X2,Y2) + -> (is_IntValBranch(X3,Y3) + -> (is_Symmetries(X4,Y4) + -> gecode_constraint_branch_85(Y0,Y1,Y2,Y3,Y4) + ; (is_IntBranchFilter(X4,Y4) + -> gecode_constraint_branch_89(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntBranchFilter'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('IntValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=4)))) + ; (is_IntVarBranch(X2,Y2) + -> (is_IntValBranch(X3,Y3) + -> (is_Symmetries(X4,Y4) + -> gecode_constraint_branch_91(Y0,Y1,Y2,Y3,Y4) + ; (is_IntBranchFilter(X4,Y4) + -> gecode_constraint_branch_95(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntBranchFilter'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('IntValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=3))))) + ; (is_SetVarArgs(X1,Y1) + -> (is_SetVarBranch(X2,Y2) + -> (is_SetValBranch(X3,Y3) + -> (is_Symmetries(X4,Y4) + -> gecode_constraint_branch_97(Y0,Y1,Y2,Y3,Y4) + ; (is_SetBranchFilter(X4,Y4) + -> gecode_constraint_branch_101(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('SetBranchFilter'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('SetValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=4)))) + ; (is_SetVarBranch(X2,Y2) + -> (is_SetValBranch(X3,Y3) + -> (is_Symmetries(X4,Y4) + -> gecode_constraint_branch_103(Y0,Y1,Y2,Y3,Y4) + ; (is_SetBranchFilter(X4,Y4) + -> gecode_constraint_branch_107(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('SetBranchFilter'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('SetValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=3))))) + ; throw(error(type_error('SetVarArgs'(X1)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=2))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(branch(X0,X1,X2,X3,X4),arg=1)))). + +branch(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_BoolVarBranch(X2,Y2) + -> (is_BoolValBranch(X3,Y3) + -> (is_BoolBranchFilter(X4,Y4) + -> (is_BoolVarValPrint(X5,Y5) + -> gecode_constraint_branch_69(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('BoolVarValPrint'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=6)))) + ; (is_Symmetries(X4,Y4) + -> (is_BoolBranchFilter(X5,Y5) + -> gecode_constraint_branch_71(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('BoolBranchFilter'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('Symmetries'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('BoolValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=4)))) + ; (is_BoolVarBranch(X2,Y2) + -> (is_BoolValBranch(X3,Y3) + -> (is_BoolBranchFilter(X4,Y4) + -> (is_BoolVarValPrint(X5,Y5) + -> gecode_constraint_branch_75(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('BoolVarValPrint'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=6)))) + ; (is_Symmetries(X4,Y4) + -> (is_BoolBranchFilter(X5,Y5) + -> gecode_constraint_branch_77(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('BoolBranchFilter'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('Symmetries'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('BoolValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=3))))) + ; (is_FloatVarArgs(X1,Y1) + -> (is_FloatVarBranch(X2,Y2) + -> (is_FloatValBranch(X3,Y3) + -> (is_FloatBranchFilter(X4,Y4) + -> (is_FloatVarValPrint(X5,Y5) + -> gecode_constraint_branch_81(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('FloatVarValPrint'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('FloatBranchFilter'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('FloatValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=4)))) + ; (is_FloatVarBranch(X2,Y2) + -> (is_FloatValBranch(X3,Y3) + -> (is_FloatBranchFilter(X4,Y4) + -> (is_FloatVarValPrint(X5,Y5) + -> gecode_constraint_branch_84(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('FloatVarValPrint'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('FloatBranchFilter'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('FloatValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=3))))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVarBranch(X2,Y2) + -> (is_IntValBranch(X3,Y3) + -> (is_Symmetries(X4,Y4) + -> (is_IntBranchFilter(X5,Y5) + -> gecode_constraint_branch_86(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntBranchFilter'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=6)))) + ; (is_IntBranchFilter(X4,Y4) + -> (is_IntVarValPrint(X5,Y5) + -> gecode_constraint_branch_90(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntVarValPrint'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('IntBranchFilter'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('IntValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=4)))) + ; (is_IntVarBranch(X2,Y2) + -> (is_IntValBranch(X3,Y3) + -> (is_Symmetries(X4,Y4) + -> (is_IntBranchFilter(X5,Y5) + -> gecode_constraint_branch_92(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntBranchFilter'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=6)))) + ; (is_IntBranchFilter(X4,Y4) + -> (is_IntVarValPrint(X5,Y5) + -> gecode_constraint_branch_96(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntVarValPrint'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('IntBranchFilter'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('IntValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=3))))) + ; (is_SetVarArgs(X1,Y1) + -> (is_SetVarBranch(X2,Y2) + -> (is_SetValBranch(X3,Y3) + -> (is_Symmetries(X4,Y4) + -> (is_SetBranchFilter(X5,Y5) + -> gecode_constraint_branch_98(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('SetBranchFilter'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=6)))) + ; (is_SetBranchFilter(X4,Y4) + -> (is_SetVarValPrint(X5,Y5) + -> gecode_constraint_branch_102(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('SetVarValPrint'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('SetBranchFilter'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('SetValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=4)))) + ; (is_SetVarBranch(X2,Y2) + -> (is_SetValBranch(X3,Y3) + -> (is_Symmetries(X4,Y4) + -> (is_SetBranchFilter(X5,Y5) + -> gecode_constraint_branch_104(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('SetBranchFilter'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=6)))) + ; (is_SetBranchFilter(X4,Y4) + -> (is_SetVarValPrint(X5,Y5) + -> gecode_constraint_branch_108(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('SetVarValPrint'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('SetBranchFilter'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('SetValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=3))))) + ; throw(error(type_error('SetVarArgs'(X1)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=2))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5),arg=1)))). + +branch(X0,X1,X2,X3,X4,X5,X6) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_BoolVarBranch(X2,Y2) + -> (is_BoolValBranch(X3,Y3) + -> (is_Symmetries(X4,Y4) + -> (is_BoolBranchFilter(X5,Y5) + -> (is_BoolVarValPrint(X6,Y6) + -> gecode_constraint_branch_72(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('BoolVarValPrint'(X6)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('BoolBranchFilter'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('Symmetries'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('BoolValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; (is_BoolVarBranch(X2,Y2) + -> (is_BoolValBranch(X3,Y3) + -> (is_Symmetries(X4,Y4) + -> (is_BoolBranchFilter(X5,Y5) + -> (is_BoolVarValPrint(X6,Y6) + -> gecode_constraint_branch_78(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('BoolVarValPrint'(X6)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('BoolBranchFilter'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('Symmetries'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('BoolValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=3))))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVarBranch(X2,Y2) + -> (is_IntValBranch(X3,Y3) + -> (is_Symmetries(X4,Y4) + -> (is_IntBranchFilter(X5,Y5) + -> (is_IntVarValPrint(X6,Y6) + -> gecode_constraint_branch_87(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntVarValPrint'(X6)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('IntBranchFilter'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('Symmetries'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('IntValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; (is_IntVarBranch(X2,Y2) + -> (is_IntValBranch(X3,Y3) + -> (is_Symmetries(X4,Y4) + -> (is_IntBranchFilter(X5,Y5) + -> (is_IntVarValPrint(X6,Y6) + -> gecode_constraint_branch_93(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntVarValPrint'(X6)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('IntBranchFilter'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('Symmetries'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('IntValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=3))))) + ; (is_SetVarArgs(X1,Y1) + -> (is_SetVarBranch(X2,Y2) + -> (is_SetValBranch(X3,Y3) + -> (is_Symmetries(X4,Y4) + -> (is_SetBranchFilter(X5,Y5) + -> (is_SetVarValPrint(X6,Y6) + -> gecode_constraint_branch_99(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('SetVarValPrint'(X6)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('SetBranchFilter'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('Symmetries'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('SetValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; (is_SetVarBranch(X2,Y2) + -> (is_SetValBranch(X3,Y3) + -> (is_Symmetries(X4,Y4) + -> (is_SetBranchFilter(X5,Y5) + -> (is_SetVarValPrint(X6,Y6) + -> gecode_constraint_branch_105(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('SetVarValPrint'(X6)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('SetBranchFilter'(X5)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('Symmetries'(X4)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('SetValBranch'(X3)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; throw(error(type_error('TieBreak'(X2)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=3))))) + ; throw(error(type_error('SetVarArgs'(X1)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=2)))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(branch(X0,X1,X2,X3,X4,X5,X6),arg=1)))). + +cardinality(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_SetVarArgs(X1,Y1) + -> (is_int(X2,Y2) + -> (is_int(X3,Y3) + -> gecode_constraint_cardinality_115(Y0,Y1,Y2,Y3) + ; throw(error(type_error(int(X3)),gecode_argument_error(cardinality(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(cardinality(X0,X1,X2,X3),arg=3)))) + ; (is_SetVar(X1,Y1) + -> (is_int(X2,Y2) + -> (is_int(X3,Y3) + -> gecode_constraint_cardinality_116(Y0,Y1,Y2,Y3) + ; throw(error(type_error(int(X3)),gecode_argument_error(cardinality(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(cardinality(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('SetVar'(X1)),gecode_argument_error(cardinality(X0,X1,X2,X3),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(cardinality(X0,X1,X2,X3),arg=1)))). + +channel(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> gecode_constraint_channel_117(Y0,Y1,Y2) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(channel(X0,X1,X2),arg=3)))) + ; (is_BoolVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> gecode_constraint_channel_119(Y0,Y1,Y2) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(channel(X0,X1,X2),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> gecode_constraint_channel_122(Y0,Y1,Y2) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(channel(X0,X1,X2),arg=3)))) + ; (is_FloatVar(X1,Y1) + -> (is_BoolVar(X2,Y2) + -> gecode_constraint_channel_126(Y0,Y1,Y2) + ; (is_IntVar(X2,Y2) + -> gecode_constraint_channel_127(Y0,Y1,Y2) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(channel(X0,X1,X2),arg=3))))) + ; throw(error(type_error('FloatVar'(X1)),gecode_argument_error(channel(X0,X1,X2),arg=2))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(channel(X0,X1,X2),arg=1)))). + +channel(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_channel_118(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(channel(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(channel(X0,X1,X2,X3),arg=3)))) + ; (is_BoolVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_int(X3,Y3) + -> gecode_constraint_channel_120(Y0,Y1,Y2,Y3) + ; throw(error(type_error(int(X3)),gecode_argument_error(channel(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(channel(X0,X1,X2,X3),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_channel_123(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(channel(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(channel(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(channel(X0,X1,X2,X3),arg=2)))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(channel(X0,X1,X2,X3),arg=1)))). + +channel(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_channel_121(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(channel(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(channel(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(channel(X0,X1,X2,X3,X4),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_int(X4,Y4) + -> gecode_constraint_channel_124(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error(int(X4)),gecode_argument_error(channel(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(channel(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(channel(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(channel(X0,X1,X2,X3,X4),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(channel(X0,X1,X2,X3,X4),arg=1)))). + +channel(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_int(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_channel_125(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(channel(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error(int(X4)),gecode_argument_error(channel(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(channel(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(channel(X0,X1,X2,X3,X4,X5),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(channel(X0,X1,X2,X3,X4,X5),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(channel(X0,X1,X2,X3,X4,X5),arg=1)))). + +circuit(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntVar(X4,Y4) + -> gecode_constraint_circuit_128(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(circuit(X0,X1,X2,X3,X4),arg=5)))) + ; (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_circuit_131(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(circuit(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(circuit(X0,X1,X2,X3,X4),arg=4))))) + ; (is_int(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntVar(X4,Y4) + -> gecode_constraint_circuit_134(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(circuit(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(circuit(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(circuit(X0,X1,X2,X3,X4),arg=3))))) + ; throw(error(type_error('IntArgs'(X1)),gecode_argument_error(circuit(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(circuit(X0,X1,X2,X3,X4),arg=1)))). + +circuit(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_circuit_129(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5),arg=4)))) + ; (is_int(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntVar(X5,Y5) + -> gecode_constraint_circuit_132(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntVar'(X5)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5),arg=6)))) + ; (is_IntVar(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_circuit_135(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5),arg=3))))) + ; throw(error(type_error('IntArgs'(X1)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5),arg=1)))). + +circuit(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_circuit_130(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(circuit(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(circuit(X0,X1,X2,X3),arg=3)))) + ; (is_int(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_circuit_139(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(circuit(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(circuit(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error(int(X1)),gecode_argument_error(circuit(X0,X1,X2,X3),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(circuit(X0,X1,X2,X3),arg=1)))). + +circuit(X0,X1,X2,X3,X4,X5,X6) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntArgs(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntVar(X5,Y5) + -> (is_IntPropLevel(X6,Y6) + -> gecode_constraint_circuit_133(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntPropLevel'(X6)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('IntVar'(X5)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5,X6),arg=3)))) + ; throw(error(type_error('IntArgs'(X1)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5,X6),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5,X6),arg=1)))). + +circuit(X0,X1) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> gecode_constraint_circuit_136(Y0,Y1) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(circuit(X0,X1),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(circuit(X0,X1),arg=1)))). + +circuit(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntPropLevel(X2,Y2) + -> gecode_constraint_circuit_137(Y0,Y1,Y2) + ; throw(error(type_error('IntPropLevel'(X2)),gecode_argument_error(circuit(X0,X1,X2),arg=3)))) + ; (is_int(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> gecode_constraint_circuit_138(Y0,Y1,Y2) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(circuit(X0,X1,X2),arg=3)))) + ; throw(error(type_error(int(X1)),gecode_argument_error(circuit(X0,X1,X2),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(circuit(X0,X1,X2),arg=1)))). + +clause(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolOpType(X1,Y1) + -> (is_BoolVarArgs(X2,Y2) + -> (is_BoolVarArgs(X3,Y3) + -> (is_BoolVar(X4,Y4) + -> gecode_constraint_clause_140(Y0,Y1,Y2,Y3,Y4) + ; (is_int(X4,Y4) + -> gecode_constraint_clause_142(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error(int(X4)),gecode_argument_error(clause(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('BoolVarArgs'(X3)),gecode_argument_error(clause(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('BoolVarArgs'(X2)),gecode_argument_error(clause(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('BoolOpType'(X1)),gecode_argument_error(clause(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(clause(X0,X1,X2,X3,X4),arg=1)))). + +clause(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolOpType(X1,Y1) + -> (is_BoolVarArgs(X2,Y2) + -> (is_BoolVarArgs(X3,Y3) + -> (is_BoolVar(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_clause_141(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(clause(X0,X1,X2,X3,X4,X5),arg=6)))) + ; (is_int(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_clause_143(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(clause(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error(int(X4)),gecode_argument_error(clause(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('BoolVarArgs'(X3)),gecode_argument_error(clause(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('BoolVarArgs'(X2)),gecode_argument_error(clause(X0,X1,X2,X3,X4,X5),arg=3)))) + ; throw(error(type_error('BoolOpType'(X1)),gecode_argument_error(clause(X0,X1,X2,X3,X4,X5),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(clause(X0,X1,X2,X3,X4,X5),arg=1)))). + +count(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntArgs(X2,Y2) + -> (is_IntRelType(X3,Y3) + -> (is_int(X4,Y4) + -> gecode_constraint_count_144(Y0,Y1,Y2,Y3,Y4) + ; (is_IntVar(X4,Y4) + -> gecode_constraint_count_146(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('IntRelType'(X3)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=4)))) + ; (is_IntSetArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_count_149(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntArgs'(X3)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=4)))) + ; (is_IntSet(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_count_153(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=5)))) + ; (is_IntRelType(X3,Y3) + -> (is_int(X4,Y4) + -> gecode_constraint_count_154(Y0,Y1,Y2,Y3,Y4) + ; (is_IntVar(X4,Y4) + -> gecode_constraint_count_156(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('IntRelType'(X3)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=4))))) + ; (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_count_159(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntArgs'(X3)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=4)))) + ; (is_int(X2,Y2) + -> (is_IntRelType(X3,Y3) + -> (is_int(X4,Y4) + -> gecode_constraint_count_162(Y0,Y1,Y2,Y3,Y4) + ; (is_IntVar(X4,Y4) + -> gecode_constraint_count_164(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('IntRelType'(X3)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=4)))) + ; (is_IntVar(X2,Y2) + -> (is_IntRelType(X3,Y3) + -> (is_int(X4,Y4) + -> gecode_constraint_count_166(Y0,Y1,Y2,Y3,Y4) + ; (is_IntVar(X4,Y4) + -> gecode_constraint_count_168(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('IntRelType'(X3)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=3))))))))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(count(X0,X1,X2,X3,X4),arg=1)))). + +count(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntArgs(X2,Y2) + -> (is_IntRelType(X3,Y3) + -> (is_int(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_count_145(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=6)))) + ; (is_IntVar(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_count_147(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('IntRelType'(X3)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=4)))) + ; (is_IntSet(X2,Y2) + -> (is_IntRelType(X3,Y3) + -> (is_int(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_count_155(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=6)))) + ; (is_IntVar(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_count_157(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('IntRelType'(X3)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=4)))) + ; (is_int(X2,Y2) + -> (is_IntRelType(X3,Y3) + -> (is_int(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_count_163(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=6)))) + ; (is_IntVar(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_count_165(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('IntRelType'(X3)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=4)))) + ; (is_IntVar(X2,Y2) + -> (is_IntRelType(X3,Y3) + -> (is_int(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_count_167(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=6)))) + ; (is_IntVar(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_count_169(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('IntRelType'(X3)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=3))))))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=1)))). + +count(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntSetArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> gecode_constraint_count_148(Y0,Y1,Y2,Y3) + ; (is_IntPropLevel(X3,Y3) + -> gecode_constraint_count_151(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(count(X0,X1,X2,X3),arg=4))))) + ; (is_IntSet(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> gecode_constraint_count_152(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntArgs'(X3)),gecode_argument_error(count(X0,X1,X2,X3),arg=4)))) + ; (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> gecode_constraint_count_158(Y0,Y1,Y2,Y3) + ; (is_IntPropLevel(X3,Y3) + -> gecode_constraint_count_161(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(count(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(count(X0,X1,X2,X3),arg=3)))))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(count(X0,X1,X2,X3),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(count(X0,X1,X2,X3),arg=1)))). + +count(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntSetArgs(X2,Y2) + -> gecode_constraint_count_150(Y0,Y1,Y2) + ; (is_IntVarArgs(X2,Y2) + -> gecode_constraint_count_160(Y0,Y1,Y2) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(count(X0,X1,X2),arg=3))))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(count(X0,X1,X2),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(count(X0,X1,X2),arg=1)))). + +cumulative(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_int(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_IntArgs(X4,Y4) + -> (is_BoolVarArgs(X5,Y5) + -> gecode_constraint_cumulative_170(Y0,Y1,Y2,Y3,Y4,Y5) + ; (is_IntPropLevel(X5,Y5) + -> gecode_constraint_cumulative_173(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=6))))) + ; throw(error(type_error('IntArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=5)))) + ; (is_IntVarArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> gecode_constraint_cumulative_176(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntArgs'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=4))))) + ; (is_TaskTypeArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> gecode_constraint_cumulative_180(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntArgs'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('IntArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('TaskTypeArgs'(X2)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=3))))) + ; (is_IntVar(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_IntArgs(X4,Y4) + -> (is_BoolVarArgs(X5,Y5) + -> gecode_constraint_cumulative_182(Y0,Y1,Y2,Y3,Y4,Y5) + ; (is_IntPropLevel(X5,Y5) + -> gecode_constraint_cumulative_185(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=6))))) + ; throw(error(type_error('IntArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=5)))) + ; (is_IntVarArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> gecode_constraint_cumulative_188(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntArgs'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=4))))) + ; (is_TaskTypeArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> gecode_constraint_cumulative_192(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntArgs'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('IntArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('TaskTypeArgs'(X2)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=3))))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=1)))). + +cumulative(X0,X1,X2,X3,X4,X5,X6) :- + (is_Space_or_Clause(X0,Y0) + -> (is_int(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_IntArgs(X4,Y4) + -> (is_BoolVarArgs(X5,Y5) + -> (is_IntPropLevel(X6,Y6) + -> gecode_constraint_cumulative_171(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntPropLevel'(X6)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('BoolVarArgs'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('IntArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; (is_IntVarArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_BoolVarArgs(X6,Y6) + -> gecode_constraint_cumulative_174(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; (is_IntPropLevel(X6,Y6) + -> gecode_constraint_cumulative_177(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntPropLevel'(X6)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=7))))) + ; throw(error(type_error('IntArgs'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=4))))) + ; (is_TaskTypeArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_BoolVarArgs(X6,Y6) + -> gecode_constraint_cumulative_178(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; (is_IntPropLevel(X6,Y6) + -> gecode_constraint_cumulative_181(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntPropLevel'(X6)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=7))))) + ; throw(error(type_error('IntArgs'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('IntArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; throw(error(type_error('TaskTypeArgs'(X2)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=3))))) + ; (is_IntVar(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_IntArgs(X4,Y4) + -> (is_BoolVarArgs(X5,Y5) + -> (is_IntPropLevel(X6,Y6) + -> gecode_constraint_cumulative_183(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntPropLevel'(X6)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('BoolVarArgs'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('IntArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; (is_IntVarArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_BoolVarArgs(X6,Y6) + -> gecode_constraint_cumulative_186(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; (is_IntPropLevel(X6,Y6) + -> gecode_constraint_cumulative_189(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntPropLevel'(X6)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=7))))) + ; throw(error(type_error('IntArgs'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=4))))) + ; (is_TaskTypeArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_BoolVarArgs(X6,Y6) + -> gecode_constraint_cumulative_190(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; (is_IntPropLevel(X6,Y6) + -> gecode_constraint_cumulative_193(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntPropLevel'(X6)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=7))))) + ; throw(error(type_error('IntArgs'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('IntArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; throw(error(type_error('TaskTypeArgs'(X2)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=3))))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=1)))). + +cumulative(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_int(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_IntArgs(X4,Y4) + -> gecode_constraint_cumulative_172(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntArgs'(X3)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_IntArgs(X4,Y4) + -> gecode_constraint_cumulative_184(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntArgs'(X3)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4),arg=1)))). + +cumulative(X0,X1,X2,X3,X4,X5,X6,X7) :- + (is_Space_or_Clause(X0,Y0) + -> (is_int(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_BoolVarArgs(X6,Y6) + -> (is_IntPropLevel(X7,Y7) + -> gecode_constraint_cumulative_175(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error('IntPropLevel'(X7)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('BoolVarArgs'(X6)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; throw(error(type_error('IntArgs'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=6)))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=4)))) + ; (is_TaskTypeArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_BoolVarArgs(X6,Y6) + -> (is_IntPropLevel(X7,Y7) + -> gecode_constraint_cumulative_179(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error('IntPropLevel'(X7)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('BoolVarArgs'(X6)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; throw(error(type_error('IntArgs'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=6)))) + ; throw(error(type_error('IntArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=4)))) + ; throw(error(type_error('TaskTypeArgs'(X2)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=3))))) + ; (is_IntVar(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_BoolVarArgs(X6,Y6) + -> (is_IntPropLevel(X7,Y7) + -> gecode_constraint_cumulative_187(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error('IntPropLevel'(X7)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('BoolVarArgs'(X6)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; throw(error(type_error('IntArgs'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=6)))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=4)))) + ; (is_TaskTypeArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_BoolVarArgs(X6,Y6) + -> (is_IntPropLevel(X7,Y7) + -> gecode_constraint_cumulative_191(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error('IntPropLevel'(X7)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('BoolVarArgs'(X6)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; throw(error(type_error('IntArgs'(X5)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=6)))) + ; throw(error(type_error('IntArgs'(X4)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=4)))) + ; throw(error(type_error('TaskTypeArgs'(X2)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=3))))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=1)))). + +cumulatives(X0,X1,X2,X3,X4,X5,X6,X7) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> gecode_constraint_cumulatives_194(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; (is_IntVarArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> gecode_constraint_cumulatives_196(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; throw(error(type_error('IntVarArgs'(X5)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=6))))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))) + ; (is_IntVarArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> gecode_constraint_cumulatives_198(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; (is_IntVarArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> gecode_constraint_cumulatives_200(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; throw(error(type_error('IntVarArgs'(X5)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=6))))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=4))))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> gecode_constraint_cumulatives_202(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; (is_IntVarArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> gecode_constraint_cumulatives_204(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; throw(error(type_error('IntVarArgs'(X5)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=6))))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))) + ; (is_IntVarArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> gecode_constraint_cumulatives_206(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; (is_IntVarArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> gecode_constraint_cumulatives_208(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; throw(error(type_error('IntVarArgs'(X5)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=6))))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=4))))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=1)))). + +cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> (is_IntPropLevel(X8,Y8) + -> gecode_constraint_cumulatives_195(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8) + ; throw(error(type_error('IntPropLevel'(X8)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=9)))) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=7)))) + ; (is_IntVarArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> (is_IntPropLevel(X8,Y8) + -> gecode_constraint_cumulatives_197(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8) + ; throw(error(type_error('IntPropLevel'(X8)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=9)))) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=7)))) + ; throw(error(type_error('IntVarArgs'(X5)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=6))))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=5)))) + ; (is_IntVarArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> (is_IntPropLevel(X8,Y8) + -> gecode_constraint_cumulatives_199(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8) + ; throw(error(type_error('IntPropLevel'(X8)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=9)))) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=7)))) + ; (is_IntVarArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> (is_IntPropLevel(X8,Y8) + -> gecode_constraint_cumulatives_201(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8) + ; throw(error(type_error('IntPropLevel'(X8)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=9)))) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=7)))) + ; throw(error(type_error('IntVarArgs'(X5)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=6))))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=4))))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> (is_IntPropLevel(X8,Y8) + -> gecode_constraint_cumulatives_203(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8) + ; throw(error(type_error('IntPropLevel'(X8)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=9)))) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=7)))) + ; (is_IntVarArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> (is_IntPropLevel(X8,Y8) + -> gecode_constraint_cumulatives_205(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8) + ; throw(error(type_error('IntPropLevel'(X8)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=9)))) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=7)))) + ; throw(error(type_error('IntVarArgs'(X5)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=6))))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=5)))) + ; (is_IntVarArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> (is_IntPropLevel(X8,Y8) + -> gecode_constraint_cumulatives_207(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8) + ; throw(error(type_error('IntPropLevel'(X8)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=9)))) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=7)))) + ; (is_IntVarArgs(X5,Y5) + -> (is_IntArgs(X6,Y6) + -> (is_bool(X7,Y7) + -> (is_IntPropLevel(X8,Y8) + -> gecode_constraint_cumulatives_209(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8) + ; throw(error(type_error('IntPropLevel'(X8)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=9)))) + ; throw(error(type_error(bool(X7)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=8)))) + ; throw(error(type_error('IntArgs'(X6)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=7)))) + ; throw(error(type_error('IntVarArgs'(X5)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=6))))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=4))))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=1)))). + +distinct(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> gecode_constraint_distinct_210(Y0,Y1,Y2) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(distinct(X0,X1,X2),arg=3)))) + ; (is_IntArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> gecode_constraint_distinct_212(Y0,Y1,Y2) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(distinct(X0,X1,X2),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_int(X2,Y2) + -> gecode_constraint_distinct_214(Y0,Y1,Y2) + ; (is_IntPropLevel(X2,Y2) + -> gecode_constraint_distinct_217(Y0,Y1,Y2) + ; throw(error(type_error('IntPropLevel'(X2)),gecode_argument_error(distinct(X0,X1,X2),arg=3))))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(distinct(X0,X1,X2),arg=2)))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(distinct(X0,X1,X2),arg=1)))). + +distinct(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_distinct_211(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(distinct(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(distinct(X0,X1,X2,X3),arg=3)))) + ; (is_IntArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_distinct_213(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(distinct(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(distinct(X0,X1,X2,X3),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_distinct_215(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(distinct(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(distinct(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(distinct(X0,X1,X2,X3),arg=2)))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(distinct(X0,X1,X2,X3),arg=1)))). + +distinct(X0,X1) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> gecode_constraint_distinct_216(Y0,Y1) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(distinct(X0,X1),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(distinct(X0,X1),arg=1)))). + +div(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_FloatVar(X1,Y1) + -> (is_FloatVar(X2,Y2) + -> (is_FloatVar(X3,Y3) + -> gecode_constraint_div_218(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatVar'(X3)),gecode_argument_error(div(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('FloatVar'(X2)),gecode_argument_error(div(X0,X1,X2,X3),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_div_219(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(div(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(div(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(div(X0,X1,X2,X3),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(div(X0,X1,X2,X3),arg=1)))). + +div(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_div_220(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(div(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(div(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(div(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(div(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(div(X0,X1,X2,X3,X4),arg=1)))). + +divmod(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntVar(X4,Y4) + -> gecode_constraint_divmod_221(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(divmod(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(divmod(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(divmod(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(divmod(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(divmod(X0,X1,X2,X3,X4),arg=1)))). + +divmod(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_divmod_222(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(divmod(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(divmod(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(divmod(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(divmod(X0,X1,X2,X3,X4,X5),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(divmod(X0,X1,X2,X3,X4,X5),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(divmod(X0,X1,X2,X3,X4,X5),arg=1)))). + +dom(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVar(X1,Y1) + -> (is_BoolVar(X2,Y2) + -> gecode_constraint_dom_223(Y0,Y1,Y2) + ; throw(error(type_error('BoolVar'(X2)),gecode_argument_error(dom(X0,X1,X2),arg=3)))) + ; (is_BoolVarArgs(X1,Y1) + -> (is_BoolVarArgs(X2,Y2) + -> gecode_constraint_dom_225(Y0,Y1,Y2) + ; throw(error(type_error('BoolVarArgs'(X2)),gecode_argument_error(dom(X0,X1,X2),arg=3)))) + ; (is_FloatVarArgs(X1,Y1) + -> (is_FloatVarArgs(X2,Y2) + -> gecode_constraint_dom_227(Y0,Y1,Y2) + ; (is_FloatVal(X2,Y2) + -> gecode_constraint_dom_229(Y0,Y1,Y2) + ; throw(error(type_error('FloatVal'(X2)),gecode_argument_error(dom(X0,X1,X2),arg=3))))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntSet(X2,Y2) + -> gecode_constraint_dom_230(Y0,Y1,Y2) + ; (is_IntVarArgs(X2,Y2) + -> gecode_constraint_dom_232(Y0,Y1,Y2) + ; (is_int(X2,Y2) + -> gecode_constraint_dom_236(Y0,Y1,Y2) + ; throw(error(type_error(int(X2)),gecode_argument_error(dom(X0,X1,X2),arg=3)))))) + ; (is_SetVarArgs(X1,Y1) + -> (is_SetVarArgs(X2,Y2) + -> gecode_constraint_dom_238(Y0,Y1,Y2) + ; throw(error(type_error('SetVarArgs'(X2)),gecode_argument_error(dom(X0,X1,X2),arg=3)))) + ; (is_FloatVar(X1,Y1) + -> (is_FloatVal(X2,Y2) + -> gecode_constraint_dom_244(Y0,Y1,Y2) + ; (is_FloatVar(X2,Y2) + -> gecode_constraint_dom_246(Y0,Y1,Y2) + ; throw(error(type_error('FloatVar'(X2)),gecode_argument_error(dom(X0,X1,X2),arg=3))))) + ; (is_IntVar(X1,Y1) + -> (is_IntSet(X2,Y2) + -> gecode_constraint_dom_247(Y0,Y1,Y2) + ; (is_int(X2,Y2) + -> gecode_constraint_dom_253(Y0,Y1,Y2) + ; (is_IntVar(X2,Y2) + -> gecode_constraint_dom_259(Y0,Y1,Y2) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(dom(X0,X1,X2),arg=3)))))) + ; (is_SetVar(X1,Y1) + -> (is_SetVar(X2,Y2) + -> gecode_constraint_dom_267(Y0,Y1,Y2) + ; throw(error(type_error('SetVar'(X2)),gecode_argument_error(dom(X0,X1,X2),arg=3)))) + ; throw(error(type_error('SetVar'(X1)),gecode_argument_error(dom(X0,X1,X2),arg=2))))))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(dom(X0,X1,X2),arg=1)))). + +dom(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVar(X1,Y1) + -> (is_BoolVar(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_dom_224(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(dom(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('BoolVar'(X2)),gecode_argument_error(dom(X0,X1,X2,X3),arg=3)))) + ; (is_BoolVarArgs(X1,Y1) + -> (is_BoolVarArgs(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_dom_226(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(dom(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('BoolVarArgs'(X2)),gecode_argument_error(dom(X0,X1,X2,X3),arg=3)))) + ; (is_FloatVarArgs(X1,Y1) + -> (is_FloatNum(X2,Y2) + -> (is_FloatNum(X3,Y3) + -> gecode_constraint_dom_228(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatNum'(X3)),gecode_argument_error(dom(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('FloatNum'(X2)),gecode_argument_error(dom(X0,X1,X2,X3),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntSet(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_dom_231(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(dom(X0,X1,X2,X3),arg=4)))) + ; (is_IntVarArgs(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_dom_233(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(dom(X0,X1,X2,X3),arg=4)))) + ; (is_int(X2,Y2) + -> (is_int(X3,Y3) + -> gecode_constraint_dom_234(Y0,Y1,Y2,Y3) + ; (is_IntPropLevel(X3,Y3) + -> gecode_constraint_dom_237(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(dom(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error(int(X2)),gecode_argument_error(dom(X0,X1,X2,X3),arg=3)))))) + ; (is_SetVarArgs(X1,Y1) + -> (is_SetRelType(X2,Y2) + -> (is_IntSet(X3,Y3) + -> gecode_constraint_dom_239(Y0,Y1,Y2,Y3) + ; (is_int(X3,Y3) + -> gecode_constraint_dom_240(Y0,Y1,Y2,Y3) + ; throw(error(type_error(int(X3)),gecode_argument_error(dom(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('SetRelType'(X2)),gecode_argument_error(dom(X0,X1,X2,X3),arg=3)))) + ; (is_FloatVar(X1,Y1) + -> (is_FloatNum(X2,Y2) + -> (is_FloatNum(X3,Y3) + -> gecode_constraint_dom_242(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatNum'(X3)),gecode_argument_error(dom(X0,X1,X2,X3),arg=4)))) + ; (is_FloatVal(X2,Y2) + -> (is_Reify(X3,Y3) + -> gecode_constraint_dom_245(Y0,Y1,Y2,Y3) + ; throw(error(type_error('Reify'(X3)),gecode_argument_error(dom(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('FloatVal'(X2)),gecode_argument_error(dom(X0,X1,X2,X3),arg=3))))) + ; (is_IntVar(X1,Y1) + -> (is_IntSet(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_dom_248(Y0,Y1,Y2,Y3) + ; (is_Reify(X3,Y3) + -> gecode_constraint_dom_249(Y0,Y1,Y2,Y3) + ; throw(error(type_error('Reify'(X3)),gecode_argument_error(dom(X0,X1,X2,X3),arg=4))))) + ; (is_int(X2,Y2) + -> (is_int(X3,Y3) + -> gecode_constraint_dom_251(Y0,Y1,Y2,Y3) + ; (is_IntPropLevel(X3,Y3) + -> gecode_constraint_dom_254(Y0,Y1,Y2,Y3) + ; (is_Reify(X3,Y3) + -> gecode_constraint_dom_257(Y0,Y1,Y2,Y3) + ; throw(error(type_error('Reify'(X3)),gecode_argument_error(dom(X0,X1,X2,X3),arg=4)))))) + ; (is_IntVar(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_dom_260(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(dom(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(dom(X0,X1,X2,X3),arg=3)))))) + ; (is_SetVar(X1,Y1) + -> (is_SetRelType(X2,Y2) + -> (is_IntSet(X3,Y3) + -> gecode_constraint_dom_261(Y0,Y1,Y2,Y3) + ; (is_int(X3,Y3) + -> gecode_constraint_dom_263(Y0,Y1,Y2,Y3) + ; throw(error(type_error(int(X3)),gecode_argument_error(dom(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('SetRelType'(X2)),gecode_argument_error(dom(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('SetVar'(X1)),gecode_argument_error(dom(X0,X1,X2,X3),arg=2))))))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(dom(X0,X1,X2,X3),arg=1)))). + +dom(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_int(X2,Y2) + -> (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_dom_235(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=3)))) + ; (is_SetVarArgs(X1,Y1) + -> (is_SetRelType(X2,Y2) + -> (is_int(X3,Y3) + -> (is_int(X4,Y4) + -> gecode_constraint_dom_241(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error(int(X4)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('SetRelType'(X2)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=3)))) + ; (is_FloatVar(X1,Y1) + -> (is_FloatNum(X2,Y2) + -> (is_FloatNum(X3,Y3) + -> (is_Reify(X4,Y4) + -> gecode_constraint_dom_243(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('FloatNum'(X3)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('FloatNum'(X2)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_IntSet(X2,Y2) + -> (is_Reify(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_dom_250(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('Reify'(X3)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=4)))) + ; (is_int(X2,Y2) + -> (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_dom_252(Y0,Y1,Y2,Y3,Y4) + ; (is_Reify(X4,Y4) + -> gecode_constraint_dom_255(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=5))))) + ; (is_Reify(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_dom_258(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('Reify'(X3)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=4))))) + ; throw(error(type_error(int(X2)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=3))))) + ; (is_SetVar(X1,Y1) + -> (is_SetRelType(X2,Y2) + -> (is_IntSet(X3,Y3) + -> (is_Reify(X4,Y4) + -> gecode_constraint_dom_262(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=5)))) + ; (is_int(X3,Y3) + -> (is_int(X4,Y4) + -> gecode_constraint_dom_264(Y0,Y1,Y2,Y3,Y4) + ; (is_Reify(X4,Y4) + -> gecode_constraint_dom_266(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error(int(X3)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=4))))) + ; throw(error(type_error('SetRelType'(X2)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('SetVar'(X1)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=2)))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=1)))). + +dom(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_int(X2,Y2) + -> (is_int(X3,Y3) + -> (is_Reify(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_dom_256(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(dom(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(dom(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(dom(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(dom(X0,X1,X2,X3,X4,X5),arg=3)))) + ; (is_SetVar(X1,Y1) + -> (is_SetRelType(X2,Y2) + -> (is_int(X3,Y3) + -> (is_int(X4,Y4) + -> (is_Reify(X5,Y5) + -> gecode_constraint_dom_265(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('Reify'(X5)),gecode_argument_error(dom(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error(int(X4)),gecode_argument_error(dom(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(dom(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('SetRelType'(X2)),gecode_argument_error(dom(X0,X1,X2,X3,X4,X5),arg=3)))) + ; throw(error(type_error('SetVar'(X1)),gecode_argument_error(dom(X0,X1,X2,X3,X4,X5),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(dom(X0,X1,X2,X3,X4,X5),arg=1)))). + +element(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_BoolVar(X3,Y3) + -> gecode_constraint_element_268(Y0,Y1,Y2,Y3) + ; (is_int(X3,Y3) + -> gecode_constraint_element_270(Y0,Y1,Y2,Y3) + ; throw(error(type_error(int(X3)),gecode_argument_error(element(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(element(X0,X1,X2,X3),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_int(X3,Y3) + -> gecode_constraint_element_274(Y0,Y1,Y2,Y3) + ; (is_IntVar(X3,Y3) + -> gecode_constraint_element_278(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(element(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(element(X0,X1,X2,X3),arg=3)))) + ; (is_IntArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_BoolVar(X3,Y3) + -> gecode_constraint_element_280(Y0,Y1,Y2,Y3) + ; (is_int(X3,Y3) + -> gecode_constraint_element_282(Y0,Y1,Y2,Y3) + ; (is_IntVar(X3,Y3) + -> gecode_constraint_element_288(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(element(X0,X1,X2,X3),arg=4)))))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(element(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntArgs'(X1)),gecode_argument_error(element(X0,X1,X2,X3),arg=2)))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(element(X0,X1,X2,X3),arg=1)))). + +element(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_BoolVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_element_269(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(element(X0,X1,X2,X3,X4),arg=5)))) + ; (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_element_271(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(element(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(element(X0,X1,X2,X3,X4),arg=4))))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(element(X0,X1,X2,X3,X4),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_element_275(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(element(X0,X1,X2,X3,X4),arg=5)))) + ; (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_element_279(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(element(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(element(X0,X1,X2,X3,X4),arg=4))))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(element(X0,X1,X2,X3,X4),arg=3)))) + ; (is_IntArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_BoolVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_element_281(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(element(X0,X1,X2,X3,X4),arg=5)))) + ; (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_element_283(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(element(X0,X1,X2,X3,X4),arg=5)))) + ; (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_element_289(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(element(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(element(X0,X1,X2,X3,X4),arg=4)))))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(element(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntArgs'(X1)),gecode_argument_error(element(X0,X1,X2,X3,X4),arg=2)))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(element(X0,X1,X2,X3,X4),arg=1)))). + +element(X0,X1,X2,X3,X4,X5,X6) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_int(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_int(X5,Y5) + -> (is_BoolVar(X6,Y6) + -> gecode_constraint_element_272(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('BoolVar'(X6)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error(int(X5)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_int(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_int(X5,Y5) + -> (is_IntVar(X6,Y6) + -> gecode_constraint_element_276(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntVar'(X6)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error(int(X5)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=3)))) + ; (is_IntArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_int(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_int(X5,Y5) + -> (is_BoolVar(X6,Y6) + -> gecode_constraint_element_284(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; (is_IntVar(X6,Y6) + -> gecode_constraint_element_286(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntVar'(X6)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=7))))) + ; throw(error(type_error(int(X5)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=3)))) + ; throw(error(type_error('IntArgs'(X1)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=2)))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=1)))). + +element(X0,X1,X2,X3,X4,X5,X6,X7) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_int(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_int(X5,Y5) + -> (is_BoolVar(X6,Y6) + -> (is_IntPropLevel(X7,Y7) + -> gecode_constraint_element_273(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error('IntPropLevel'(X7)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('BoolVar'(X6)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; throw(error(type_error(int(X5)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_int(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_int(X5,Y5) + -> (is_IntVar(X6,Y6) + -> (is_IntPropLevel(X7,Y7) + -> gecode_constraint_element_277(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error('IntPropLevel'(X7)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('IntVar'(X6)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; throw(error(type_error(int(X5)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=3)))) + ; (is_IntArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_int(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_int(X5,Y5) + -> (is_BoolVar(X6,Y6) + -> (is_IntPropLevel(X7,Y7) + -> gecode_constraint_element_285(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error('IntPropLevel'(X7)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; (is_IntVar(X6,Y6) + -> (is_IntPropLevel(X7,Y7) + -> gecode_constraint_element_287(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error('IntPropLevel'(X7)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('IntVar'(X6)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=7))))) + ; throw(error(type_error(int(X5)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=3)))) + ; throw(error(type_error('IntArgs'(X1)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=2)))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=1)))). + +extensional(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_TupleSet(X2,Y2) + -> (is_bool(X3,Y3) + -> gecode_constraint_extensional_290(Y0,Y1,Y2,Y3) + ; throw(error(type_error(bool(X3)),gecode_argument_error(extensional(X0,X1,X2,X3),arg=4)))) + ; (is_DFA(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_extensional_295(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(extensional(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('DFA'(X2)),gecode_argument_error(extensional(X0,X1,X2,X3),arg=3))))) + ; (is_IntVarArgs(X1,Y1) + -> (is_TupleSet(X2,Y2) + -> (is_bool(X3,Y3) + -> gecode_constraint_extensional_296(Y0,Y1,Y2,Y3) + ; throw(error(type_error(bool(X3)),gecode_argument_error(extensional(X0,X1,X2,X3),arg=4)))) + ; (is_DFA(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_extensional_301(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(extensional(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('DFA'(X2)),gecode_argument_error(extensional(X0,X1,X2,X3),arg=3))))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(extensional(X0,X1,X2,X3),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(extensional(X0,X1,X2,X3),arg=1)))). + +extensional(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_TupleSet(X2,Y2) + -> (is_bool(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_extensional_291(Y0,Y1,Y2,Y3,Y4) + ; (is_Reify(X4,Y4) + -> gecode_constraint_extensional_292(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(extensional(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error(bool(X3)),gecode_argument_error(extensional(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('TupleSet'(X2)),gecode_argument_error(extensional(X0,X1,X2,X3,X4),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_TupleSet(X2,Y2) + -> (is_bool(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_extensional_297(Y0,Y1,Y2,Y3,Y4) + ; (is_Reify(X4,Y4) + -> gecode_constraint_extensional_298(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(extensional(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error(bool(X3)),gecode_argument_error(extensional(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('TupleSet'(X2)),gecode_argument_error(extensional(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(extensional(X0,X1,X2,X3,X4),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(extensional(X0,X1,X2,X3,X4),arg=1)))). + +extensional(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_TupleSet(X2,Y2) + -> (is_bool(X3,Y3) + -> (is_Reify(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_extensional_293(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(extensional(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(extensional(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error(bool(X3)),gecode_argument_error(extensional(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('TupleSet'(X2)),gecode_argument_error(extensional(X0,X1,X2,X3,X4,X5),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_TupleSet(X2,Y2) + -> (is_bool(X3,Y3) + -> (is_Reify(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_extensional_299(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(extensional(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(extensional(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error(bool(X3)),gecode_argument_error(extensional(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('TupleSet'(X2)),gecode_argument_error(extensional(X0,X1,X2,X3,X4,X5),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(extensional(X0,X1,X2,X3,X4,X5),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(extensional(X0,X1,X2,X3,X4,X5),arg=1)))). + +extensional(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_DFA(X2,Y2) + -> gecode_constraint_extensional_294(Y0,Y1,Y2) + ; throw(error(type_error('DFA'(X2)),gecode_argument_error(extensional(X0,X1,X2),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_DFA(X2,Y2) + -> gecode_constraint_extensional_300(Y0,Y1,Y2) + ; throw(error(type_error('DFA'(X2)),gecode_argument_error(extensional(X0,X1,X2),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(extensional(X0,X1,X2),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(extensional(X0,X1,X2),arg=1)))). + +ite(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVar(X1,Y1) + -> (is_BoolVar(X2,Y2) + -> (is_BoolVar(X3,Y3) + -> (is_BoolVar(X4,Y4) + -> gecode_constraint_ite_302(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('BoolVar'(X4)),gecode_argument_error(ite(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('BoolVar'(X3)),gecode_argument_error(ite(X0,X1,X2,X3,X4),arg=4)))) + ; (is_FloatVar(X2,Y2) + -> (is_FloatVar(X3,Y3) + -> (is_FloatVar(X4,Y4) + -> gecode_constraint_ite_304(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('FloatVar'(X4)),gecode_argument_error(ite(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('FloatVar'(X3)),gecode_argument_error(ite(X0,X1,X2,X3,X4),arg=4)))) + ; (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntVar(X4,Y4) + -> gecode_constraint_ite_305(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(ite(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(ite(X0,X1,X2,X3,X4),arg=4)))) + ; (is_SetVar(X2,Y2) + -> (is_SetVar(X3,Y3) + -> (is_SetVar(X4,Y4) + -> gecode_constraint_ite_307(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('SetVar'(X4)),gecode_argument_error(ite(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('SetVar'(X3)),gecode_argument_error(ite(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('SetVar'(X2)),gecode_argument_error(ite(X0,X1,X2,X3,X4),arg=3))))))) + ; throw(error(type_error('BoolVar'(X1)),gecode_argument_error(ite(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(ite(X0,X1,X2,X3,X4),arg=1)))). + +ite(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVar(X1,Y1) + -> (is_BoolVar(X2,Y2) + -> (is_BoolVar(X3,Y3) + -> (is_BoolVar(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_ite_303(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(ite(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('BoolVar'(X4)),gecode_argument_error(ite(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('BoolVar'(X3)),gecode_argument_error(ite(X0,X1,X2,X3,X4,X5),arg=4)))) + ; (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_ite_306(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(ite(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(ite(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(ite(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(ite(X0,X1,X2,X3,X4,X5),arg=3))))) + ; throw(error(type_error('BoolVar'(X1)),gecode_argument_error(ite(X0,X1,X2,X3,X4,X5),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(ite(X0,X1,X2,X3,X4,X5),arg=1)))). + +linear(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_int(X3,Y3) + -> gecode_constraint_linear_308(Y0,Y1,Y2,Y3) + ; (is_IntVar(X3,Y3) + -> gecode_constraint_linear_312(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(linear(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(linear(X0,X1,X2,X3),arg=3)))) + ; (is_FloatVarArgs(X1,Y1) + -> (is_FloatRelType(X2,Y2) + -> (is_FloatVal(X3,Y3) + -> gecode_constraint_linear_320(Y0,Y1,Y2,Y3) + ; (is_FloatVar(X3,Y3) + -> gecode_constraint_linear_322(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatVar'(X3)),gecode_argument_error(linear(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('FloatRelType'(X2)),gecode_argument_error(linear(X0,X1,X2,X3),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_int(X3,Y3) + -> gecode_constraint_linear_340(Y0,Y1,Y2,Y3) + ; (is_IntVar(X3,Y3) + -> gecode_constraint_linear_344(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(linear(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(linear(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(linear(X0,X1,X2,X3),arg=2)))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(linear(X0,X1,X2,X3),arg=1)))). + +linear(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_linear_309(Y0,Y1,Y2,Y3,Y4) + ; (is_Reify(X4,Y4) + -> gecode_constraint_linear_310(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=5))))) + ; (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_linear_313(Y0,Y1,Y2,Y3,Y4) + ; (is_Reify(X4,Y4) + -> gecode_constraint_linear_314(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=3)))) + ; (is_FloatValArgs(X1,Y1) + -> (is_FloatVarArgs(X2,Y2) + -> (is_FloatRelType(X3,Y3) + -> (is_FloatVal(X4,Y4) + -> gecode_constraint_linear_316(Y0,Y1,Y2,Y3,Y4) + ; (is_FloatVar(X4,Y4) + -> gecode_constraint_linear_318(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('FloatVar'(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('FloatRelType'(X3)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('FloatVarArgs'(X2)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=3)))) + ; (is_FloatVarArgs(X1,Y1) + -> (is_FloatRelType(X2,Y2) + -> (is_FloatVal(X3,Y3) + -> (is_Reify(X4,Y4) + -> gecode_constraint_linear_321(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=5)))) + ; (is_FloatVar(X3,Y3) + -> (is_Reify(X4,Y4) + -> gecode_constraint_linear_323(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('FloatVar'(X3)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=4))))) + ; throw(error(type_error('FloatRelType'(X2)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=3)))) + ; (is_IntArgs(X1,Y1) + -> (is_BoolVarArgs(X2,Y2) + -> (is_IntRelType(X3,Y3) + -> (is_int(X4,Y4) + -> gecode_constraint_linear_324(Y0,Y1,Y2,Y3,Y4) + ; (is_IntVar(X4,Y4) + -> gecode_constraint_linear_328(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('IntRelType'(X3)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=4)))) + ; (is_IntVarArgs(X2,Y2) + -> (is_IntRelType(X3,Y3) + -> (is_int(X4,Y4) + -> gecode_constraint_linear_332(Y0,Y1,Y2,Y3,Y4) + ; (is_IntVar(X4,Y4) + -> gecode_constraint_linear_336(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('IntRelType'(X3)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=3))))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_linear_341(Y0,Y1,Y2,Y3,Y4) + ; (is_Reify(X4,Y4) + -> gecode_constraint_linear_342(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=5))))) + ; (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_linear_345(Y0,Y1,Y2,Y3,Y4) + ; (is_Reify(X4,Y4) + -> gecode_constraint_linear_346(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=2)))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=1)))). + +linear(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_int(X3,Y3) + -> (is_Reify(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_linear_311(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=5)))) + ; (is_IntVar(X3,Y3) + -> (is_Reify(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_linear_315(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=3)))) + ; (is_FloatValArgs(X1,Y1) + -> (is_FloatVarArgs(X2,Y2) + -> (is_FloatRelType(X3,Y3) + -> (is_FloatVal(X4,Y4) + -> (is_Reify(X5,Y5) + -> gecode_constraint_linear_317(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('Reify'(X5)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=6)))) + ; (is_FloatVar(X4,Y4) + -> (is_Reify(X5,Y5) + -> gecode_constraint_linear_319(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('Reify'(X5)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('FloatVar'(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('FloatRelType'(X3)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('FloatVarArgs'(X2)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=3)))) + ; (is_IntArgs(X1,Y1) + -> (is_BoolVarArgs(X2,Y2) + -> (is_IntRelType(X3,Y3) + -> (is_int(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_linear_325(Y0,Y1,Y2,Y3,Y4,Y5) + ; (is_Reify(X5,Y5) + -> gecode_constraint_linear_326(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('Reify'(X5)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=6))))) + ; (is_IntVar(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_linear_329(Y0,Y1,Y2,Y3,Y4,Y5) + ; (is_Reify(X5,Y5) + -> gecode_constraint_linear_330(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('Reify'(X5)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=6))))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('IntRelType'(X3)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=4)))) + ; (is_IntVarArgs(X2,Y2) + -> (is_IntRelType(X3,Y3) + -> (is_int(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_linear_333(Y0,Y1,Y2,Y3,Y4,Y5) + ; (is_Reify(X5,Y5) + -> gecode_constraint_linear_334(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('Reify'(X5)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=6))))) + ; (is_IntVar(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_linear_337(Y0,Y1,Y2,Y3,Y4,Y5) + ; (is_Reify(X5,Y5) + -> gecode_constraint_linear_338(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('Reify'(X5)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=6))))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('IntRelType'(X3)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=3))))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_int(X3,Y3) + -> (is_Reify(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_linear_343(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=5)))) + ; (is_IntVar(X3,Y3) + -> (is_Reify(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_linear_347(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=2))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=1)))). + +linear(X0,X1,X2,X3,X4,X5,X6) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntArgs(X1,Y1) + -> (is_BoolVarArgs(X2,Y2) + -> (is_IntRelType(X3,Y3) + -> (is_int(X4,Y4) + -> (is_Reify(X5,Y5) + -> (is_IntPropLevel(X6,Y6) + -> gecode_constraint_linear_327(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntPropLevel'(X6)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('Reify'(X5)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; (is_IntVar(X4,Y4) + -> (is_Reify(X5,Y5) + -> (is_IntPropLevel(X6,Y6) + -> gecode_constraint_linear_331(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntPropLevel'(X6)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('Reify'(X5)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=5))))) + ; throw(error(type_error('IntRelType'(X3)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; (is_IntVarArgs(X2,Y2) + -> (is_IntRelType(X3,Y3) + -> (is_int(X4,Y4) + -> (is_Reify(X5,Y5) + -> (is_IntPropLevel(X6,Y6) + -> gecode_constraint_linear_335(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntPropLevel'(X6)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('Reify'(X5)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; (is_IntVar(X4,Y4) + -> (is_Reify(X5,Y5) + -> (is_IntPropLevel(X6,Y6) + -> gecode_constraint_linear_339(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntPropLevel'(X6)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('Reify'(X5)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=5))))) + ; throw(error(type_error('IntRelType'(X3)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=3))))) + ; throw(error(type_error('IntArgs'(X1)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=1)))). + +max(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_FloatVarArgs(X1,Y1) + -> (is_FloatVar(X2,Y2) + -> gecode_constraint_max_348(Y0,Y1,Y2) + ; throw(error(type_error('FloatVar'(X2)),gecode_argument_error(max(X0,X1,X2),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> gecode_constraint_max_349(Y0,Y1,Y2) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(max(X0,X1,X2),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(max(X0,X1,X2),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(max(X0,X1,X2),arg=1)))). + +max(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_max_350(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(max(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(max(X0,X1,X2,X3),arg=3)))) + ; (is_FloatVar(X1,Y1) + -> (is_FloatVar(X2,Y2) + -> (is_FloatVar(X3,Y3) + -> gecode_constraint_max_351(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatVar'(X3)),gecode_argument_error(max(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('FloatVar'(X2)),gecode_argument_error(max(X0,X1,X2,X3),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_max_352(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(max(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(max(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(max(X0,X1,X2,X3),arg=2)))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(max(X0,X1,X2,X3),arg=1)))). + +max(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_max_353(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(max(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(max(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(max(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(max(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(max(X0,X1,X2,X3,X4),arg=1)))). + +member(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_BoolVar(X2,Y2) + -> gecode_constraint_member_354(Y0,Y1,Y2) + ; throw(error(type_error('BoolVar'(X2)),gecode_argument_error(member(X0,X1,X2),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> gecode_constraint_member_358(Y0,Y1,Y2) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(member(X0,X1,X2),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(member(X0,X1,X2),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(member(X0,X1,X2),arg=1)))). + +member(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_BoolVar(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_member_355(Y0,Y1,Y2,Y3) + ; (is_Reify(X3,Y3) + -> gecode_constraint_member_356(Y0,Y1,Y2,Y3) + ; throw(error(type_error('Reify'(X3)),gecode_argument_error(member(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('BoolVar'(X2)),gecode_argument_error(member(X0,X1,X2,X3),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_member_359(Y0,Y1,Y2,Y3) + ; (is_Reify(X3,Y3) + -> gecode_constraint_member_360(Y0,Y1,Y2,Y3) + ; throw(error(type_error('Reify'(X3)),gecode_argument_error(member(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(member(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(member(X0,X1,X2,X3),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(member(X0,X1,X2,X3),arg=1)))). + +member(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_BoolVar(X2,Y2) + -> (is_Reify(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_member_357(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(member(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('Reify'(X3)),gecode_argument_error(member(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('BoolVar'(X2)),gecode_argument_error(member(X0,X1,X2,X3,X4),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_Reify(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_member_361(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(member(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('Reify'(X3)),gecode_argument_error(member(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(member(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(member(X0,X1,X2,X3,X4),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(member(X0,X1,X2,X3,X4),arg=1)))). + +min(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_FloatVarArgs(X1,Y1) + -> (is_FloatVar(X2,Y2) + -> gecode_constraint_min_362(Y0,Y1,Y2) + ; throw(error(type_error('FloatVar'(X2)),gecode_argument_error(min(X0,X1,X2),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> gecode_constraint_min_363(Y0,Y1,Y2) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(min(X0,X1,X2),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(min(X0,X1,X2),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(min(X0,X1,X2),arg=1)))). + +min(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_min_364(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(min(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(min(X0,X1,X2,X3),arg=3)))) + ; (is_FloatVar(X1,Y1) + -> (is_FloatVar(X2,Y2) + -> (is_FloatVar(X3,Y3) + -> gecode_constraint_min_365(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatVar'(X3)),gecode_argument_error(min(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('FloatVar'(X2)),gecode_argument_error(min(X0,X1,X2,X3),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_min_366(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(min(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(min(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(min(X0,X1,X2,X3),arg=2)))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(min(X0,X1,X2,X3),arg=1)))). + +min(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_min_367(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(min(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(min(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(min(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(min(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(min(X0,X1,X2,X3,X4),arg=1)))). + +mod(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_mod_368(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(mod(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(mod(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(mod(X0,X1,X2,X3),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(mod(X0,X1,X2,X3),arg=1)))). + +mod(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_mod_369(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(mod(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(mod(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(mod(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(mod(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(mod(X0,X1,X2,X3,X4),arg=1)))). + +mult(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_FloatVar(X1,Y1) + -> (is_FloatVar(X2,Y2) + -> (is_FloatVar(X3,Y3) + -> gecode_constraint_mult_370(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatVar'(X3)),gecode_argument_error(mult(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('FloatVar'(X2)),gecode_argument_error(mult(X0,X1,X2,X3),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_mult_371(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(mult(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(mult(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(mult(X0,X1,X2,X3),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(mult(X0,X1,X2,X3),arg=1)))). + +mult(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_mult_372(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(mult(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(mult(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(mult(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(mult(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(mult(X0,X1,X2,X3,X4),arg=1)))). + +nooverlap(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntArgs(X4,Y4) + -> (is_BoolVarArgs(X5,Y5) + -> gecode_constraint_nooverlap_373(Y0,Y1,Y2,Y3,Y4,Y5) + ; (is_IntPropLevel(X5,Y5) + -> gecode_constraint_nooverlap_376(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5),arg=6))))) + ; throw(error(type_error('IntArgs'(X4)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('IntArgs'(X2)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5),arg=1)))). + +nooverlap(X0,X1,X2,X3,X4,X5,X6) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntArgs(X4,Y4) + -> (is_BoolVarArgs(X5,Y5) + -> (is_IntPropLevel(X6,Y6) + -> gecode_constraint_nooverlap_374(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntPropLevel'(X6)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('BoolVarArgs'(X5)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('IntArgs'(X4)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; (is_IntVarArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntVarArgs(X5,Y5) + -> (is_IntVarArgs(X6,Y6) + -> gecode_constraint_nooverlap_379(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntVarArgs'(X6)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('IntVarArgs'(X5)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=3))))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=1)))). + +nooverlap(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntArgs(X4,Y4) + -> gecode_constraint_nooverlap_375(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntArgs'(X4)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntArgs'(X2)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4),arg=1)))). + +nooverlap(X0,X1,X2,X3,X4,X5,X6,X7) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntVarArgs(X5,Y5) + -> (is_IntVarArgs(X6,Y6) + -> (is_BoolVarArgs(X7,Y7) + -> gecode_constraint_nooverlap_377(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; (is_IntPropLevel(X7,Y7) + -> gecode_constraint_nooverlap_380(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error('IntPropLevel'(X7)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7),arg=8))))) + ; throw(error(type_error('IntVarArgs'(X6)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; throw(error(type_error('IntVarArgs'(X5)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7),arg=6)))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7),arg=1)))). + +nooverlap(X0,X1,X2,X3,X4,X5,X6,X7,X8) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntVarArgs(X4,Y4) + -> (is_IntVarArgs(X5,Y5) + -> (is_IntVarArgs(X6,Y6) + -> (is_BoolVarArgs(X7,Y7) + -> (is_IntPropLevel(X8,Y8) + -> gecode_constraint_nooverlap_378(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8) + ; throw(error(type_error('IntPropLevel'(X8)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=9)))) + ; throw(error(type_error('BoolVarArgs'(X7)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=8)))) + ; throw(error(type_error('IntVarArgs'(X6)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=7)))) + ; throw(error(type_error('IntVarArgs'(X5)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=6)))) + ; throw(error(type_error('IntVarArgs'(X4)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=1)))). + +nroot(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_FloatVar(X1,Y1) + -> (is_int(X2,Y2) + -> (is_FloatVar(X3,Y3) + -> gecode_constraint_nroot_381(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatVar'(X3)),gecode_argument_error(nroot(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(nroot(X0,X1,X2,X3),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_nroot_382(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(nroot(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(nroot(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(nroot(X0,X1,X2,X3),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(nroot(X0,X1,X2,X3),arg=1)))). + +nroot(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_nroot_383(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(nroot(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(nroot(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(nroot(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(nroot(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(nroot(X0,X1,X2,X3,X4),arg=1)))). + +nvalues(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_int(X3,Y3) + -> gecode_constraint_nvalues_384(Y0,Y1,Y2,Y3) + ; (is_IntVar(X3,Y3) + -> gecode_constraint_nvalues_386(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(nvalues(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(nvalues(X0,X1,X2,X3),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_int(X3,Y3) + -> gecode_constraint_nvalues_388(Y0,Y1,Y2,Y3) + ; (is_IntVar(X3,Y3) + -> gecode_constraint_nvalues_390(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(nvalues(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(nvalues(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(nvalues(X0,X1,X2,X3),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(nvalues(X0,X1,X2,X3),arg=1)))). + +nvalues(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_nvalues_385(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(nvalues(X0,X1,X2,X3,X4),arg=5)))) + ; (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_nvalues_387(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(nvalues(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(nvalues(X0,X1,X2,X3,X4),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(nvalues(X0,X1,X2,X3,X4),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_nvalues_389(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(nvalues(X0,X1,X2,X3,X4),arg=5)))) + ; (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_nvalues_391(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(nvalues(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(nvalues(X0,X1,X2,X3,X4),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(nvalues(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(nvalues(X0,X1,X2,X3,X4),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(nvalues(X0,X1,X2,X3,X4),arg=1)))). + +order(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_int(X4,Y4) + -> (is_BoolVar(X5,Y5) + -> gecode_constraint_order_392(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('BoolVar'(X5)),gecode_argument_error(order(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error(int(X4)),gecode_argument_error(order(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(order(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(order(X0,X1,X2,X3,X4,X5),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(order(X0,X1,X2,X3,X4,X5),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(order(X0,X1,X2,X3,X4,X5),arg=1)))). + +order(X0,X1,X2,X3,X4,X5,X6) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_int(X4,Y4) + -> (is_BoolVar(X5,Y5) + -> (is_IntPropLevel(X6,Y6) + -> gecode_constraint_order_393(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntPropLevel'(X6)),gecode_argument_error(order(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('BoolVar'(X5)),gecode_argument_error(order(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error(int(X4)),gecode_argument_error(order(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(order(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(order(X0,X1,X2,X3,X4,X5,X6),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(order(X0,X1,X2,X3,X4,X5,X6),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(order(X0,X1,X2,X3,X4,X5,X6),arg=1)))). + +path(X0,X1,X2,X3,X4,X5,X6) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_IntVarArgs(X5,Y5) + -> (is_IntVar(X6,Y6) + -> gecode_constraint_path_394(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntVar'(X6)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; (is_IntVar(X5,Y5) + -> (is_IntPropLevel(X6,Y6) + -> gecode_constraint_path_397(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntPropLevel'(X6)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('IntVar'(X5)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=6))))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; (is_int(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_IntVar(X5,Y5) + -> (is_IntVar(X6,Y6) + -> gecode_constraint_path_400(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntVar'(X6)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error('IntVar'(X5)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=3))))) + ; throw(error(type_error('IntArgs'(X1)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=1)))). + +path(X0,X1,X2,X3,X4,X5,X6,X7) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_IntVarArgs(X5,Y5) + -> (is_IntVar(X6,Y6) + -> (is_IntPropLevel(X7,Y7) + -> gecode_constraint_path_395(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error('IntPropLevel'(X7)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('IntVar'(X6)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))) + ; throw(error(type_error('IntVarArgs'(X5)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=4)))) + ; (is_int(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_IntVar(X5,Y5) + -> (is_IntVarArgs(X6,Y6) + -> (is_IntVar(X7,Y7) + -> gecode_constraint_path_398(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error('IntVar'(X7)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; (is_IntVar(X6,Y6) + -> (is_IntPropLevel(X7,Y7) + -> gecode_constraint_path_401(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7) + ; throw(error(type_error('IntPropLevel'(X7)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))) + ; throw(error(type_error('IntVar'(X6)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=7))))) + ; throw(error(type_error('IntVar'(X5)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=3))))) + ; throw(error(type_error('IntArgs'(X1)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=1)))). + +path(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_IntVar(X5,Y5) + -> gecode_constraint_path_396(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntVar'(X5)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5),arg=3)))) + ; (is_int(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_path_405(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5),arg=3)))) + ; throw(error(type_error(int(X1)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5),arg=1)))). + +path(X0,X1,X2,X3,X4,X5,X6,X7,X8) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntArgs(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntVar(X4,Y4) + -> (is_IntVar(X5,Y5) + -> (is_IntVarArgs(X6,Y6) + -> (is_IntVar(X7,Y7) + -> (is_IntPropLevel(X8,Y8) + -> gecode_constraint_path_399(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8) + ; throw(error(type_error('IntPropLevel'(X8)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=9)))) + ; throw(error(type_error('IntVar'(X7)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=8)))) + ; throw(error(type_error('IntVarArgs'(X6)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=7)))) + ; throw(error(type_error('IntVar'(X5)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=6)))) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=3)))) + ; throw(error(type_error('IntArgs'(X1)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=1)))). + +path(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_path_402(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(path(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(path(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(path(X0,X1,X2,X3),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(path(X0,X1,X2,X3),arg=1)))). + +path(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_path_403(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(path(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(path(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(path(X0,X1,X2,X3,X4),arg=3)))) + ; (is_int(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntVar(X4,Y4) + -> gecode_constraint_path_404(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntVar'(X4)),gecode_argument_error(path(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(path(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(path(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error(int(X1)),gecode_argument_error(path(X0,X1,X2,X3,X4),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(path(X0,X1,X2,X3,X4),arg=1)))). + +pow(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_FloatVar(X1,Y1) + -> (is_int(X2,Y2) + -> (is_FloatVar(X3,Y3) + -> gecode_constraint_pow_406(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatVar'(X3)),gecode_argument_error(pow(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(pow(X0,X1,X2,X3),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_pow_407(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(pow(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(pow(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(pow(X0,X1,X2,X3),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(pow(X0,X1,X2,X3),arg=1)))). + +pow(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_int(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_pow_408(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(pow(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(pow(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(pow(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(pow(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(pow(X0,X1,X2,X3,X4),arg=1)))). + +precede(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntArgs(X2,Y2) + -> gecode_constraint_precede_409(Y0,Y1,Y2) + ; throw(error(type_error('IntArgs'(X2)),gecode_argument_error(precede(X0,X1,X2),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(precede(X0,X1,X2),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(precede(X0,X1,X2),arg=1)))). + +precede(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntArgs(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_precede_410(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(precede(X0,X1,X2,X3),arg=4)))) + ; (is_int(X2,Y2) + -> (is_int(X3,Y3) + -> gecode_constraint_precede_411(Y0,Y1,Y2,Y3) + ; throw(error(type_error(int(X3)),gecode_argument_error(precede(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(precede(X0,X1,X2,X3),arg=3))))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(precede(X0,X1,X2,X3),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(precede(X0,X1,X2,X3),arg=1)))). + +precede(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_int(X2,Y2) + -> (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_precede_412(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(precede(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(precede(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error(int(X2)),gecode_argument_error(precede(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(precede(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(precede(X0,X1,X2,X3,X4),arg=1)))). + +relax(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_FloatVarArgs(X1,Y1) + -> (is_FloatVarArgs(X2,Y2) + -> (is_Rnd(X3,Y3) + -> (is_double(X4,Y4) + -> gecode_constraint_relax_413(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error(double(X4)),gecode_argument_error(relax(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('Rnd'(X3)),gecode_argument_error(relax(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('FloatVarArgs'(X2)),gecode_argument_error(relax(X0,X1,X2,X3,X4),arg=3)))) + ; (is_SetVarArgs(X1,Y1) + -> (is_SetVarArgs(X2,Y2) + -> (is_Rnd(X3,Y3) + -> (is_double(X4,Y4) + -> gecode_constraint_relax_414(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error(double(X4)),gecode_argument_error(relax(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('Rnd'(X3)),gecode_argument_error(relax(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('SetVarArgs'(X2)),gecode_argument_error(relax(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('SetVarArgs'(X1)),gecode_argument_error(relax(X0,X1,X2,X3,X4),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(relax(X0,X1,X2,X3,X4),arg=1)))). + +rel(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolOpType(X1,Y1) + -> (is_BoolVarArgs(X2,Y2) + -> (is_BoolVar(X3,Y3) + -> gecode_constraint_rel_415(Y0,Y1,Y2,Y3) + ; (is_int(X3,Y3) + -> gecode_constraint_rel_417(Y0,Y1,Y2,Y3) + ; throw(error(type_error(int(X3)),gecode_argument_error(rel(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('BoolVarArgs'(X2)),gecode_argument_error(rel(X0,X1,X2,X3),arg=3)))) + ; (is_BoolVar(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_BoolVar(X3,Y3) + -> gecode_constraint_rel_423(Y0,Y1,Y2,Y3) + ; (is_int(X3,Y3) + -> gecode_constraint_rel_427(Y0,Y1,Y2,Y3) + ; throw(error(type_error(int(X3)),gecode_argument_error(rel(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3),arg=3)))) + ; (is_BoolVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_BoolVar(X3,Y3) + -> gecode_constraint_rel_431(Y0,Y1,Y2,Y3) + ; (is_BoolVarArgs(X3,Y3) + -> gecode_constraint_rel_433(Y0,Y1,Y2,Y3) + ; (is_IntArgs(X3,Y3) + -> gecode_constraint_rel_435(Y0,Y1,Y2,Y3) + ; (is_int(X3,Y3) + -> gecode_constraint_rel_437(Y0,Y1,Y2,Y3) + ; (is_IntPropLevel(X3,Y3) + -> gecode_constraint_rel_440(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(rel(X0,X1,X2,X3),arg=4)))))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3),arg=3)))) + ; (is_FloatVarArgs(X1,Y1) + -> (is_FloatRelType(X2,Y2) + -> (is_FloatVal(X3,Y3) + -> gecode_constraint_rel_441(Y0,Y1,Y2,Y3) + ; (is_FloatVar(X3,Y3) + -> gecode_constraint_rel_442(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatVar'(X3)),gecode_argument_error(rel(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('FloatRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3),arg=3)))) + ; (is_IntArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_BoolVarArgs(X3,Y3) + -> gecode_constraint_rel_443(Y0,Y1,Y2,Y3) + ; (is_IntVarArgs(X3,Y3) + -> gecode_constraint_rel_445(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(rel(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> gecode_constraint_rel_447(Y0,Y1,Y2,Y3) + ; (is_IntVarArgs(X3,Y3) + -> gecode_constraint_rel_449(Y0,Y1,Y2,Y3) + ; (is_int(X3,Y3) + -> gecode_constraint_rel_451(Y0,Y1,Y2,Y3) + ; (is_IntPropLevel(X3,Y3) + -> gecode_constraint_rel_454(Y0,Y1,Y2,Y3) + ; (is_IntVar(X3,Y3) + -> gecode_constraint_rel_455(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(rel(X0,X1,X2,X3),arg=4)))))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3),arg=3)))) + ; (is_FloatVar(X1,Y1) + -> (is_FloatRelType(X2,Y2) + -> (is_FloatVal(X3,Y3) + -> gecode_constraint_rel_457(Y0,Y1,Y2,Y3) + ; (is_FloatVar(X3,Y3) + -> gecode_constraint_rel_459(Y0,Y1,Y2,Y3) + ; throw(error(type_error('FloatVar'(X3)),gecode_argument_error(rel(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('FloatRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_int(X3,Y3) + -> gecode_constraint_rel_461(Y0,Y1,Y2,Y3) + ; (is_IntVar(X3,Y3) + -> gecode_constraint_rel_465(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(rel(X0,X1,X2,X3),arg=4))))) + ; (is_SetRelType(X2,Y2) + -> (is_SetVar(X3,Y3) + -> gecode_constraint_rel_469(Y0,Y1,Y2,Y3) + ; throw(error(type_error('SetVar'(X3)),gecode_argument_error(rel(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('SetRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3),arg=3))))) + ; (is_SetVar(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_rel_471(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(rel(X0,X1,X2,X3),arg=4)))) + ; (is_SetRelType(X2,Y2) + -> (is_IntVar(X3,Y3) + -> gecode_constraint_rel_473(Y0,Y1,Y2,Y3) + ; (is_SetVar(X3,Y3) + -> gecode_constraint_rel_475(Y0,Y1,Y2,Y3) + ; throw(error(type_error('SetVar'(X3)),gecode_argument_error(rel(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('SetRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3),arg=3))))) + ; throw(error(type_error('SetVar'(X1)),gecode_argument_error(rel(X0,X1,X2,X3),arg=2)))))))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(rel(X0,X1,X2,X3),arg=1)))). + +rel(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolOpType(X1,Y1) + -> (is_BoolVarArgs(X2,Y2) + -> (is_BoolVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_416(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_418(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4))))) + ; throw(error(type_error('BoolVarArgs'(X2)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=3)))) + ; (is_BoolVar(X1,Y1) + -> (is_BoolOpType(X2,Y2) + -> (is_BoolVar(X3,Y3) + -> (is_BoolVar(X4,Y4) + -> gecode_constraint_rel_419(Y0,Y1,Y2,Y3,Y4) + ; (is_int(X4,Y4) + -> gecode_constraint_rel_421(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error(int(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('BoolVar'(X3)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4)))) + ; (is_IntRelType(X2,Y2) + -> (is_BoolVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_424(Y0,Y1,Y2,Y3,Y4) + ; (is_Reify(X4,Y4) + -> gecode_constraint_rel_425(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5))))) + ; (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_428(Y0,Y1,Y2,Y3,Y4) + ; (is_Reify(X4,Y4) + -> gecode_constraint_rel_429(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error(int(X3)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=3))))) + ; (is_BoolVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_BoolVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_432(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; (is_BoolVarArgs(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_434(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; (is_IntArgs(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_436(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_438(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4))))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=3)))) + ; (is_IntArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_BoolVarArgs(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_444(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; (is_IntVarArgs(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_446(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_448(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; (is_IntVarArgs(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_450(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_452(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_456(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4))))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=3)))) + ; (is_FloatVar(X1,Y1) + -> (is_FloatRelType(X2,Y2) + -> (is_FloatVal(X3,Y3) + -> (is_Reify(X4,Y4) + -> gecode_constraint_rel_458(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; (is_FloatVar(X3,Y3) + -> (is_Reify(X4,Y4) + -> gecode_constraint_rel_460(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('FloatVar'(X3)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4))))) + ; throw(error(type_error('FloatRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_int(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_462(Y0,Y1,Y2,Y3,Y4) + ; (is_Reify(X4,Y4) + -> gecode_constraint_rel_463(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5))))) + ; (is_IntVar(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_rel_466(Y0,Y1,Y2,Y3,Y4) + ; (is_Reify(X4,Y4) + -> gecode_constraint_rel_467(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4))))) + ; (is_SetRelType(X2,Y2) + -> (is_SetVar(X3,Y3) + -> (is_Reify(X4,Y4) + -> gecode_constraint_rel_470(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('SetVar'(X3)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('SetRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=3))))) + ; (is_SetVar(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_Reify(X4,Y4) + -> gecode_constraint_rel_472(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4)))) + ; (is_SetRelType(X2,Y2) + -> (is_IntVar(X3,Y3) + -> (is_Reify(X4,Y4) + -> gecode_constraint_rel_474(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; (is_SetVar(X3,Y3) + -> (is_Reify(X4,Y4) + -> gecode_constraint_rel_476(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('SetVar'(X3)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4))))) + ; throw(error(type_error('SetRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=3))))) + ; throw(error(type_error('SetVar'(X1)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=2))))))))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=1)))). + +rel(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVar(X1,Y1) + -> (is_BoolOpType(X2,Y2) + -> (is_BoolVar(X3,Y3) + -> (is_BoolVar(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_rel_420(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=6)))) + ; (is_int(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_rel_422(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error(int(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=5))))) + ; throw(error(type_error('BoolVar'(X3)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=4)))) + ; (is_IntRelType(X2,Y2) + -> (is_BoolVar(X3,Y3) + -> (is_Reify(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_rel_426(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=5)))) + ; (is_int(X3,Y3) + -> (is_Reify(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_rel_430(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=3))))) + ; (is_IntVar(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> (is_int(X3,Y3) + -> (is_Reify(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_rel_464(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=5)))) + ; (is_IntVar(X3,Y3) + -> (is_Reify(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_rel_468(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('Reify'(X4)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVar'(X3)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=4))))) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=1)))). + +rel(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> gecode_constraint_rel_439(Y0,Y1,Y2) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(rel(X0,X1,X2),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntRelType(X2,Y2) + -> gecode_constraint_rel_453(Y0,Y1,Y2) + ; throw(error(type_error('IntRelType'(X2)),gecode_argument_error(rel(X0,X1,X2),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(rel(X0,X1,X2),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(rel(X0,X1,X2),arg=1)))). + +sequence(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_IntSet(X2,Y2) + -> (is_int(X3,Y3) + -> (is_int(X4,Y4) + -> (is_int(X5,Y5) + -> gecode_constraint_sequence_477(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error(int(X5)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error(int(X4)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('IntSet'(X2)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntSet(X2,Y2) + -> (is_int(X3,Y3) + -> (is_int(X4,Y4) + -> (is_int(X5,Y5) + -> gecode_constraint_sequence_479(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error(int(X5)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error(int(X4)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('IntSet'(X2)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5),arg=1)))). + +sequence(X0,X1,X2,X3,X4,X5,X6) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_IntSet(X2,Y2) + -> (is_int(X3,Y3) + -> (is_int(X4,Y4) + -> (is_int(X5,Y5) + -> (is_IntPropLevel(X6,Y6) + -> gecode_constraint_sequence_478(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntPropLevel'(X6)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error(int(X5)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error(int(X4)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; throw(error(type_error('IntSet'(X2)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntSet(X2,Y2) + -> (is_int(X3,Y3) + -> (is_int(X4,Y4) + -> (is_int(X5,Y5) + -> (is_IntPropLevel(X6,Y6) + -> gecode_constraint_sequence_480(Y0,Y1,Y2,Y3,Y4,Y5,Y6) + ; throw(error(type_error('IntPropLevel'(X6)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=7)))) + ; throw(error(type_error(int(X5)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=6)))) + ; throw(error(type_error(int(X4)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=5)))) + ; throw(error(type_error(int(X3)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=4)))) + ; throw(error(type_error('IntSet'(X2)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=1)))). + +sorted(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> gecode_constraint_sorted_481(Y0,Y1,Y2,Y3) + ; (is_IntPropLevel(X3,Y3) + -> gecode_constraint_sorted_484(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(sorted(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(sorted(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(sorted(X0,X1,X2,X3),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(sorted(X0,X1,X2,X3),arg=1)))). + +sorted(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_sorted_482(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(sorted(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(sorted(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(sorted(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(sorted(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(sorted(X0,X1,X2,X3,X4),arg=1)))). + +sorted(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> gecode_constraint_sorted_483(Y0,Y1,Y2) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(sorted(X0,X1,X2),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(sorted(X0,X1,X2),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(sorted(X0,X1,X2),arg=1)))). + +sqr(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_FloatVar(X1,Y1) + -> (is_FloatVar(X2,Y2) + -> gecode_constraint_sqr_485(Y0,Y1,Y2) + ; throw(error(type_error('FloatVar'(X2)),gecode_argument_error(sqr(X0,X1,X2),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> gecode_constraint_sqr_486(Y0,Y1,Y2) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(sqr(X0,X1,X2),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(sqr(X0,X1,X2),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(sqr(X0,X1,X2),arg=1)))). + +sqr(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_sqr_487(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(sqr(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(sqr(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(sqr(X0,X1,X2,X3),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(sqr(X0,X1,X2,X3),arg=1)))). + +sqrt(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_FloatVar(X1,Y1) + -> (is_FloatVar(X2,Y2) + -> gecode_constraint_sqrt_488(Y0,Y1,Y2) + ; throw(error(type_error('FloatVar'(X2)),gecode_argument_error(sqrt(X0,X1,X2),arg=3)))) + ; (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> gecode_constraint_sqrt_489(Y0,Y1,Y2) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(sqrt(X0,X1,X2),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(sqrt(X0,X1,X2),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(sqrt(X0,X1,X2),arg=1)))). + +sqrt(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVar(X1,Y1) + -> (is_IntVar(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_sqrt_490(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(sqrt(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVar'(X2)),gecode_argument_error(sqrt(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('IntVar'(X1)),gecode_argument_error(sqrt(X0,X1,X2,X3),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(sqrt(X0,X1,X2,X3),arg=1)))). + +unary(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntArgs(X2,Y2) + -> (is_BoolVarArgs(X3,Y3) + -> gecode_constraint_unary_491(Y0,Y1,Y2,Y3) + ; (is_IntPropLevel(X3,Y3) + -> gecode_constraint_unary_494(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntPropLevel'(X3)),gecode_argument_error(unary(X0,X1,X2,X3),arg=4))))) + ; (is_IntVarArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> gecode_constraint_unary_497(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(unary(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(unary(X0,X1,X2,X3),arg=3))))) + ; (is_TaskTypeArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> gecode_constraint_unary_501(Y0,Y1,Y2,Y3) + ; throw(error(type_error('IntArgs'(X3)),gecode_argument_error(unary(X0,X1,X2,X3),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(unary(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('TaskTypeArgs'(X1)),gecode_argument_error(unary(X0,X1,X2,X3),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(unary(X0,X1,X2,X3),arg=1)))). + +unary(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntArgs(X2,Y2) + -> (is_BoolVarArgs(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_unary_492(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(unary(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('BoolVarArgs'(X3)),gecode_argument_error(unary(X0,X1,X2,X3,X4),arg=4)))) + ; (is_IntVarArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_BoolVarArgs(X4,Y4) + -> gecode_constraint_unary_495(Y0,Y1,Y2,Y3,Y4) + ; (is_IntPropLevel(X4,Y4) + -> gecode_constraint_unary_498(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(unary(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(unary(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(unary(X0,X1,X2,X3,X4),arg=3))))) + ; (is_TaskTypeArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_BoolVarArgs(X4,Y4) + -> gecode_constraint_unary_499(Y0,Y1,Y2,Y3,Y4) + ; (is_IntPropLevel(X4,Y4) + -> gecode_constraint_unary_502(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(unary(X0,X1,X2,X3,X4),arg=5))))) + ; throw(error(type_error('IntArgs'(X3)),gecode_argument_error(unary(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(unary(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('TaskTypeArgs'(X1)),gecode_argument_error(unary(X0,X1,X2,X3,X4),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(unary(X0,X1,X2,X3,X4),arg=1)))). + +unary(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntArgs(X2,Y2) + -> gecode_constraint_unary_493(Y0,Y1,Y2) + ; throw(error(type_error('IntArgs'(X2)),gecode_argument_error(unary(X0,X1,X2),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(unary(X0,X1,X2),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(unary(X0,X1,X2),arg=1)))). + +unary(X0,X1,X2,X3,X4,X5) :- + (is_Space_or_Clause(X0,Y0) + -> (is_IntVarArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntVarArgs(X3,Y3) + -> (is_BoolVarArgs(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_unary_496(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(unary(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('BoolVarArgs'(X4)),gecode_argument_error(unary(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntVarArgs'(X3)),gecode_argument_error(unary(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(unary(X0,X1,X2,X3,X4,X5),arg=3)))) + ; (is_TaskTypeArgs(X1,Y1) + -> (is_IntVarArgs(X2,Y2) + -> (is_IntArgs(X3,Y3) + -> (is_BoolVarArgs(X4,Y4) + -> (is_IntPropLevel(X5,Y5) + -> gecode_constraint_unary_500(Y0,Y1,Y2,Y3,Y4,Y5) + ; throw(error(type_error('IntPropLevel'(X5)),gecode_argument_error(unary(X0,X1,X2,X3,X4,X5),arg=6)))) + ; throw(error(type_error('BoolVarArgs'(X4)),gecode_argument_error(unary(X0,X1,X2,X3,X4,X5),arg=5)))) + ; throw(error(type_error('IntArgs'(X3)),gecode_argument_error(unary(X0,X1,X2,X3,X4,X5),arg=4)))) + ; throw(error(type_error('IntVarArgs'(X2)),gecode_argument_error(unary(X0,X1,X2,X3,X4,X5),arg=3)))) + ; throw(error(type_error('TaskTypeArgs'(X1)),gecode_argument_error(unary(X0,X1,X2,X3,X4,X5),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(unary(X0,X1,X2,X3,X4,X5),arg=1)))). + +unshare(X0,X1) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> gecode_constraint_unshare_503(Y0,Y1) + ; (is_IntVarArgs(X1,Y1) + -> gecode_constraint_unshare_505(Y0,Y1) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(unshare(X0,X1),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(unshare(X0,X1),arg=1)))). + +unshare(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVarArgs(X1,Y1) + -> (is_IntPropLevel(X2,Y2) + -> gecode_constraint_unshare_504(Y0,Y1,Y2) + ; throw(error(type_error('IntPropLevel'(X2)),gecode_argument_error(unshare(X0,X1,X2),arg=3)))) + ; (is_IntVarArgs(X1,Y1) + -> (is_IntPropLevel(X2,Y2) + -> gecode_constraint_unshare_506(Y0,Y1,Y2) + ; throw(error(type_error('IntPropLevel'(X2)),gecode_argument_error(unshare(X0,X1,X2),arg=3)))) + ; throw(error(type_error('IntVarArgs'(X1)),gecode_argument_error(unshare(X0,X1,X2),arg=2))))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(unshare(X0,X1,X2),arg=1)))). + +when(X0,X1,X2) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVar(X1,Y1) + -> (is_std_function(X2,Y2) + -> gecode_constraint_when_507(Y0,Y1,Y2) + ; throw(error(type_error('std::function'(X2)),gecode_argument_error(when(X0,X1,X2),arg=3)))) + ; throw(error(type_error('BoolVar'(X1)),gecode_argument_error(when(X0,X1,X2),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(when(X0,X1,X2),arg=1)))). + +when(X0,X1,X2,X3) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVar(X1,Y1) + -> (is_std_function(X2,Y2) + -> (is_IntPropLevel(X3,Y3) + -> gecode_constraint_when_508(Y0,Y1,Y2,Y3) + ; (is_std_function(X3,Y3) + -> gecode_constraint_when_509(Y0,Y1,Y2,Y3) + ; throw(error(type_error('std::function'(X3)),gecode_argument_error(when(X0,X1,X2,X3),arg=4))))) + ; throw(error(type_error('std::function'(X2)),gecode_argument_error(when(X0,X1,X2,X3),arg=3)))) + ; throw(error(type_error('BoolVar'(X1)),gecode_argument_error(when(X0,X1,X2,X3),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(when(X0,X1,X2,X3),arg=1)))). + +when(X0,X1,X2,X3,X4) :- + (is_Space_or_Clause(X0,Y0) + -> (is_BoolVar(X1,Y1) + -> (is_std_function(X2,Y2) + -> (is_std_function(X3,Y3) + -> (is_IntPropLevel(X4,Y4) + -> gecode_constraint_when_510(Y0,Y1,Y2,Y3,Y4) + ; throw(error(type_error('IntPropLevel'(X4)),gecode_argument_error(when(X0,X1,X2,X3,X4),arg=5)))) + ; throw(error(type_error('std::function'(X3)),gecode_argument_error(when(X0,X1,X2,X3,X4),arg=4)))) + ; throw(error(type_error('std::function'(X2)),gecode_argument_error(when(X0,X1,X2,X3,X4),arg=3)))) + ; throw(error(type_error('BoolVar'(X1)),gecode_argument_error(when(X0,X1,X2,X3,X4),arg=2)))) + ; throw(error(type_error('Space'(X0)),gecode_argument_error(when(X0,X1,X2,X3,X4),arg=1)))). + diff --git a/packages/gecode/6.2.0/gecode_yap_cc_forward_auto_generated.icc b/packages/gecode/6.2.0/gecode_yap_cc_forward_auto_generated.icc new file mode 100644 index 000000000..dd1196994 --- /dev/null +++ b/packages/gecode/6.2.0/gecode_yap_cc_forward_auto_generated.icc @@ -0,0 +1,28 @@ +// -*- c++ -*- +//============================================================================= +// Copyright (C) 2011 by Denys Duchier +// +// This program is free software: you can redistribute it and/or modify it +// under the terms of the GNU Lesser General Public License as published by the +// Free Software Foundation, either version 3 of the License, or (at your +// option) any later version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +// more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . +//============================================================================= + +static RestartMode gecode_RestartMode_from_term(YAP_Term); +static FloatRelType gecode_FloatRelType_from_term(YAP_Term); +static ReifyMode gecode_ReifyMode_from_term(YAP_Term); +static IntRelType gecode_IntRelType_from_term(YAP_Term); +static BoolOpType gecode_BoolOpType_from_term(YAP_Term); +static IntPropLevel gecode_IntPropLevel_from_term(YAP_Term); +static TaskType gecode_TaskType_from_term(YAP_Term); +static TraceEvent gecode_TraceEvent_from_term(YAP_Term); +static SetRelType gecode_SetRelType_from_term(YAP_Term); +static SetOpType gecode_SetOpType_from_term(YAP_Term); diff --git a/packages/gecode/6.2.0/gecode_yap_cc_impl_auto_generated.icc b/packages/gecode/6.2.0/gecode_yap_cc_impl_auto_generated.icc new file mode 100644 index 000000000..3b306cf25 --- /dev/null +++ b/packages/gecode/6.2.0/gecode_yap_cc_impl_auto_generated.icc @@ -0,0 +1,5768 @@ +// -*- c++ -*- +//============================================================================= +// Copyright (C) 2011 by Denys Duchier +// +// This program is free software: you can redistribute it and/or modify it +// under the terms of the GNU Lesser General Public License as published by the +// Free Software Foundation, either version 3 of the License, or (at your +// option) any later version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +// more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . +//============================================================================= + +static YAP_Term gecode_RM_NONE; +static YAP_Term gecode_RM_CONSTANT; +static YAP_Term gecode_RM_LINEAR; +static YAP_Term gecode_RM_LUBY; +static YAP_Term gecode_RM_GEOMETRIC; + +static RestartMode gecode_RestartMode_from_term(YAP_Term X) +{ + if (X==gecode_RM_NONE) return RM_NONE; + if (X==gecode_RM_CONSTANT) return RM_CONSTANT; + if (X==gecode_RM_LINEAR) return RM_LINEAR; + if (X==gecode_RM_LUBY) return RM_LUBY; + if (X==gecode_RM_GEOMETRIC) return RM_GEOMETRIC; + cerr << "this should never happen" << endl; exit(1); +} + +static YAP_Term gecode_FRT_EQ; +static YAP_Term gecode_FRT_NQ; +static YAP_Term gecode_FRT_LQ; +static YAP_Term gecode_FRT_LE; +static YAP_Term gecode_FRT_GQ; +static YAP_Term gecode_FRT_GR; + +static FloatRelType gecode_FloatRelType_from_term(YAP_Term X) +{ + if (X==gecode_FRT_EQ) return FRT_EQ; + if (X==gecode_FRT_NQ) return FRT_NQ; + if (X==gecode_FRT_LQ) return FRT_LQ; + if (X==gecode_FRT_LE) return FRT_LE; + if (X==gecode_FRT_GQ) return FRT_GQ; + if (X==gecode_FRT_GR) return FRT_GR; + cerr << "this should never happen" << endl; exit(1); +} + +static YAP_Term gecode_RM_EQV; +static YAP_Term gecode_RM_IMP; +static YAP_Term gecode_RM_PMI; + +static ReifyMode gecode_ReifyMode_from_term(YAP_Term X) +{ + if (X==gecode_RM_EQV) return RM_EQV; + if (X==gecode_RM_IMP) return RM_IMP; + if (X==gecode_RM_PMI) return RM_PMI; + cerr << "this should never happen" << endl; exit(1); +} + +static YAP_Term gecode_IRT_EQ; +static YAP_Term gecode_IRT_NQ; +static YAP_Term gecode_IRT_LQ; +static YAP_Term gecode_IRT_LE; +static YAP_Term gecode_IRT_GQ; +static YAP_Term gecode_IRT_GR; + +static IntRelType gecode_IntRelType_from_term(YAP_Term X) +{ + if (X==gecode_IRT_EQ) return IRT_EQ; + if (X==gecode_IRT_NQ) return IRT_NQ; + if (X==gecode_IRT_LQ) return IRT_LQ; + if (X==gecode_IRT_LE) return IRT_LE; + if (X==gecode_IRT_GQ) return IRT_GQ; + if (X==gecode_IRT_GR) return IRT_GR; + cerr << "this should never happen" << endl; exit(1); +} + +static YAP_Term gecode_BOT_AND; +static YAP_Term gecode_BOT_OR; +static YAP_Term gecode_BOT_IMP; +static YAP_Term gecode_BOT_EQV; +static YAP_Term gecode_BOT_XOR; + +static BoolOpType gecode_BoolOpType_from_term(YAP_Term X) +{ + if (X==gecode_BOT_AND) return BOT_AND; + if (X==gecode_BOT_OR) return BOT_OR; + if (X==gecode_BOT_IMP) return BOT_IMP; + if (X==gecode_BOT_EQV) return BOT_EQV; + if (X==gecode_BOT_XOR) return BOT_XOR; + cerr << "this should never happen" << endl; exit(1); +} + +static YAP_Term gecode_IPL_DEF; +static YAP_Term gecode_IPL_VAL; +static YAP_Term gecode_IPL_BND; +static YAP_Term gecode_IPL_DOM; +static YAP_Term gecode_IPL_BASIC; +static YAP_Term gecode_IPL_ADVANCED; +static YAP_Term gecode_IPL_BASIC_ADVANCED; +static YAP_Term gecode__IPL_BITS; + +static IntPropLevel gecode_IntPropLevel_from_term(YAP_Term X) +{ + if (X==gecode_IPL_DEF) return IPL_DEF; + if (X==gecode_IPL_VAL) return IPL_VAL; + if (X==gecode_IPL_BND) return IPL_BND; + if (X==gecode_IPL_DOM) return IPL_DOM; + if (X==gecode_IPL_BASIC) return IPL_BASIC; + if (X==gecode_IPL_ADVANCED) return IPL_ADVANCED; + if (X==gecode_IPL_BASIC_ADVANCED) return IPL_BASIC_ADVANCED; + if (X==gecode__IPL_BITS) return _IPL_BITS; + cerr << "this should never happen" << endl; exit(1); +} + +static YAP_Term gecode_TT_FIXP; +static YAP_Term gecode_TT_FIXS; +static YAP_Term gecode_TT_FIXE; + +static TaskType gecode_TaskType_from_term(YAP_Term X) +{ + if (X==gecode_TT_FIXP) return TT_FIXP; + if (X==gecode_TT_FIXS) return TT_FIXS; + if (X==gecode_TT_FIXE) return TT_FIXE; + cerr << "this should never happen" << endl; exit(1); +} + +static YAP_Term gecode_TE_INIT; +static YAP_Term gecode_TE_PRUNE; +static YAP_Term gecode_TE_FIX; +static YAP_Term gecode_TE_FAIL; +static YAP_Term gecode_TE_DONE; +static YAP_Term gecode_TE_PROPAGATE; +static YAP_Term gecode_TE_COMMIT; +static YAP_Term gecode_TE_POST; + +static TraceEvent gecode_TraceEvent_from_term(YAP_Term X) +{ + if (X==gecode_TE_INIT) return TE_INIT; + if (X==gecode_TE_PRUNE) return TE_PRUNE; + if (X==gecode_TE_FIX) return TE_FIX; + if (X==gecode_TE_FAIL) return TE_FAIL; + if (X==gecode_TE_DONE) return TE_DONE; + if (X==gecode_TE_PROPAGATE) return TE_PROPAGATE; + if (X==gecode_TE_COMMIT) return TE_COMMIT; + if (X==gecode_TE_POST) return TE_POST; + cerr << "this should never happen" << endl; exit(1); +} + +static YAP_Term gecode_SRT_EQ; +static YAP_Term gecode_SRT_NQ; +static YAP_Term gecode_SRT_SUB; +static YAP_Term gecode_SRT_SUP; +static YAP_Term gecode_SRT_DISJ; +static YAP_Term gecode_SRT_CMPL; +static YAP_Term gecode_SRT_LQ; +static YAP_Term gecode_SRT_LE; +static YAP_Term gecode_SRT_GQ; +static YAP_Term gecode_SRT_GR; + +static SetRelType gecode_SetRelType_from_term(YAP_Term X) +{ + if (X==gecode_SRT_EQ) return SRT_EQ; + if (X==gecode_SRT_NQ) return SRT_NQ; + if (X==gecode_SRT_SUB) return SRT_SUB; + if (X==gecode_SRT_SUP) return SRT_SUP; + if (X==gecode_SRT_DISJ) return SRT_DISJ; + if (X==gecode_SRT_CMPL) return SRT_CMPL; + if (X==gecode_SRT_LQ) return SRT_LQ; + if (X==gecode_SRT_LE) return SRT_LE; + if (X==gecode_SRT_GQ) return SRT_GQ; + if (X==gecode_SRT_GR) return SRT_GR; + cerr << "this should never happen" << endl; exit(1); +} + +static YAP_Term gecode_SOT_UNION; +static YAP_Term gecode_SOT_DUNION; +static YAP_Term gecode_SOT_INTER; +static YAP_Term gecode_SOT_MINUS; + +static SetOpType gecode_SetOpType_from_term(YAP_Term X) +{ + if (X==gecode_SOT_UNION) return SOT_UNION; + if (X==gecode_SOT_DUNION) return SOT_DUNION; + if (X==gecode_SOT_INTER) return SOT_INTER; + if (X==gecode_SOT_MINUS) return SOT_MINUS; + cerr << "this should never happen" << endl; exit(1); +} + +static YAP_Bool gecode_constraint_branch_1(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + std::function X2 = gecode_std_function_from_term(YAP_ARG2); + branch(*space,X2); + return TRUE; +} + +static YAP_Bool gecode_constraint_convex_2(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + convex(*space,X2); + return TRUE; +} + +static YAP_Bool gecode_constraint_convex_3(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetVar X3 = gecode_SetVar_from_term(space,YAP_ARG3); + convex(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_abs_4(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatVar X3 = gecode_FloatVar_from_term(space,YAP_ARG3); + abs(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_abs_5(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + abs(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_abs_6(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + abs(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmax_7(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + argmax(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmax_11(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + bool X4 = gecode_bool_from_term(YAP_ARG4); + argmax(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmax_13(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + argmax(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmax_17(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + bool X4 = gecode_bool_from_term(YAP_ARG4); + argmax(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmax_8(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + bool X5 = gecode_bool_from_term(YAP_ARG5); + argmax(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmax_12(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + bool X4 = gecode_bool_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + argmax(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmax_14(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + bool X5 = gecode_bool_from_term(YAP_ARG5); + argmax(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmax_18(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + bool X4 = gecode_bool_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + argmax(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmax_9(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + bool X5 = gecode_bool_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + argmax(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmax_15(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + bool X5 = gecode_bool_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + argmax(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmax_10(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + argmax(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmax_16(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + argmax(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmin_19(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + argmin(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmin_23(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + bool X4 = gecode_bool_from_term(YAP_ARG4); + argmin(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmin_25(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + argmin(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmin_29(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + bool X4 = gecode_bool_from_term(YAP_ARG4); + argmin(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmin_20(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + bool X5 = gecode_bool_from_term(YAP_ARG5); + argmin(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmin_24(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + bool X4 = gecode_bool_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + argmin(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmin_26(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + bool X5 = gecode_bool_from_term(YAP_ARG5); + argmin(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmin_30(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + bool X4 = gecode_bool_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + argmin(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmin_21(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + bool X5 = gecode_bool_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + argmin(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmin_27(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + bool X5 = gecode_bool_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + argmin(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmin_22(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + argmin(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_argmin_28(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + argmin(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_31(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + BoolAssign X3 = gecode_BoolAssign_from_term(YAP_ARG3); + assign(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_57(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatAssign X3 = gecode_FloatAssign_from_term(YAP_ARG3); + assign(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_59(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntAssign X3 = gecode_IntAssign_from_term(YAP_ARG3); + assign(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_61(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetAssign X3 = gecode_SetAssign_from_term(YAP_ARG3); + assign(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_32(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + BoolAssign X3 = gecode_BoolAssign_from_term(YAP_ARG3); + BoolVarValPrint X4 = gecode_BoolVarValPrint_from_term(YAP_ARG4); + assign(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_33(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + BoolVarBranch X3 = gecode_BoolVarBranch_from_term(YAP_ARG3); + BoolAssign X4 = gecode_BoolAssign_from_term(YAP_ARG4); + assign(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_36(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_BoolVarBranch_from_term(YAP_ARG3); + BoolAssign X4 = gecode_BoolAssign_from_term(YAP_ARG4); + assign(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_39(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatVarBranch X3 = gecode_FloatVarBranch_from_term(YAP_ARG3); + FloatAssign X4 = gecode_FloatAssign_from_term(YAP_ARG4); + assign(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_42(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_FloatVarBranch_from_term(YAP_ARG3); + FloatAssign X4 = gecode_FloatAssign_from_term(YAP_ARG4); + assign(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_45(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarBranch X3 = gecode_IntVarBranch_from_term(YAP_ARG3); + IntAssign X4 = gecode_IntAssign_from_term(YAP_ARG4); + assign(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_48(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_IntVarBranch_from_term(YAP_ARG3); + IntAssign X4 = gecode_IntAssign_from_term(YAP_ARG4); + assign(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_51(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + SetVarBranch X3 = gecode_SetVarBranch_from_term(YAP_ARG3); + SetAssign X4 = gecode_SetAssign_from_term(YAP_ARG4); + assign(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_54(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_SetVarBranch_from_term(YAP_ARG3); + SetAssign X4 = gecode_SetAssign_from_term(YAP_ARG4); + assign(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_58(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatAssign X3 = gecode_FloatAssign_from_term(YAP_ARG3); + FloatVarValPrint X4 = gecode_FloatVarValPrint_from_term(YAP_ARG4); + assign(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_60(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntAssign X3 = gecode_IntAssign_from_term(YAP_ARG3); + IntVarValPrint X4 = gecode_IntVarValPrint_from_term(YAP_ARG4); + assign(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_62(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetAssign X3 = gecode_SetAssign_from_term(YAP_ARG3); + SetVarValPrint X4 = gecode_SetVarValPrint_from_term(YAP_ARG4); + assign(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_34(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + BoolVarBranch X3 = gecode_BoolVarBranch_from_term(YAP_ARG3); + BoolAssign X4 = gecode_BoolAssign_from_term(YAP_ARG4); + BoolBranchFilter X5 = gecode_BoolBranchFilter_from_term(YAP_ARG5); + assign(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_37(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_BoolVarBranch_from_term(YAP_ARG3); + BoolAssign X4 = gecode_BoolAssign_from_term(YAP_ARG4); + IntBranchFilter X5 = gecode_IntBranchFilter_from_term(YAP_ARG5); + assign(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_40(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatVarBranch X3 = gecode_FloatVarBranch_from_term(YAP_ARG3); + FloatAssign X4 = gecode_FloatAssign_from_term(YAP_ARG4); + FloatBranchFilter X5 = gecode_FloatBranchFilter_from_term(YAP_ARG5); + assign(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_43(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_FloatVarBranch_from_term(YAP_ARG3); + FloatAssign X4 = gecode_FloatAssign_from_term(YAP_ARG4); + FloatBranchFilter X5 = gecode_FloatBranchFilter_from_term(YAP_ARG5); + assign(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_46(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarBranch X3 = gecode_IntVarBranch_from_term(YAP_ARG3); + IntAssign X4 = gecode_IntAssign_from_term(YAP_ARG4); + IntBranchFilter X5 = gecode_IntBranchFilter_from_term(YAP_ARG5); + assign(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_49(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_IntVarBranch_from_term(YAP_ARG3); + IntAssign X4 = gecode_IntAssign_from_term(YAP_ARG4); + IntBranchFilter X5 = gecode_IntBranchFilter_from_term(YAP_ARG5); + assign(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_52(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + SetVarBranch X3 = gecode_SetVarBranch_from_term(YAP_ARG3); + SetAssign X4 = gecode_SetAssign_from_term(YAP_ARG4); + SetBranchFilter X5 = gecode_SetBranchFilter_from_term(YAP_ARG5); + assign(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_55(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_SetVarBranch_from_term(YAP_ARG3); + SetAssign X4 = gecode_SetAssign_from_term(YAP_ARG4); + SetBranchFilter X5 = gecode_SetBranchFilter_from_term(YAP_ARG5); + assign(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_35(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + BoolVarBranch X3 = gecode_BoolVarBranch_from_term(YAP_ARG3); + BoolAssign X4 = gecode_BoolAssign_from_term(YAP_ARG4); + BoolBranchFilter X5 = gecode_BoolBranchFilter_from_term(YAP_ARG5); + BoolVarValPrint X6 = gecode_BoolVarValPrint_from_term(YAP_ARG6); + assign(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_38(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_BoolVarBranch_from_term(YAP_ARG3); + BoolAssign X4 = gecode_BoolAssign_from_term(YAP_ARG4); + IntBranchFilter X5 = gecode_IntBranchFilter_from_term(YAP_ARG5); + IntVarValPrint X6 = gecode_IntVarValPrint_from_term(YAP_ARG6); + assign(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_41(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatVarBranch X3 = gecode_FloatVarBranch_from_term(YAP_ARG3); + FloatAssign X4 = gecode_FloatAssign_from_term(YAP_ARG4); + FloatBranchFilter X5 = gecode_FloatBranchFilter_from_term(YAP_ARG5); + FloatVarValPrint X6 = gecode_FloatVarValPrint_from_term(YAP_ARG6); + assign(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_44(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_FloatVarBranch_from_term(YAP_ARG3); + FloatAssign X4 = gecode_FloatAssign_from_term(YAP_ARG4); + FloatBranchFilter X5 = gecode_FloatBranchFilter_from_term(YAP_ARG5); + FloatVarValPrint X6 = gecode_FloatVarValPrint_from_term(YAP_ARG6); + assign(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_47(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarBranch X3 = gecode_IntVarBranch_from_term(YAP_ARG3); + IntAssign X4 = gecode_IntAssign_from_term(YAP_ARG4); + IntBranchFilter X5 = gecode_IntBranchFilter_from_term(YAP_ARG5); + IntVarValPrint X6 = gecode_IntVarValPrint_from_term(YAP_ARG6); + assign(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_50(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_IntVarBranch_from_term(YAP_ARG3); + IntAssign X4 = gecode_IntAssign_from_term(YAP_ARG4); + IntBranchFilter X5 = gecode_IntBranchFilter_from_term(YAP_ARG5); + IntVarValPrint X6 = gecode_IntVarValPrint_from_term(YAP_ARG6); + assign(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_53(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + SetVarBranch X3 = gecode_SetVarBranch_from_term(YAP_ARG3); + SetAssign X4 = gecode_SetAssign_from_term(YAP_ARG4); + SetBranchFilter X5 = gecode_SetBranchFilter_from_term(YAP_ARG5); + SetVarValPrint X6 = gecode_SetVarValPrint_from_term(YAP_ARG6); + assign(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_assign_56(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_SetVarBranch_from_term(YAP_ARG3); + SetAssign X4 = gecode_SetAssign_from_term(YAP_ARG4); + SetBranchFilter X5 = gecode_SetBranchFilter_from_term(YAP_ARG5); + SetVarValPrint X6 = gecode_SetVarValPrint_from_term(YAP_ARG6); + assign(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_binpacking_63(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + binpacking(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_binpacking_64(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + binpacking(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_65(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + BoolValBranch X3 = gecode_BoolValBranch_from_term(YAP_ARG3); + branch(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_109(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatValBranch X3 = gecode_FloatValBranch_from_term(YAP_ARG3); + branch(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_111(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntValBranch X3 = gecode_IntValBranch_from_term(YAP_ARG3); + branch(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_113(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetValBranch X3 = gecode_SetValBranch_from_term(YAP_ARG3); + branch(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_66(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + BoolValBranch X3 = gecode_BoolValBranch_from_term(YAP_ARG3); + BoolVarValPrint X4 = gecode_BoolVarValPrint_from_term(YAP_ARG4); + branch(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_67(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + BoolVarBranch X3 = gecode_BoolVarBranch_from_term(YAP_ARG3); + BoolValBranch X4 = gecode_BoolValBranch_from_term(YAP_ARG4); + branch(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_73(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_BoolVarBranch_from_term(YAP_ARG3); + BoolValBranch X4 = gecode_BoolValBranch_from_term(YAP_ARG4); + branch(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_79(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatVarBranch X3 = gecode_FloatVarBranch_from_term(YAP_ARG3); + FloatValBranch X4 = gecode_FloatValBranch_from_term(YAP_ARG4); + branch(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_82(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_FloatVarBranch_from_term(YAP_ARG3); + FloatValBranch X4 = gecode_FloatValBranch_from_term(YAP_ARG4); + branch(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_88(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarBranch X3 = gecode_IntVarBranch_from_term(YAP_ARG3); + IntValBranch X4 = gecode_IntValBranch_from_term(YAP_ARG4); + branch(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_94(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_IntVarBranch_from_term(YAP_ARG3); + IntValBranch X4 = gecode_IntValBranch_from_term(YAP_ARG4); + branch(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_100(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + SetVarBranch X3 = gecode_SetVarBranch_from_term(YAP_ARG3); + SetValBranch X4 = gecode_SetValBranch_from_term(YAP_ARG4); + branch(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_106(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_SetVarBranch_from_term(YAP_ARG3); + SetValBranch X4 = gecode_SetValBranch_from_term(YAP_ARG4); + branch(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_110(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatValBranch X3 = gecode_FloatValBranch_from_term(YAP_ARG3); + FloatVarValPrint X4 = gecode_FloatVarValPrint_from_term(YAP_ARG4); + branch(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_112(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntValBranch X3 = gecode_IntValBranch_from_term(YAP_ARG3); + IntVarValPrint X4 = gecode_IntVarValPrint_from_term(YAP_ARG4); + branch(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_114(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetValBranch X3 = gecode_SetValBranch_from_term(YAP_ARG3); + SetVarValPrint X4 = gecode_SetVarValPrint_from_term(YAP_ARG4); + branch(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_68(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + BoolVarBranch X3 = gecode_BoolVarBranch_from_term(YAP_ARG3); + BoolValBranch X4 = gecode_BoolValBranch_from_term(YAP_ARG4); + BoolBranchFilter X5 = gecode_BoolBranchFilter_from_term(YAP_ARG5); + branch(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_70(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + BoolVarBranch X3 = gecode_BoolVarBranch_from_term(YAP_ARG3); + BoolValBranch X4 = gecode_BoolValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + branch(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_74(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_BoolVarBranch_from_term(YAP_ARG3); + BoolValBranch X4 = gecode_BoolValBranch_from_term(YAP_ARG4); + BoolBranchFilter X5 = gecode_BoolBranchFilter_from_term(YAP_ARG5); + branch(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_76(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_BoolVarBranch_from_term(YAP_ARG3); + BoolValBranch X4 = gecode_BoolValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + branch(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_80(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatVarBranch X3 = gecode_FloatVarBranch_from_term(YAP_ARG3); + FloatValBranch X4 = gecode_FloatValBranch_from_term(YAP_ARG4); + FloatBranchFilter X5 = gecode_FloatBranchFilter_from_term(YAP_ARG5); + branch(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_83(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_FloatVarBranch_from_term(YAP_ARG3); + FloatValBranch X4 = gecode_FloatValBranch_from_term(YAP_ARG4); + FloatBranchFilter X5 = gecode_FloatBranchFilter_from_term(YAP_ARG5); + branch(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_85(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarBranch X3 = gecode_IntVarBranch_from_term(YAP_ARG3); + IntValBranch X4 = gecode_IntValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + branch(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_89(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarBranch X3 = gecode_IntVarBranch_from_term(YAP_ARG3); + IntValBranch X4 = gecode_IntValBranch_from_term(YAP_ARG4); + IntBranchFilter X5 = gecode_IntBranchFilter_from_term(YAP_ARG5); + branch(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_91(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_IntVarBranch_from_term(YAP_ARG3); + IntValBranch X4 = gecode_IntValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + branch(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_95(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_IntVarBranch_from_term(YAP_ARG3); + IntValBranch X4 = gecode_IntValBranch_from_term(YAP_ARG4); + IntBranchFilter X5 = gecode_IntBranchFilter_from_term(YAP_ARG5); + branch(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_97(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + SetVarBranch X3 = gecode_SetVarBranch_from_term(YAP_ARG3); + SetValBranch X4 = gecode_SetValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + branch(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_101(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + SetVarBranch X3 = gecode_SetVarBranch_from_term(YAP_ARG3); + SetValBranch X4 = gecode_SetValBranch_from_term(YAP_ARG4); + SetBranchFilter X5 = gecode_SetBranchFilter_from_term(YAP_ARG5); + branch(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_103(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_SetVarBranch_from_term(YAP_ARG3); + SetValBranch X4 = gecode_SetValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + branch(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_107(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_SetVarBranch_from_term(YAP_ARG3); + SetValBranch X4 = gecode_SetValBranch_from_term(YAP_ARG4); + SetBranchFilter X5 = gecode_SetBranchFilter_from_term(YAP_ARG5); + branch(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_69(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + BoolVarBranch X3 = gecode_BoolVarBranch_from_term(YAP_ARG3); + BoolValBranch X4 = gecode_BoolValBranch_from_term(YAP_ARG4); + BoolBranchFilter X5 = gecode_BoolBranchFilter_from_term(YAP_ARG5); + BoolVarValPrint X6 = gecode_BoolVarValPrint_from_term(YAP_ARG6); + branch(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_71(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + BoolVarBranch X3 = gecode_BoolVarBranch_from_term(YAP_ARG3); + BoolValBranch X4 = gecode_BoolValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + BoolBranchFilter X6 = gecode_BoolBranchFilter_from_term(YAP_ARG6); + branch(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_75(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_BoolVarBranch_from_term(YAP_ARG3); + BoolValBranch X4 = gecode_BoolValBranch_from_term(YAP_ARG4); + BoolBranchFilter X5 = gecode_BoolBranchFilter_from_term(YAP_ARG5); + BoolVarValPrint X6 = gecode_BoolVarValPrint_from_term(YAP_ARG6); + branch(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_77(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_BoolVarBranch_from_term(YAP_ARG3); + BoolValBranch X4 = gecode_BoolValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + BoolBranchFilter X6 = gecode_BoolBranchFilter_from_term(YAP_ARG6); + branch(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_81(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatVarBranch X3 = gecode_FloatVarBranch_from_term(YAP_ARG3); + FloatValBranch X4 = gecode_FloatValBranch_from_term(YAP_ARG4); + FloatBranchFilter X5 = gecode_FloatBranchFilter_from_term(YAP_ARG5); + FloatVarValPrint X6 = gecode_FloatVarValPrint_from_term(YAP_ARG6); + branch(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_84(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_FloatVarBranch_from_term(YAP_ARG3); + FloatValBranch X4 = gecode_FloatValBranch_from_term(YAP_ARG4); + FloatBranchFilter X5 = gecode_FloatBranchFilter_from_term(YAP_ARG5); + FloatVarValPrint X6 = gecode_FloatVarValPrint_from_term(YAP_ARG6); + branch(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_86(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarBranch X3 = gecode_IntVarBranch_from_term(YAP_ARG3); + IntValBranch X4 = gecode_IntValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + IntBranchFilter X6 = gecode_IntBranchFilter_from_term(YAP_ARG6); + branch(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_90(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarBranch X3 = gecode_IntVarBranch_from_term(YAP_ARG3); + IntValBranch X4 = gecode_IntValBranch_from_term(YAP_ARG4); + IntBranchFilter X5 = gecode_IntBranchFilter_from_term(YAP_ARG5); + IntVarValPrint X6 = gecode_IntVarValPrint_from_term(YAP_ARG6); + branch(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_92(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_IntVarBranch_from_term(YAP_ARG3); + IntValBranch X4 = gecode_IntValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + IntBranchFilter X6 = gecode_IntBranchFilter_from_term(YAP_ARG6); + branch(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_96(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_IntVarBranch_from_term(YAP_ARG3); + IntValBranch X4 = gecode_IntValBranch_from_term(YAP_ARG4); + IntBranchFilter X5 = gecode_IntBranchFilter_from_term(YAP_ARG5); + IntVarValPrint X6 = gecode_IntVarValPrint_from_term(YAP_ARG6); + branch(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_98(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + SetVarBranch X3 = gecode_SetVarBranch_from_term(YAP_ARG3); + SetValBranch X4 = gecode_SetValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + SetBranchFilter X6 = gecode_SetBranchFilter_from_term(YAP_ARG6); + branch(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_102(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + SetVarBranch X3 = gecode_SetVarBranch_from_term(YAP_ARG3); + SetValBranch X4 = gecode_SetValBranch_from_term(YAP_ARG4); + SetBranchFilter X5 = gecode_SetBranchFilter_from_term(YAP_ARG5); + SetVarValPrint X6 = gecode_SetVarValPrint_from_term(YAP_ARG6); + branch(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_104(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_SetVarBranch_from_term(YAP_ARG3); + SetValBranch X4 = gecode_SetValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + SetBranchFilter X6 = gecode_SetBranchFilter_from_term(YAP_ARG6); + branch(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_108(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_SetVarBranch_from_term(YAP_ARG3); + SetValBranch X4 = gecode_SetValBranch_from_term(YAP_ARG4); + SetBranchFilter X5 = gecode_SetBranchFilter_from_term(YAP_ARG5); + SetVarValPrint X6 = gecode_SetVarValPrint_from_term(YAP_ARG6); + branch(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_72(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + BoolVarBranch X3 = gecode_BoolVarBranch_from_term(YAP_ARG3); + BoolValBranch X4 = gecode_BoolValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + BoolBranchFilter X6 = gecode_BoolBranchFilter_from_term(YAP_ARG6); + BoolVarValPrint X7 = gecode_BoolVarValPrint_from_term(YAP_ARG7); + branch(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_78(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_BoolVarBranch_from_term(YAP_ARG3); + BoolValBranch X4 = gecode_BoolValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + BoolBranchFilter X6 = gecode_BoolBranchFilter_from_term(YAP_ARG6); + BoolVarValPrint X7 = gecode_BoolVarValPrint_from_term(YAP_ARG7); + branch(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_87(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarBranch X3 = gecode_IntVarBranch_from_term(YAP_ARG3); + IntValBranch X4 = gecode_IntValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + IntBranchFilter X6 = gecode_IntBranchFilter_from_term(YAP_ARG6); + IntVarValPrint X7 = gecode_IntVarValPrint_from_term(YAP_ARG7); + branch(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_93(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_IntVarBranch_from_term(YAP_ARG3); + IntValBranch X4 = gecode_IntValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + IntBranchFilter X6 = gecode_IntBranchFilter_from_term(YAP_ARG6); + IntVarValPrint X7 = gecode_IntVarValPrint_from_term(YAP_ARG7); + branch(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_99(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + SetVarBranch X3 = gecode_SetVarBranch_from_term(YAP_ARG3); + SetValBranch X4 = gecode_SetValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + SetBranchFilter X6 = gecode_SetBranchFilter_from_term(YAP_ARG6); + SetVarValPrint X7 = gecode_SetVarValPrint_from_term(YAP_ARG7); + branch(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_branch_105(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + TieBreak X3 = gecode_SetVarBranch_from_term(YAP_ARG3); + SetValBranch X4 = gecode_SetValBranch_from_term(YAP_ARG4); + Symmetries X5 = gecode_Symmetries_from_term(YAP_ARG5); + SetBranchFilter X6 = gecode_SetBranchFilter_from_term(YAP_ARG6); + SetVarValPrint X7 = gecode_SetVarValPrint_from_term(YAP_ARG7); + branch(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_cardinality_115(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + cardinality(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_cardinality_116(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + cardinality(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_channel_117(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + channel(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_channel_119(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + channel(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_channel_122(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + channel(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_channel_126(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + BoolVar X3 = gecode_BoolVar_from_term(space,YAP_ARG3); + channel(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_channel_127(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + channel(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_channel_118(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + channel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_channel_120(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + channel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_channel_123(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + channel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_channel_121(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + channel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_channel_124(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + channel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_channel_125(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + channel(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_circuit_128(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + circuit(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_circuit_131(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + circuit(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_circuit_134(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + circuit(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_circuit_129(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + circuit(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_circuit_132(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntVar X6 = gecode_IntVar_from_term(space,YAP_ARG6); + circuit(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_circuit_135(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + circuit(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_circuit_130(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + circuit(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_circuit_139(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + circuit(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_circuit_133(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntVar X6 = gecode_IntVar_from_term(space,YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + circuit(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_circuit_136(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + circuit(*space,X2); + return TRUE; +} + +static YAP_Bool gecode_constraint_circuit_137(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntPropLevel X3 = gecode_IntPropLevel_from_term(YAP_ARG3); + circuit(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_circuit_138(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + circuit(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_clause_140(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolOpType X2 = gecode_BoolOpType_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + BoolVarArgs X4 = gecode_BoolVarArgs_from_term(space,YAP_ARG4); + BoolVar X5 = gecode_BoolVar_from_term(space,YAP_ARG5); + clause(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_clause_142(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolOpType X2 = gecode_BoolOpType_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + BoolVarArgs X4 = gecode_BoolVarArgs_from_term(space,YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + clause(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_clause_141(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolOpType X2 = gecode_BoolOpType_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + BoolVarArgs X4 = gecode_BoolVarArgs_from_term(space,YAP_ARG4); + BoolVar X5 = gecode_BoolVar_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + clause(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_clause_143(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolOpType X2 = gecode_BoolOpType_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + BoolVarArgs X4 = gecode_BoolVarArgs_from_term(space,YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + clause(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_144(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntArgs X3 = gecode_IntArgs_from_term(YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + count(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_146(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntArgs X3 = gecode_IntArgs_from_term(YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + count(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_149(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntSetArgs X3 = gecode_IntSetArgs_from_term(YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + count(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_153(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + count(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_154(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + count(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_156(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + count(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_159(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + count(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_162(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + count(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_164(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + count(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_166(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + count(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_168(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + count(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_145(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntArgs X3 = gecode_IntArgs_from_term(YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + count(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_147(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntArgs X3 = gecode_IntArgs_from_term(YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + count(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_155(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + count(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_157(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + count(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_163(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + count(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_165(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + count(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_167(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + count(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_169(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + count(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_148(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntSetArgs X3 = gecode_IntSetArgs_from_term(YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + count(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_151(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntSetArgs X3 = gecode_IntSetArgs_from_term(YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + count(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_152(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + count(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_158(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + count(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_161(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + count(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_150(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntSetArgs X3 = gecode_IntSetArgs_from_term(YAP_ARG3); + count(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_count_160(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + count(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_170(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + BoolVarArgs X6 = gecode_BoolVarArgs_from_term(space,YAP_ARG6); + cumulative(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_173(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + cumulative(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_176(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + cumulative(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_180(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + TaskTypeArgs X3 = gecode_TaskTypeArgs_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + cumulative(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_182(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + BoolVarArgs X6 = gecode_BoolVarArgs_from_term(space,YAP_ARG6); + cumulative(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_185(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + cumulative(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_188(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + cumulative(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_192(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + TaskTypeArgs X3 = gecode_TaskTypeArgs_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + cumulative(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_171(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + BoolVarArgs X6 = gecode_BoolVarArgs_from_term(space,YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + cumulative(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_174(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + BoolVarArgs X7 = gecode_BoolVarArgs_from_term(space,YAP_ARG7); + cumulative(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_177(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + cumulative(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_178(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + TaskTypeArgs X3 = gecode_TaskTypeArgs_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + BoolVarArgs X7 = gecode_BoolVarArgs_from_term(space,YAP_ARG7); + cumulative(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_181(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + TaskTypeArgs X3 = gecode_TaskTypeArgs_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + cumulative(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_183(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + BoolVarArgs X6 = gecode_BoolVarArgs_from_term(space,YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + cumulative(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_186(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + BoolVarArgs X7 = gecode_BoolVarArgs_from_term(space,YAP_ARG7); + cumulative(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_189(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + cumulative(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_190(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + TaskTypeArgs X3 = gecode_TaskTypeArgs_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + BoolVarArgs X7 = gecode_BoolVarArgs_from_term(space,YAP_ARG7); + cumulative(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_193(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + TaskTypeArgs X3 = gecode_TaskTypeArgs_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + cumulative(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_172(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + cumulative(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_184(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + cumulative(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_175(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + BoolVarArgs X7 = gecode_BoolVarArgs_from_term(space,YAP_ARG7); + IntPropLevel X8 = gecode_IntPropLevel_from_term(YAP_ARG8); + cumulative(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_179(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + TaskTypeArgs X3 = gecode_TaskTypeArgs_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + BoolVarArgs X7 = gecode_BoolVarArgs_from_term(space,YAP_ARG7); + IntPropLevel X8 = gecode_IntPropLevel_from_term(YAP_ARG8); + cumulative(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_187(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + BoolVarArgs X7 = gecode_BoolVarArgs_from_term(space,YAP_ARG7); + IntPropLevel X8 = gecode_IntPropLevel_from_term(YAP_ARG8); + cumulative(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulative_191(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + TaskTypeArgs X3 = gecode_TaskTypeArgs_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + BoolVarArgs X7 = gecode_BoolVarArgs_from_term(space,YAP_ARG7); + IntPropLevel X8 = gecode_IntPropLevel_from_term(YAP_ARG8); + cumulative(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_194(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_196(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntVarArgs X6 = gecode_IntVarArgs_from_term(space,YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_198(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_200(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntVarArgs X6 = gecode_IntVarArgs_from_term(space,YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_202(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_204(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntVarArgs X6 = gecode_IntVarArgs_from_term(space,YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_206(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_208(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntVarArgs X6 = gecode_IntVarArgs_from_term(space,YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_195(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + IntPropLevel X9 = gecode_IntPropLevel_from_term(YAP_ARG9); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8,X9); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_197(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntVarArgs X6 = gecode_IntVarArgs_from_term(space,YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + IntPropLevel X9 = gecode_IntPropLevel_from_term(YAP_ARG9); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8,X9); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_199(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + IntPropLevel X9 = gecode_IntPropLevel_from_term(YAP_ARG9); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8,X9); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_201(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntVarArgs X6 = gecode_IntVarArgs_from_term(space,YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + IntPropLevel X9 = gecode_IntPropLevel_from_term(YAP_ARG9); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8,X9); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_203(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + IntPropLevel X9 = gecode_IntPropLevel_from_term(YAP_ARG9); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8,X9); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_205(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntVarArgs X6 = gecode_IntVarArgs_from_term(space,YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + IntPropLevel X9 = gecode_IntPropLevel_from_term(YAP_ARG9); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8,X9); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_207(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntArgs X6 = gecode_IntArgs_from_term(YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + IntPropLevel X9 = gecode_IntPropLevel_from_term(YAP_ARG9); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8,X9); + return TRUE; +} + +static YAP_Bool gecode_constraint_cumulatives_209(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntVarArgs X6 = gecode_IntVarArgs_from_term(space,YAP_ARG6); + IntArgs X7 = gecode_IntArgs_from_term(YAP_ARG7); + bool X8 = gecode_bool_from_term(YAP_ARG8); + IntPropLevel X9 = gecode_IntPropLevel_from_term(YAP_ARG9); + cumulatives(*space,X2,X3,X4,X5,X6,X7,X8,X9); + return TRUE; +} + +static YAP_Bool gecode_constraint_distinct_210(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + distinct(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_distinct_212(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + distinct(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_distinct_214(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + distinct(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_distinct_217(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntPropLevel X3 = gecode_IntPropLevel_from_term(YAP_ARG3); + distinct(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_distinct_211(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + distinct(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_distinct_213(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + distinct(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_distinct_215(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + distinct(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_distinct_216(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + distinct(*space,X2); + return TRUE; +} + +static YAP_Bool gecode_constraint_div_218(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatVar X3 = gecode_FloatVar_from_term(space,YAP_ARG3); + FloatVar X4 = gecode_FloatVar_from_term(space,YAP_ARG4); + div(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_div_219(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + div(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_div_220(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + div(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_divmod_221(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + divmod(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_divmod_222(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + divmod(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_223(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + BoolVar X3 = gecode_BoolVar_from_term(space,YAP_ARG3); + dom(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_225(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + dom(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_227(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatVarArgs X3 = gecode_FloatVarArgs_from_term(space,YAP_ARG3); + dom(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_229(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatVal X3 = gecode_FloatVal_from_term(YAP_ARG3); + dom(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_230(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + dom(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_232(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + dom(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_236(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + dom(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_238(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + SetVarArgs X3 = gecode_SetVarArgs_from_term(space,YAP_ARG3); + dom(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_244(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatVal X3 = gecode_FloatVal_from_term(YAP_ARG3); + dom(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_246(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatVar X3 = gecode_FloatVar_from_term(space,YAP_ARG3); + dom(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_247(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + dom(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_253(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + dom(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_259(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + dom(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_267(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetVar X3 = gecode_SetVar_from_term(space,YAP_ARG3); + dom(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_224(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + BoolVar X3 = gecode_BoolVar_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_226(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_228(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatNum X3 = gecode_FloatNum_from_term(YAP_ARG3); + FloatNum X4 = gecode_FloatNum_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_231(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_233(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_234(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_237(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_239(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + SetRelType X3 = gecode_SetRelType_from_term(YAP_ARG3); + IntSet X4 = gecode_IntSet_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_240(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + SetRelType X3 = gecode_SetRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_242(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatNum X3 = gecode_FloatNum_from_term(YAP_ARG3); + FloatNum X4 = gecode_FloatNum_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_245(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatVal X3 = gecode_FloatVal_from_term(YAP_ARG3); + Reify X4 = gecode_Reify_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_248(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_249(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + Reify X4 = gecode_Reify_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_251(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_254(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_257(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + Reify X4 = gecode_Reify_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_260(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_261(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetRelType X3 = gecode_SetRelType_from_term(YAP_ARG3); + IntSet X4 = gecode_IntSet_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_263(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetRelType X3 = gecode_SetRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + dom(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_235(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + dom(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_241(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + SetRelType X3 = gecode_SetRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + dom(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_243(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatNum X3 = gecode_FloatNum_from_term(YAP_ARG3); + FloatNum X4 = gecode_FloatNum_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + dom(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_250(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + Reify X4 = gecode_Reify_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + dom(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_252(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + dom(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_255(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + dom(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_258(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + Reify X4 = gecode_Reify_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + dom(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_262(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetRelType X3 = gecode_SetRelType_from_term(YAP_ARG3); + IntSet X4 = gecode_IntSet_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + dom(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_264(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetRelType X3 = gecode_SetRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + dom(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_266(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetRelType X3 = gecode_SetRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + dom(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_256(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + dom(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_dom_265(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetRelType X3 = gecode_SetRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + Reify X6 = gecode_Reify_from_term(YAP_ARG6); + dom(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_268(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + element(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_270(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + element(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_274(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + element(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_278(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + element(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_280(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + element(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_282(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + element(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_288(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + element(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_269(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + element(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_271(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + element(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_275(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + element(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_279(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + element(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_281(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + element(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_283(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + element(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_289(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + element(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_272(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + int X6 = gecode_int_from_term(YAP_ARG6); + BoolVar X7 = gecode_BoolVar_from_term(space,YAP_ARG7); + element(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_276(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + int X6 = gecode_int_from_term(YAP_ARG6); + IntVar X7 = gecode_IntVar_from_term(space,YAP_ARG7); + element(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_284(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + int X6 = gecode_int_from_term(YAP_ARG6); + BoolVar X7 = gecode_BoolVar_from_term(space,YAP_ARG7); + element(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_286(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + int X6 = gecode_int_from_term(YAP_ARG6); + IntVar X7 = gecode_IntVar_from_term(space,YAP_ARG7); + element(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_273(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + int X6 = gecode_int_from_term(YAP_ARG6); + BoolVar X7 = gecode_BoolVar_from_term(space,YAP_ARG7); + IntPropLevel X8 = gecode_IntPropLevel_from_term(YAP_ARG8); + element(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_277(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + int X6 = gecode_int_from_term(YAP_ARG6); + IntVar X7 = gecode_IntVar_from_term(space,YAP_ARG7); + IntPropLevel X8 = gecode_IntPropLevel_from_term(YAP_ARG8); + element(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_285(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + int X6 = gecode_int_from_term(YAP_ARG6); + BoolVar X7 = gecode_BoolVar_from_term(space,YAP_ARG7); + IntPropLevel X8 = gecode_IntPropLevel_from_term(YAP_ARG8); + element(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_element_287(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + int X6 = gecode_int_from_term(YAP_ARG6); + IntVar X7 = gecode_IntVar_from_term(space,YAP_ARG7); + IntPropLevel X8 = gecode_IntPropLevel_from_term(YAP_ARG8); + element(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_extensional_290(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + TupleSet X3 = gecode_TupleSet_from_term(YAP_ARG3); + bool X4 = gecode_bool_from_term(YAP_ARG4); + extensional(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_extensional_295(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + DFA X3 = gecode_DFA_from_term(YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + extensional(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_extensional_296(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + TupleSet X3 = gecode_TupleSet_from_term(YAP_ARG3); + bool X4 = gecode_bool_from_term(YAP_ARG4); + extensional(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_extensional_301(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + DFA X3 = gecode_DFA_from_term(YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + extensional(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_extensional_291(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + TupleSet X3 = gecode_TupleSet_from_term(YAP_ARG3); + bool X4 = gecode_bool_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + extensional(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_extensional_292(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + TupleSet X3 = gecode_TupleSet_from_term(YAP_ARG3); + bool X4 = gecode_bool_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + extensional(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_extensional_297(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + TupleSet X3 = gecode_TupleSet_from_term(YAP_ARG3); + bool X4 = gecode_bool_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + extensional(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_extensional_298(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + TupleSet X3 = gecode_TupleSet_from_term(YAP_ARG3); + bool X4 = gecode_bool_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + extensional(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_extensional_293(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + TupleSet X3 = gecode_TupleSet_from_term(YAP_ARG3); + bool X4 = gecode_bool_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + extensional(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_extensional_299(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + TupleSet X3 = gecode_TupleSet_from_term(YAP_ARG3); + bool X4 = gecode_bool_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + extensional(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_extensional_294(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + DFA X3 = gecode_DFA_from_term(YAP_ARG3); + extensional(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_extensional_300(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + DFA X3 = gecode_DFA_from_term(YAP_ARG3); + extensional(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_ite_302(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + BoolVar X3 = gecode_BoolVar_from_term(space,YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + BoolVar X5 = gecode_BoolVar_from_term(space,YAP_ARG5); + ite(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_ite_304(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + FloatVar X3 = gecode_FloatVar_from_term(space,YAP_ARG3); + FloatVar X4 = gecode_FloatVar_from_term(space,YAP_ARG4); + FloatVar X5 = gecode_FloatVar_from_term(space,YAP_ARG5); + ite(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_ite_305(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + ite(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_ite_307(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + SetVar X3 = gecode_SetVar_from_term(space,YAP_ARG3); + SetVar X4 = gecode_SetVar_from_term(space,YAP_ARG4); + SetVar X5 = gecode_SetVar_from_term(space,YAP_ARG5); + ite(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_ite_303(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + BoolVar X3 = gecode_BoolVar_from_term(space,YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + BoolVar X5 = gecode_BoolVar_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + ite(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_ite_306(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + ite(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_308(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + linear(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_312(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + linear(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_320(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatRelType X3 = gecode_FloatRelType_from_term(YAP_ARG3); + FloatVal X4 = gecode_FloatVal_from_term(YAP_ARG4); + linear(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_322(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatRelType X3 = gecode_FloatRelType_from_term(YAP_ARG3); + FloatVar X4 = gecode_FloatVar_from_term(space,YAP_ARG4); + linear(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_340(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + linear(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_344(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + linear(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_309(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_310(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_313(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_314(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_316(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatValArgs X2 = gecode_FloatValArgs_from_term(YAP_ARG2); + FloatVarArgs X3 = gecode_FloatVarArgs_from_term(space,YAP_ARG3); + FloatRelType X4 = gecode_FloatRelType_from_term(YAP_ARG4); + FloatVal X5 = gecode_FloatVal_from_term(YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_318(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatValArgs X2 = gecode_FloatValArgs_from_term(YAP_ARG2); + FloatVarArgs X3 = gecode_FloatVarArgs_from_term(space,YAP_ARG3); + FloatRelType X4 = gecode_FloatRelType_from_term(YAP_ARG4); + FloatVar X5 = gecode_FloatVar_from_term(space,YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_321(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatRelType X3 = gecode_FloatRelType_from_term(YAP_ARG3); + FloatVal X4 = gecode_FloatVal_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_323(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatRelType X3 = gecode_FloatRelType_from_term(YAP_ARG3); + FloatVar X4 = gecode_FloatVar_from_term(space,YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_324(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_328(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_332(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_336(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_341(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_342(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_345(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_346(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + linear(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_311(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + linear(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_315(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + linear(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_317(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatValArgs X2 = gecode_FloatValArgs_from_term(YAP_ARG2); + FloatVarArgs X3 = gecode_FloatVarArgs_from_term(space,YAP_ARG3); + FloatRelType X4 = gecode_FloatRelType_from_term(YAP_ARG4); + FloatVal X5 = gecode_FloatVal_from_term(YAP_ARG5); + Reify X6 = gecode_Reify_from_term(YAP_ARG6); + linear(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_319(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatValArgs X2 = gecode_FloatValArgs_from_term(YAP_ARG2); + FloatVarArgs X3 = gecode_FloatVarArgs_from_term(space,YAP_ARG3); + FloatRelType X4 = gecode_FloatRelType_from_term(YAP_ARG4); + FloatVar X5 = gecode_FloatVar_from_term(space,YAP_ARG5); + Reify X6 = gecode_Reify_from_term(YAP_ARG6); + linear(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_325(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + linear(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_326(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + Reify X6 = gecode_Reify_from_term(YAP_ARG6); + linear(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_329(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + linear(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_330(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + Reify X6 = gecode_Reify_from_term(YAP_ARG6); + linear(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_333(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + linear(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_334(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + Reify X6 = gecode_Reify_from_term(YAP_ARG6); + linear(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_337(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + linear(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_338(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + Reify X6 = gecode_Reify_from_term(YAP_ARG6); + linear(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_343(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + linear(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_347(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + linear(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_327(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + Reify X6 = gecode_Reify_from_term(YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + linear(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_331(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + Reify X6 = gecode_Reify_from_term(YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + linear(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_335(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + Reify X6 = gecode_Reify_from_term(YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + linear(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_linear_339(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntRelType X4 = gecode_IntRelType_from_term(YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + Reify X6 = gecode_Reify_from_term(YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + linear(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_max_348(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatVar X3 = gecode_FloatVar_from_term(space,YAP_ARG3); + max(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_max_349(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + max(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_max_350(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + max(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_max_351(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatVar X3 = gecode_FloatVar_from_term(space,YAP_ARG3); + FloatVar X4 = gecode_FloatVar_from_term(space,YAP_ARG4); + max(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_max_352(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + max(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_max_353(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + max(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_member_354(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + BoolVar X3 = gecode_BoolVar_from_term(space,YAP_ARG3); + member(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_member_358(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + member(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_member_355(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + BoolVar X3 = gecode_BoolVar_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + member(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_member_356(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + BoolVar X3 = gecode_BoolVar_from_term(space,YAP_ARG3); + Reify X4 = gecode_Reify_from_term(YAP_ARG4); + member(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_member_359(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + member(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_member_360(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + Reify X4 = gecode_Reify_from_term(YAP_ARG4); + member(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_member_357(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + BoolVar X3 = gecode_BoolVar_from_term(space,YAP_ARG3); + Reify X4 = gecode_Reify_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + member(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_member_361(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + Reify X4 = gecode_Reify_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + member(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_min_362(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatVar X3 = gecode_FloatVar_from_term(space,YAP_ARG3); + min(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_min_363(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + min(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_min_364(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + min(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_min_365(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatVar X3 = gecode_FloatVar_from_term(space,YAP_ARG3); + FloatVar X4 = gecode_FloatVar_from_term(space,YAP_ARG4); + min(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_min_366(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + min(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_min_367(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + min(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_mod_368(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + mod(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_mod_369(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + mod(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_mult_370(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatVar X3 = gecode_FloatVar_from_term(space,YAP_ARG3); + FloatVar X4 = gecode_FloatVar_from_term(space,YAP_ARG4); + mult(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_mult_371(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + mult(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_mult_372(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + mult(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_nooverlap_373(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntArgs X3 = gecode_IntArgs_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + BoolVarArgs X6 = gecode_BoolVarArgs_from_term(space,YAP_ARG6); + nooverlap(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_nooverlap_376(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntArgs X3 = gecode_IntArgs_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + nooverlap(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_nooverlap_374(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntArgs X3 = gecode_IntArgs_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + BoolVarArgs X6 = gecode_BoolVarArgs_from_term(space,YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + nooverlap(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_nooverlap_379(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntVarArgs X6 = gecode_IntVarArgs_from_term(space,YAP_ARG6); + IntVarArgs X7 = gecode_IntVarArgs_from_term(space,YAP_ARG7); + nooverlap(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_nooverlap_375(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntArgs X3 = gecode_IntArgs_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntArgs X5 = gecode_IntArgs_from_term(YAP_ARG5); + nooverlap(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_nooverlap_377(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntVarArgs X6 = gecode_IntVarArgs_from_term(space,YAP_ARG6); + IntVarArgs X7 = gecode_IntVarArgs_from_term(space,YAP_ARG7); + BoolVarArgs X8 = gecode_BoolVarArgs_from_term(space,YAP_ARG8); + nooverlap(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_nooverlap_380(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntVarArgs X6 = gecode_IntVarArgs_from_term(space,YAP_ARG6); + IntVarArgs X7 = gecode_IntVarArgs_from_term(space,YAP_ARG7); + IntPropLevel X8 = gecode_IntPropLevel_from_term(YAP_ARG8); + nooverlap(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_nooverlap_378(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVarArgs X5 = gecode_IntVarArgs_from_term(space,YAP_ARG5); + IntVarArgs X6 = gecode_IntVarArgs_from_term(space,YAP_ARG6); + IntVarArgs X7 = gecode_IntVarArgs_from_term(space,YAP_ARG7); + BoolVarArgs X8 = gecode_BoolVarArgs_from_term(space,YAP_ARG8); + IntPropLevel X9 = gecode_IntPropLevel_from_term(YAP_ARG9); + nooverlap(*space,X2,X3,X4,X5,X6,X7,X8,X9); + return TRUE; +} + +static YAP_Bool gecode_constraint_nroot_381(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + FloatVar X4 = gecode_FloatVar_from_term(space,YAP_ARG4); + nroot(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_nroot_382(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + nroot(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_nroot_383(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + nroot(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_nvalues_384(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + nvalues(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_nvalues_386(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + nvalues(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_nvalues_388(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + nvalues(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_nvalues_390(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + nvalues(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_nvalues_385(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + nvalues(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_nvalues_387(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + nvalues(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_nvalues_389(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + nvalues(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_nvalues_391(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + nvalues(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_order_392(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + BoolVar X6 = gecode_BoolVar_from_term(space,YAP_ARG6); + order(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_order_393(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + BoolVar X6 = gecode_BoolVar_from_term(space,YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + order(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_path_394(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntVarArgs X6 = gecode_IntVarArgs_from_term(space,YAP_ARG6); + IntVar X7 = gecode_IntVar_from_term(space,YAP_ARG7); + path(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_path_397(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntVar X6 = gecode_IntVar_from_term(space,YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + path(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_path_400(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntVar X6 = gecode_IntVar_from_term(space,YAP_ARG6); + IntVar X7 = gecode_IntVar_from_term(space,YAP_ARG7); + path(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_path_395(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntVarArgs X6 = gecode_IntVarArgs_from_term(space,YAP_ARG6); + IntVar X7 = gecode_IntVar_from_term(space,YAP_ARG7); + IntPropLevel X8 = gecode_IntPropLevel_from_term(YAP_ARG8); + path(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_path_398(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntVar X6 = gecode_IntVar_from_term(space,YAP_ARG6); + IntVarArgs X7 = gecode_IntVarArgs_from_term(space,YAP_ARG7); + IntVar X8 = gecode_IntVar_from_term(space,YAP_ARG8); + path(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_path_401(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntVar X6 = gecode_IntVar_from_term(space,YAP_ARG6); + IntVar X7 = gecode_IntVar_from_term(space,YAP_ARG7); + IntPropLevel X8 = gecode_IntPropLevel_from_term(YAP_ARG8); + path(*space,X2,X3,X4,X5,X6,X7,X8); + return TRUE; +} + +static YAP_Bool gecode_constraint_path_396(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntVar X6 = gecode_IntVar_from_term(space,YAP_ARG6); + path(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_path_405(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + path(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_path_399(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + IntVar X6 = gecode_IntVar_from_term(space,YAP_ARG6); + IntVarArgs X7 = gecode_IntVarArgs_from_term(space,YAP_ARG7); + IntVar X8 = gecode_IntVar_from_term(space,YAP_ARG8); + IntPropLevel X9 = gecode_IntPropLevel_from_term(YAP_ARG9); + path(*space,X2,X3,X4,X5,X6,X7,X8,X9); + return TRUE; +} + +static YAP_Bool gecode_constraint_path_402(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + path(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_path_403(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + path(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_path_404(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int X2 = gecode_int_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntVar X5 = gecode_IntVar_from_term(space,YAP_ARG5); + path(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_pow_406(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + FloatVar X4 = gecode_FloatVar_from_term(space,YAP_ARG4); + pow(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_pow_407(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + pow(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_pow_408(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + pow(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_precede_409(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntArgs X3 = gecode_IntArgs_from_term(YAP_ARG3); + precede(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_precede_410(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntArgs X3 = gecode_IntArgs_from_term(YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + precede(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_precede_411(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + precede(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_precede_412(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + int X3 = gecode_int_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + precede(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_relax_413(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatVarArgs X3 = gecode_FloatVarArgs_from_term(space,YAP_ARG3); + Rnd X4 = gecode_Rnd_from_term(YAP_ARG4); + double X5 = gecode_double_from_term(YAP_ARG5); + relax(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_relax_414(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVarArgs X2 = gecode_SetVarArgs_from_term(space,YAP_ARG2); + SetVarArgs X3 = gecode_SetVarArgs_from_term(space,YAP_ARG3); + Rnd X4 = gecode_Rnd_from_term(YAP_ARG4); + double X5 = gecode_double_from_term(YAP_ARG5); + relax(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_415(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolOpType X2 = gecode_BoolOpType_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_417(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolOpType X2 = gecode_BoolOpType_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_423(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_427(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_431(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_433(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + BoolVarArgs X4 = gecode_BoolVarArgs_from_term(space,YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_435(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_437(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_440(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_441(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatRelType X3 = gecode_FloatRelType_from_term(YAP_ARG3); + FloatVal X4 = gecode_FloatVal_from_term(YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_442(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVarArgs X2 = gecode_FloatVarArgs_from_term(space,YAP_ARG2); + FloatRelType X3 = gecode_FloatRelType_from_term(YAP_ARG3); + FloatVar X4 = gecode_FloatVar_from_term(space,YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_443(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + BoolVarArgs X4 = gecode_BoolVarArgs_from_term(space,YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_445(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_447(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_449(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_451(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_454(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_455(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_457(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatRelType X3 = gecode_FloatRelType_from_term(YAP_ARG3); + FloatVal X4 = gecode_FloatVal_from_term(YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_459(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatRelType X3 = gecode_FloatRelType_from_term(YAP_ARG3); + FloatVar X4 = gecode_FloatVar_from_term(space,YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_461(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_465(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_469(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + SetRelType X3 = gecode_SetRelType_from_term(YAP_ARG3); + SetVar X4 = gecode_SetVar_from_term(space,YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_471(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_473(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetRelType X3 = gecode_SetRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_475(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetRelType X3 = gecode_SetRelType_from_term(YAP_ARG3); + SetVar X4 = gecode_SetVar_from_term(space,YAP_ARG4); + rel(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_416(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolOpType X2 = gecode_BoolOpType_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_418(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolOpType X2 = gecode_BoolOpType_from_term(YAP_ARG2); + BoolVarArgs X3 = gecode_BoolVarArgs_from_term(space,YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_419(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + BoolOpType X3 = gecode_BoolOpType_from_term(YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + BoolVar X5 = gecode_BoolVar_from_term(space,YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_421(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + BoolOpType X3 = gecode_BoolOpType_from_term(YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_424(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_425(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_428(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_429(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_432(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_434(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + BoolVarArgs X4 = gecode_BoolVarArgs_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_436(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_438(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_444(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + BoolVarArgs X4 = gecode_BoolVarArgs_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_446(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntArgs X2 = gecode_IntArgs_from_term(YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_448(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_450(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_452(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_456(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_458(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatRelType X3 = gecode_FloatRelType_from_term(YAP_ARG3); + FloatVal X4 = gecode_FloatVal_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_460(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatRelType X3 = gecode_FloatRelType_from_term(YAP_ARG3); + FloatVar X4 = gecode_FloatVar_from_term(space,YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_462(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_463(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_466(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_467(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_470(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + SetRelType X3 = gecode_SetRelType_from_term(YAP_ARG3); + SetVar X4 = gecode_SetVar_from_term(space,YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_472(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_474(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetRelType X3 = gecode_SetRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_476(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar X2 = gecode_SetVar_from_term(space,YAP_ARG2); + SetRelType X3 = gecode_SetRelType_from_term(YAP_ARG3); + SetVar X4 = gecode_SetVar_from_term(space,YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + rel(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_420(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + BoolOpType X3 = gecode_BoolOpType_from_term(YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + BoolVar X5 = gecode_BoolVar_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + rel(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_422(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + BoolOpType X3 = gecode_BoolOpType_from_term(YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + rel(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_426(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + BoolVar X4 = gecode_BoolVar_from_term(space,YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + rel(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_430(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + rel(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_464(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + rel(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_468(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + IntVar X4 = gecode_IntVar_from_term(space,YAP_ARG4); + Reify X5 = gecode_Reify_from_term(YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + rel(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_439(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + rel(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_rel_453(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntRelType X3 = gecode_IntRelType_from_term(YAP_ARG3); + rel(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_sequence_477(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + int X6 = gecode_int_from_term(YAP_ARG6); + sequence(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_sequence_479(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + int X6 = gecode_int_from_term(YAP_ARG6); + sequence(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_sequence_478(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + int X6 = gecode_int_from_term(YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + sequence(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_sequence_480(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntSet X3 = gecode_IntSet_from_term(YAP_ARG3); + int X4 = gecode_int_from_term(YAP_ARG4); + int X5 = gecode_int_from_term(YAP_ARG5); + int X6 = gecode_int_from_term(YAP_ARG6); + IntPropLevel X7 = gecode_IntPropLevel_from_term(YAP_ARG7); + sequence(*space,X2,X3,X4,X5,X6,X7); + return TRUE; +} + +static YAP_Bool gecode_constraint_sorted_481(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + sorted(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_sorted_484(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + sorted(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_sorted_482(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + sorted(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_sorted_483(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + sorted(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_sqr_485(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatVar X3 = gecode_FloatVar_from_term(space,YAP_ARG3); + sqr(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_sqr_486(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + sqr(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_sqr_487(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + sqr(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_sqrt_488(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + FloatVar X2 = gecode_FloatVar_from_term(space,YAP_ARG2); + FloatVar X3 = gecode_FloatVar_from_term(space,YAP_ARG3); + sqrt(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_sqrt_489(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + sqrt(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_sqrt_490(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar X2 = gecode_IntVar_from_term(space,YAP_ARG2); + IntVar X3 = gecode_IntVar_from_term(space,YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + sqrt(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_unary_491(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntArgs X3 = gecode_IntArgs_from_term(YAP_ARG3); + BoolVarArgs X4 = gecode_BoolVarArgs_from_term(space,YAP_ARG4); + unary(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_unary_494(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntArgs X3 = gecode_IntArgs_from_term(YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + unary(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_unary_497(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + unary(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_unary_501(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + TaskTypeArgs X2 = gecode_TaskTypeArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + unary(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_unary_492(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntArgs X3 = gecode_IntArgs_from_term(YAP_ARG3); + BoolVarArgs X4 = gecode_BoolVarArgs_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + unary(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_unary_495(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + BoolVarArgs X5 = gecode_BoolVarArgs_from_term(space,YAP_ARG5); + unary(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_unary_498(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + unary(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_unary_499(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + TaskTypeArgs X2 = gecode_TaskTypeArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + BoolVarArgs X5 = gecode_BoolVarArgs_from_term(space,YAP_ARG5); + unary(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_unary_502(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + TaskTypeArgs X2 = gecode_TaskTypeArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + unary(*space,X2,X3,X4,X5); + return TRUE; +} + +static YAP_Bool gecode_constraint_unary_493(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntArgs X3 = gecode_IntArgs_from_term(YAP_ARG3); + unary(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_unary_496(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntVarArgs X4 = gecode_IntVarArgs_from_term(space,YAP_ARG4); + BoolVarArgs X5 = gecode_BoolVarArgs_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + unary(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_unary_500(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + TaskTypeArgs X2 = gecode_TaskTypeArgs_from_term(YAP_ARG2); + IntVarArgs X3 = gecode_IntVarArgs_from_term(space,YAP_ARG3); + IntArgs X4 = gecode_IntArgs_from_term(YAP_ARG4); + BoolVarArgs X5 = gecode_BoolVarArgs_from_term(space,YAP_ARG5); + IntPropLevel X6 = gecode_IntPropLevel_from_term(YAP_ARG6); + unary(*space,X2,X3,X4,X5,X6); + return TRUE; +} + +static YAP_Bool gecode_constraint_unshare_503(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + unshare(*space,X2); + return TRUE; +} + +static YAP_Bool gecode_constraint_unshare_505(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + unshare(*space,X2); + return TRUE; +} + +static YAP_Bool gecode_constraint_unshare_504(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVarArgs X2 = gecode_BoolVarArgs_from_term(space,YAP_ARG2); + IntPropLevel X3 = gecode_IntPropLevel_from_term(YAP_ARG3); + unshare(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_unshare_506(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVarArgs X2 = gecode_IntVarArgs_from_term(space,YAP_ARG2); + IntPropLevel X3 = gecode_IntPropLevel_from_term(YAP_ARG3); + unshare(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_when_507(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + std::function X3 = gecode_std_function_from_term(YAP_ARG3); + when(*space,X2,X3); + return TRUE; +} + +static YAP_Bool gecode_constraint_when_508(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + std::function X3 = gecode_std_function_from_term(YAP_ARG3); + IntPropLevel X4 = gecode_IntPropLevel_from_term(YAP_ARG4); + when(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_when_509(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + std::function X3 = gecode_std_function_from_term(YAP_ARG3); + std::function X4 = gecode_std_function_from_term(YAP_ARG4); + when(*space,X2,X3,X4); + return TRUE; +} + +static YAP_Bool gecode_constraint_when_510(void) +{ + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar X2 = gecode_BoolVar_from_term(space,YAP_ARG2); + std::function X3 = gecode_std_function_from_term(YAP_ARG3); + std::function X4 = gecode_std_function_from_term(YAP_ARG4); + IntPropLevel X5 = gecode_IntPropLevel_from_term(YAP_ARG5); + when(*space,X2,X3,X4,X5); + return TRUE; +} + diff --git a/packages/gecode/6.2.0/gecode_yap_cc_init_auto_generated.icc b/packages/gecode/6.2.0/gecode_yap_cc_init_auto_generated.icc new file mode 100644 index 000000000..b12918847 --- /dev/null +++ b/packages/gecode/6.2.0/gecode_yap_cc_init_auto_generated.icc @@ -0,0 +1,712 @@ +// -*- c++ -*- +//============================================================================= +// Copyright (C) 2011 by Denys Duchier +// +// This program is free software: you can redistribute it and/or modify it +// under the terms of the GNU Lesser General Public License as published by the +// Free Software Foundation, either version 3 of the License, or (at your +// option) any later version. +// +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +// more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . +//============================================================================= + +{ YAP_Atom X= YAP_LookupAtom("RM_NONE"); + gecode_RM_NONE = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("RM_CONSTANT"); + gecode_RM_CONSTANT = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("RM_LINEAR"); + gecode_RM_LINEAR = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("RM_LUBY"); + gecode_RM_LUBY = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("RM_GEOMETRIC"); + gecode_RM_GEOMETRIC = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } + +{ YAP_Atom X= YAP_LookupAtom("FRT_EQ"); + gecode_FRT_EQ = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("FRT_NQ"); + gecode_FRT_NQ = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("FRT_LQ"); + gecode_FRT_LQ = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("FRT_LE"); + gecode_FRT_LE = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("FRT_GQ"); + gecode_FRT_GQ = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("FRT_GR"); + gecode_FRT_GR = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } + +{ YAP_Atom X= YAP_LookupAtom("RM_EQV"); + gecode_RM_EQV = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("RM_IMP"); + gecode_RM_IMP = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("RM_PMI"); + gecode_RM_PMI = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } + +{ YAP_Atom X= YAP_LookupAtom("IRT_EQ"); + gecode_IRT_EQ = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("IRT_NQ"); + gecode_IRT_NQ = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("IRT_LQ"); + gecode_IRT_LQ = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("IRT_LE"); + gecode_IRT_LE = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("IRT_GQ"); + gecode_IRT_GQ = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("IRT_GR"); + gecode_IRT_GR = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } + +{ YAP_Atom X= YAP_LookupAtom("BOT_AND"); + gecode_BOT_AND = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("BOT_OR"); + gecode_BOT_OR = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("BOT_IMP"); + gecode_BOT_IMP = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("BOT_EQV"); + gecode_BOT_EQV = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("BOT_XOR"); + gecode_BOT_XOR = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } + +{ YAP_Atom X= YAP_LookupAtom("IPL_DEF"); + gecode_IPL_DEF = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("IPL_VAL"); + gecode_IPL_VAL = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("IPL_BND"); + gecode_IPL_BND = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("IPL_DOM"); + gecode_IPL_DOM = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("IPL_BASIC"); + gecode_IPL_BASIC = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("IPL_ADVANCED"); + gecode_IPL_ADVANCED = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("IPL_BASIC_ADVANCED"); + gecode_IPL_BASIC_ADVANCED = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("_IPL_BITS"); + gecode__IPL_BITS = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } + +{ YAP_Atom X= YAP_LookupAtom("TT_FIXP"); + gecode_TT_FIXP = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("TT_FIXS"); + gecode_TT_FIXS = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("TT_FIXE"); + gecode_TT_FIXE = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } + +{ YAP_Atom X= YAP_LookupAtom("TE_INIT"); + gecode_TE_INIT = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("TE_PRUNE"); + gecode_TE_PRUNE = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("TE_FIX"); + gecode_TE_FIX = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("TE_FAIL"); + gecode_TE_FAIL = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("TE_DONE"); + gecode_TE_DONE = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("TE_PROPAGATE"); + gecode_TE_PROPAGATE = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("TE_COMMIT"); + gecode_TE_COMMIT = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("TE_POST"); + gecode_TE_POST = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } + +{ YAP_Atom X= YAP_LookupAtom("SRT_EQ"); + gecode_SRT_EQ = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("SRT_NQ"); + gecode_SRT_NQ = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("SRT_SUB"); + gecode_SRT_SUB = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("SRT_SUP"); + gecode_SRT_SUP = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("SRT_DISJ"); + gecode_SRT_DISJ = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("SRT_CMPL"); + gecode_SRT_CMPL = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("SRT_LQ"); + gecode_SRT_LQ = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("SRT_LE"); + gecode_SRT_LE = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("SRT_GQ"); + gecode_SRT_GQ = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("SRT_GR"); + gecode_SRT_GR = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } + +{ YAP_Atom X= YAP_LookupAtom("SOT_UNION"); + gecode_SOT_UNION = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("SOT_DUNION"); + gecode_SOT_DUNION = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("SOT_INTER"); + gecode_SOT_INTER = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } +{ YAP_Atom X= YAP_LookupAtom("SOT_MINUS"); + gecode_SOT_MINUS = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } + +YAP_UserCPredicate("gecode_constraint_branch_1", gecode_constraint_branch_1, 2); +YAP_UserCPredicate("gecode_constraint_convex_2", gecode_constraint_convex_2, 2); +YAP_UserCPredicate("gecode_constraint_convex_3", gecode_constraint_convex_3, 3); +YAP_UserCPredicate("gecode_constraint_abs_4", gecode_constraint_abs_4, 3); +YAP_UserCPredicate("gecode_constraint_abs_5", gecode_constraint_abs_5, 3); +YAP_UserCPredicate("gecode_constraint_abs_6", gecode_constraint_abs_6, 4); +YAP_UserCPredicate("gecode_constraint_argmax_7", gecode_constraint_argmax_7, 4); +YAP_UserCPredicate("gecode_constraint_argmax_11", gecode_constraint_argmax_11, 4); +YAP_UserCPredicate("gecode_constraint_argmax_13", gecode_constraint_argmax_13, 4); +YAP_UserCPredicate("gecode_constraint_argmax_17", gecode_constraint_argmax_17, 4); +YAP_UserCPredicate("gecode_constraint_argmax_8", gecode_constraint_argmax_8, 5); +YAP_UserCPredicate("gecode_constraint_argmax_12", gecode_constraint_argmax_12, 5); +YAP_UserCPredicate("gecode_constraint_argmax_14", gecode_constraint_argmax_14, 5); +YAP_UserCPredicate("gecode_constraint_argmax_18", gecode_constraint_argmax_18, 5); +YAP_UserCPredicate("gecode_constraint_argmax_9", gecode_constraint_argmax_9, 6); +YAP_UserCPredicate("gecode_constraint_argmax_15", gecode_constraint_argmax_15, 6); +YAP_UserCPredicate("gecode_constraint_argmax_10", gecode_constraint_argmax_10, 3); +YAP_UserCPredicate("gecode_constraint_argmax_16", gecode_constraint_argmax_16, 3); +YAP_UserCPredicate("gecode_constraint_argmin_19", gecode_constraint_argmin_19, 4); +YAP_UserCPredicate("gecode_constraint_argmin_23", gecode_constraint_argmin_23, 4); +YAP_UserCPredicate("gecode_constraint_argmin_25", gecode_constraint_argmin_25, 4); +YAP_UserCPredicate("gecode_constraint_argmin_29", gecode_constraint_argmin_29, 4); +YAP_UserCPredicate("gecode_constraint_argmin_20", gecode_constraint_argmin_20, 5); +YAP_UserCPredicate("gecode_constraint_argmin_24", gecode_constraint_argmin_24, 5); +YAP_UserCPredicate("gecode_constraint_argmin_26", gecode_constraint_argmin_26, 5); +YAP_UserCPredicate("gecode_constraint_argmin_30", gecode_constraint_argmin_30, 5); +YAP_UserCPredicate("gecode_constraint_argmin_21", gecode_constraint_argmin_21, 6); +YAP_UserCPredicate("gecode_constraint_argmin_27", gecode_constraint_argmin_27, 6); +YAP_UserCPredicate("gecode_constraint_argmin_22", gecode_constraint_argmin_22, 3); +YAP_UserCPredicate("gecode_constraint_argmin_28", gecode_constraint_argmin_28, 3); +YAP_UserCPredicate("gecode_constraint_assign_31", gecode_constraint_assign_31, 3); +YAP_UserCPredicate("gecode_constraint_assign_57", gecode_constraint_assign_57, 3); +YAP_UserCPredicate("gecode_constraint_assign_59", gecode_constraint_assign_59, 3); +YAP_UserCPredicate("gecode_constraint_assign_61", gecode_constraint_assign_61, 3); +YAP_UserCPredicate("gecode_constraint_assign_32", gecode_constraint_assign_32, 4); +YAP_UserCPredicate("gecode_constraint_assign_33", gecode_constraint_assign_33, 4); +YAP_UserCPredicate("gecode_constraint_assign_36", gecode_constraint_assign_36, 4); +YAP_UserCPredicate("gecode_constraint_assign_39", gecode_constraint_assign_39, 4); +YAP_UserCPredicate("gecode_constraint_assign_42", gecode_constraint_assign_42, 4); +YAP_UserCPredicate("gecode_constraint_assign_45", gecode_constraint_assign_45, 4); +YAP_UserCPredicate("gecode_constraint_assign_48", gecode_constraint_assign_48, 4); +YAP_UserCPredicate("gecode_constraint_assign_51", gecode_constraint_assign_51, 4); +YAP_UserCPredicate("gecode_constraint_assign_54", gecode_constraint_assign_54, 4); +YAP_UserCPredicate("gecode_constraint_assign_58", gecode_constraint_assign_58, 4); +YAP_UserCPredicate("gecode_constraint_assign_60", gecode_constraint_assign_60, 4); +YAP_UserCPredicate("gecode_constraint_assign_62", gecode_constraint_assign_62, 4); +YAP_UserCPredicate("gecode_constraint_assign_34", gecode_constraint_assign_34, 5); +YAP_UserCPredicate("gecode_constraint_assign_37", gecode_constraint_assign_37, 5); +YAP_UserCPredicate("gecode_constraint_assign_40", gecode_constraint_assign_40, 5); +YAP_UserCPredicate("gecode_constraint_assign_43", gecode_constraint_assign_43, 5); +YAP_UserCPredicate("gecode_constraint_assign_46", gecode_constraint_assign_46, 5); +YAP_UserCPredicate("gecode_constraint_assign_49", gecode_constraint_assign_49, 5); +YAP_UserCPredicate("gecode_constraint_assign_52", gecode_constraint_assign_52, 5); +YAP_UserCPredicate("gecode_constraint_assign_55", gecode_constraint_assign_55, 5); +YAP_UserCPredicate("gecode_constraint_assign_35", gecode_constraint_assign_35, 6); +YAP_UserCPredicate("gecode_constraint_assign_38", gecode_constraint_assign_38, 6); +YAP_UserCPredicate("gecode_constraint_assign_41", gecode_constraint_assign_41, 6); +YAP_UserCPredicate("gecode_constraint_assign_44", gecode_constraint_assign_44, 6); +YAP_UserCPredicate("gecode_constraint_assign_47", gecode_constraint_assign_47, 6); +YAP_UserCPredicate("gecode_constraint_assign_50", gecode_constraint_assign_50, 6); +YAP_UserCPredicate("gecode_constraint_assign_53", gecode_constraint_assign_53, 6); +YAP_UserCPredicate("gecode_constraint_assign_56", gecode_constraint_assign_56, 6); +YAP_UserCPredicate("gecode_constraint_binpacking_63", gecode_constraint_binpacking_63, 4); +YAP_UserCPredicate("gecode_constraint_binpacking_64", gecode_constraint_binpacking_64, 5); +YAP_UserCPredicate("gecode_constraint_branch_65", gecode_constraint_branch_65, 3); +YAP_UserCPredicate("gecode_constraint_branch_109", gecode_constraint_branch_109, 3); +YAP_UserCPredicate("gecode_constraint_branch_111", gecode_constraint_branch_111, 3); +YAP_UserCPredicate("gecode_constraint_branch_113", gecode_constraint_branch_113, 3); +YAP_UserCPredicate("gecode_constraint_branch_66", gecode_constraint_branch_66, 4); +YAP_UserCPredicate("gecode_constraint_branch_67", gecode_constraint_branch_67, 4); +YAP_UserCPredicate("gecode_constraint_branch_73", gecode_constraint_branch_73, 4); +YAP_UserCPredicate("gecode_constraint_branch_79", gecode_constraint_branch_79, 4); +YAP_UserCPredicate("gecode_constraint_branch_82", gecode_constraint_branch_82, 4); +YAP_UserCPredicate("gecode_constraint_branch_88", gecode_constraint_branch_88, 4); +YAP_UserCPredicate("gecode_constraint_branch_94", gecode_constraint_branch_94, 4); +YAP_UserCPredicate("gecode_constraint_branch_100", gecode_constraint_branch_100, 4); +YAP_UserCPredicate("gecode_constraint_branch_106", gecode_constraint_branch_106, 4); +YAP_UserCPredicate("gecode_constraint_branch_110", gecode_constraint_branch_110, 4); +YAP_UserCPredicate("gecode_constraint_branch_112", gecode_constraint_branch_112, 4); +YAP_UserCPredicate("gecode_constraint_branch_114", gecode_constraint_branch_114, 4); +YAP_UserCPredicate("gecode_constraint_branch_68", gecode_constraint_branch_68, 5); +YAP_UserCPredicate("gecode_constraint_branch_70", gecode_constraint_branch_70, 5); +YAP_UserCPredicate("gecode_constraint_branch_74", gecode_constraint_branch_74, 5); +YAP_UserCPredicate("gecode_constraint_branch_76", gecode_constraint_branch_76, 5); +YAP_UserCPredicate("gecode_constraint_branch_80", gecode_constraint_branch_80, 5); +YAP_UserCPredicate("gecode_constraint_branch_83", gecode_constraint_branch_83, 5); +YAP_UserCPredicate("gecode_constraint_branch_85", gecode_constraint_branch_85, 5); +YAP_UserCPredicate("gecode_constraint_branch_89", gecode_constraint_branch_89, 5); +YAP_UserCPredicate("gecode_constraint_branch_91", gecode_constraint_branch_91, 5); +YAP_UserCPredicate("gecode_constraint_branch_95", gecode_constraint_branch_95, 5); +YAP_UserCPredicate("gecode_constraint_branch_97", gecode_constraint_branch_97, 5); +YAP_UserCPredicate("gecode_constraint_branch_101", gecode_constraint_branch_101, 5); +YAP_UserCPredicate("gecode_constraint_branch_103", gecode_constraint_branch_103, 5); +YAP_UserCPredicate("gecode_constraint_branch_107", gecode_constraint_branch_107, 5); +YAP_UserCPredicate("gecode_constraint_branch_69", gecode_constraint_branch_69, 6); +YAP_UserCPredicate("gecode_constraint_branch_71", gecode_constraint_branch_71, 6); +YAP_UserCPredicate("gecode_constraint_branch_75", gecode_constraint_branch_75, 6); +YAP_UserCPredicate("gecode_constraint_branch_77", gecode_constraint_branch_77, 6); +YAP_UserCPredicate("gecode_constraint_branch_81", gecode_constraint_branch_81, 6); +YAP_UserCPredicate("gecode_constraint_branch_84", gecode_constraint_branch_84, 6); +YAP_UserCPredicate("gecode_constraint_branch_86", gecode_constraint_branch_86, 6); +YAP_UserCPredicate("gecode_constraint_branch_90", gecode_constraint_branch_90, 6); +YAP_UserCPredicate("gecode_constraint_branch_92", gecode_constraint_branch_92, 6); +YAP_UserCPredicate("gecode_constraint_branch_96", gecode_constraint_branch_96, 6); +YAP_UserCPredicate("gecode_constraint_branch_98", gecode_constraint_branch_98, 6); +YAP_UserCPredicate("gecode_constraint_branch_102", gecode_constraint_branch_102, 6); +YAP_UserCPredicate("gecode_constraint_branch_104", gecode_constraint_branch_104, 6); +YAP_UserCPredicate("gecode_constraint_branch_108", gecode_constraint_branch_108, 6); +YAP_UserCPredicate("gecode_constraint_branch_72", gecode_constraint_branch_72, 7); +YAP_UserCPredicate("gecode_constraint_branch_78", gecode_constraint_branch_78, 7); +YAP_UserCPredicate("gecode_constraint_branch_87", gecode_constraint_branch_87, 7); +YAP_UserCPredicate("gecode_constraint_branch_93", gecode_constraint_branch_93, 7); +YAP_UserCPredicate("gecode_constraint_branch_99", gecode_constraint_branch_99, 7); +YAP_UserCPredicate("gecode_constraint_branch_105", gecode_constraint_branch_105, 7); +YAP_UserCPredicate("gecode_constraint_cardinality_115", gecode_constraint_cardinality_115, 4); +YAP_UserCPredicate("gecode_constraint_cardinality_116", gecode_constraint_cardinality_116, 4); +YAP_UserCPredicate("gecode_constraint_channel_117", gecode_constraint_channel_117, 3); +YAP_UserCPredicate("gecode_constraint_channel_119", gecode_constraint_channel_119, 3); +YAP_UserCPredicate("gecode_constraint_channel_122", gecode_constraint_channel_122, 3); +YAP_UserCPredicate("gecode_constraint_channel_126", gecode_constraint_channel_126, 3); +YAP_UserCPredicate("gecode_constraint_channel_127", gecode_constraint_channel_127, 3); +YAP_UserCPredicate("gecode_constraint_channel_118", gecode_constraint_channel_118, 4); +YAP_UserCPredicate("gecode_constraint_channel_120", gecode_constraint_channel_120, 4); +YAP_UserCPredicate("gecode_constraint_channel_123", gecode_constraint_channel_123, 4); +YAP_UserCPredicate("gecode_constraint_channel_121", gecode_constraint_channel_121, 5); +YAP_UserCPredicate("gecode_constraint_channel_124", gecode_constraint_channel_124, 5); +YAP_UserCPredicate("gecode_constraint_channel_125", gecode_constraint_channel_125, 6); +YAP_UserCPredicate("gecode_constraint_circuit_128", gecode_constraint_circuit_128, 5); +YAP_UserCPredicate("gecode_constraint_circuit_131", gecode_constraint_circuit_131, 5); +YAP_UserCPredicate("gecode_constraint_circuit_134", gecode_constraint_circuit_134, 5); +YAP_UserCPredicate("gecode_constraint_circuit_129", gecode_constraint_circuit_129, 6); +YAP_UserCPredicate("gecode_constraint_circuit_132", gecode_constraint_circuit_132, 6); +YAP_UserCPredicate("gecode_constraint_circuit_135", gecode_constraint_circuit_135, 6); +YAP_UserCPredicate("gecode_constraint_circuit_130", gecode_constraint_circuit_130, 4); +YAP_UserCPredicate("gecode_constraint_circuit_139", gecode_constraint_circuit_139, 4); +YAP_UserCPredicate("gecode_constraint_circuit_133", gecode_constraint_circuit_133, 7); +YAP_UserCPredicate("gecode_constraint_circuit_136", gecode_constraint_circuit_136, 2); +YAP_UserCPredicate("gecode_constraint_circuit_137", gecode_constraint_circuit_137, 3); +YAP_UserCPredicate("gecode_constraint_circuit_138", gecode_constraint_circuit_138, 3); +YAP_UserCPredicate("gecode_constraint_clause_140", gecode_constraint_clause_140, 5); +YAP_UserCPredicate("gecode_constraint_clause_142", gecode_constraint_clause_142, 5); +YAP_UserCPredicate("gecode_constraint_clause_141", gecode_constraint_clause_141, 6); +YAP_UserCPredicate("gecode_constraint_clause_143", gecode_constraint_clause_143, 6); +YAP_UserCPredicate("gecode_constraint_count_144", gecode_constraint_count_144, 5); +YAP_UserCPredicate("gecode_constraint_count_146", gecode_constraint_count_146, 5); +YAP_UserCPredicate("gecode_constraint_count_149", gecode_constraint_count_149, 5); +YAP_UserCPredicate("gecode_constraint_count_153", gecode_constraint_count_153, 5); +YAP_UserCPredicate("gecode_constraint_count_154", gecode_constraint_count_154, 5); +YAP_UserCPredicate("gecode_constraint_count_156", gecode_constraint_count_156, 5); +YAP_UserCPredicate("gecode_constraint_count_159", gecode_constraint_count_159, 5); +YAP_UserCPredicate("gecode_constraint_count_162", gecode_constraint_count_162, 5); +YAP_UserCPredicate("gecode_constraint_count_164", gecode_constraint_count_164, 5); +YAP_UserCPredicate("gecode_constraint_count_166", gecode_constraint_count_166, 5); +YAP_UserCPredicate("gecode_constraint_count_168", gecode_constraint_count_168, 5); +YAP_UserCPredicate("gecode_constraint_count_145", gecode_constraint_count_145, 6); +YAP_UserCPredicate("gecode_constraint_count_147", gecode_constraint_count_147, 6); +YAP_UserCPredicate("gecode_constraint_count_155", gecode_constraint_count_155, 6); +YAP_UserCPredicate("gecode_constraint_count_157", gecode_constraint_count_157, 6); +YAP_UserCPredicate("gecode_constraint_count_163", gecode_constraint_count_163, 6); +YAP_UserCPredicate("gecode_constraint_count_165", gecode_constraint_count_165, 6); +YAP_UserCPredicate("gecode_constraint_count_167", gecode_constraint_count_167, 6); +YAP_UserCPredicate("gecode_constraint_count_169", gecode_constraint_count_169, 6); +YAP_UserCPredicate("gecode_constraint_count_148", gecode_constraint_count_148, 4); +YAP_UserCPredicate("gecode_constraint_count_151", gecode_constraint_count_151, 4); +YAP_UserCPredicate("gecode_constraint_count_152", gecode_constraint_count_152, 4); +YAP_UserCPredicate("gecode_constraint_count_158", gecode_constraint_count_158, 4); +YAP_UserCPredicate("gecode_constraint_count_161", gecode_constraint_count_161, 4); +YAP_UserCPredicate("gecode_constraint_count_150", gecode_constraint_count_150, 3); +YAP_UserCPredicate("gecode_constraint_count_160", gecode_constraint_count_160, 3); +YAP_UserCPredicate("gecode_constraint_cumulative_170", gecode_constraint_cumulative_170, 6); +YAP_UserCPredicate("gecode_constraint_cumulative_173", gecode_constraint_cumulative_173, 6); +YAP_UserCPredicate("gecode_constraint_cumulative_176", gecode_constraint_cumulative_176, 6); +YAP_UserCPredicate("gecode_constraint_cumulative_180", gecode_constraint_cumulative_180, 6); +YAP_UserCPredicate("gecode_constraint_cumulative_182", gecode_constraint_cumulative_182, 6); +YAP_UserCPredicate("gecode_constraint_cumulative_185", gecode_constraint_cumulative_185, 6); +YAP_UserCPredicate("gecode_constraint_cumulative_188", gecode_constraint_cumulative_188, 6); +YAP_UserCPredicate("gecode_constraint_cumulative_192", gecode_constraint_cumulative_192, 6); +YAP_UserCPredicate("gecode_constraint_cumulative_171", gecode_constraint_cumulative_171, 7); +YAP_UserCPredicate("gecode_constraint_cumulative_174", gecode_constraint_cumulative_174, 7); +YAP_UserCPredicate("gecode_constraint_cumulative_177", gecode_constraint_cumulative_177, 7); +YAP_UserCPredicate("gecode_constraint_cumulative_178", gecode_constraint_cumulative_178, 7); +YAP_UserCPredicate("gecode_constraint_cumulative_181", gecode_constraint_cumulative_181, 7); +YAP_UserCPredicate("gecode_constraint_cumulative_183", gecode_constraint_cumulative_183, 7); +YAP_UserCPredicate("gecode_constraint_cumulative_186", gecode_constraint_cumulative_186, 7); +YAP_UserCPredicate("gecode_constraint_cumulative_189", gecode_constraint_cumulative_189, 7); +YAP_UserCPredicate("gecode_constraint_cumulative_190", gecode_constraint_cumulative_190, 7); +YAP_UserCPredicate("gecode_constraint_cumulative_193", gecode_constraint_cumulative_193, 7); +YAP_UserCPredicate("gecode_constraint_cumulative_172", gecode_constraint_cumulative_172, 5); +YAP_UserCPredicate("gecode_constraint_cumulative_184", gecode_constraint_cumulative_184, 5); +YAP_UserCPredicate("gecode_constraint_cumulative_175", gecode_constraint_cumulative_175, 8); +YAP_UserCPredicate("gecode_constraint_cumulative_179", gecode_constraint_cumulative_179, 8); +YAP_UserCPredicate("gecode_constraint_cumulative_187", gecode_constraint_cumulative_187, 8); +YAP_UserCPredicate("gecode_constraint_cumulative_191", gecode_constraint_cumulative_191, 8); +YAP_UserCPredicate("gecode_constraint_cumulatives_194", gecode_constraint_cumulatives_194, 8); +YAP_UserCPredicate("gecode_constraint_cumulatives_196", gecode_constraint_cumulatives_196, 8); +YAP_UserCPredicate("gecode_constraint_cumulatives_198", gecode_constraint_cumulatives_198, 8); +YAP_UserCPredicate("gecode_constraint_cumulatives_200", gecode_constraint_cumulatives_200, 8); +YAP_UserCPredicate("gecode_constraint_cumulatives_202", gecode_constraint_cumulatives_202, 8); +YAP_UserCPredicate("gecode_constraint_cumulatives_204", gecode_constraint_cumulatives_204, 8); +YAP_UserCPredicate("gecode_constraint_cumulatives_206", gecode_constraint_cumulatives_206, 8); +YAP_UserCPredicate("gecode_constraint_cumulatives_208", gecode_constraint_cumulatives_208, 8); +YAP_UserCPredicate("gecode_constraint_cumulatives_195", gecode_constraint_cumulatives_195, 9); +YAP_UserCPredicate("gecode_constraint_cumulatives_197", gecode_constraint_cumulatives_197, 9); +YAP_UserCPredicate("gecode_constraint_cumulatives_199", gecode_constraint_cumulatives_199, 9); +YAP_UserCPredicate("gecode_constraint_cumulatives_201", gecode_constraint_cumulatives_201, 9); +YAP_UserCPredicate("gecode_constraint_cumulatives_203", gecode_constraint_cumulatives_203, 9); +YAP_UserCPredicate("gecode_constraint_cumulatives_205", gecode_constraint_cumulatives_205, 9); +YAP_UserCPredicate("gecode_constraint_cumulatives_207", gecode_constraint_cumulatives_207, 9); +YAP_UserCPredicate("gecode_constraint_cumulatives_209", gecode_constraint_cumulatives_209, 9); +YAP_UserCPredicate("gecode_constraint_distinct_210", gecode_constraint_distinct_210, 3); +YAP_UserCPredicate("gecode_constraint_distinct_212", gecode_constraint_distinct_212, 3); +YAP_UserCPredicate("gecode_constraint_distinct_214", gecode_constraint_distinct_214, 3); +YAP_UserCPredicate("gecode_constraint_distinct_217", gecode_constraint_distinct_217, 3); +YAP_UserCPredicate("gecode_constraint_distinct_211", gecode_constraint_distinct_211, 4); +YAP_UserCPredicate("gecode_constraint_distinct_213", gecode_constraint_distinct_213, 4); +YAP_UserCPredicate("gecode_constraint_distinct_215", gecode_constraint_distinct_215, 4); +YAP_UserCPredicate("gecode_constraint_distinct_216", gecode_constraint_distinct_216, 2); +YAP_UserCPredicate("gecode_constraint_div_218", gecode_constraint_div_218, 4); +YAP_UserCPredicate("gecode_constraint_div_219", gecode_constraint_div_219, 4); +YAP_UserCPredicate("gecode_constraint_div_220", gecode_constraint_div_220, 5); +YAP_UserCPredicate("gecode_constraint_divmod_221", gecode_constraint_divmod_221, 5); +YAP_UserCPredicate("gecode_constraint_divmod_222", gecode_constraint_divmod_222, 6); +YAP_UserCPredicate("gecode_constraint_dom_223", gecode_constraint_dom_223, 3); +YAP_UserCPredicate("gecode_constraint_dom_225", gecode_constraint_dom_225, 3); +YAP_UserCPredicate("gecode_constraint_dom_227", gecode_constraint_dom_227, 3); +YAP_UserCPredicate("gecode_constraint_dom_229", gecode_constraint_dom_229, 3); +YAP_UserCPredicate("gecode_constraint_dom_230", gecode_constraint_dom_230, 3); +YAP_UserCPredicate("gecode_constraint_dom_232", gecode_constraint_dom_232, 3); +YAP_UserCPredicate("gecode_constraint_dom_236", gecode_constraint_dom_236, 3); +YAP_UserCPredicate("gecode_constraint_dom_238", gecode_constraint_dom_238, 3); +YAP_UserCPredicate("gecode_constraint_dom_244", gecode_constraint_dom_244, 3); +YAP_UserCPredicate("gecode_constraint_dom_246", gecode_constraint_dom_246, 3); +YAP_UserCPredicate("gecode_constraint_dom_247", gecode_constraint_dom_247, 3); +YAP_UserCPredicate("gecode_constraint_dom_253", gecode_constraint_dom_253, 3); +YAP_UserCPredicate("gecode_constraint_dom_259", gecode_constraint_dom_259, 3); +YAP_UserCPredicate("gecode_constraint_dom_267", gecode_constraint_dom_267, 3); +YAP_UserCPredicate("gecode_constraint_dom_224", gecode_constraint_dom_224, 4); +YAP_UserCPredicate("gecode_constraint_dom_226", gecode_constraint_dom_226, 4); +YAP_UserCPredicate("gecode_constraint_dom_228", gecode_constraint_dom_228, 4); +YAP_UserCPredicate("gecode_constraint_dom_231", gecode_constraint_dom_231, 4); +YAP_UserCPredicate("gecode_constraint_dom_233", gecode_constraint_dom_233, 4); +YAP_UserCPredicate("gecode_constraint_dom_234", gecode_constraint_dom_234, 4); +YAP_UserCPredicate("gecode_constraint_dom_237", gecode_constraint_dom_237, 4); +YAP_UserCPredicate("gecode_constraint_dom_239", gecode_constraint_dom_239, 4); +YAP_UserCPredicate("gecode_constraint_dom_240", gecode_constraint_dom_240, 4); +YAP_UserCPredicate("gecode_constraint_dom_242", gecode_constraint_dom_242, 4); +YAP_UserCPredicate("gecode_constraint_dom_245", gecode_constraint_dom_245, 4); +YAP_UserCPredicate("gecode_constraint_dom_248", gecode_constraint_dom_248, 4); +YAP_UserCPredicate("gecode_constraint_dom_249", gecode_constraint_dom_249, 4); +YAP_UserCPredicate("gecode_constraint_dom_251", gecode_constraint_dom_251, 4); +YAP_UserCPredicate("gecode_constraint_dom_254", gecode_constraint_dom_254, 4); +YAP_UserCPredicate("gecode_constraint_dom_257", gecode_constraint_dom_257, 4); +YAP_UserCPredicate("gecode_constraint_dom_260", gecode_constraint_dom_260, 4); +YAP_UserCPredicate("gecode_constraint_dom_261", gecode_constraint_dom_261, 4); +YAP_UserCPredicate("gecode_constraint_dom_263", gecode_constraint_dom_263, 4); +YAP_UserCPredicate("gecode_constraint_dom_235", gecode_constraint_dom_235, 5); +YAP_UserCPredicate("gecode_constraint_dom_241", gecode_constraint_dom_241, 5); +YAP_UserCPredicate("gecode_constraint_dom_243", gecode_constraint_dom_243, 5); +YAP_UserCPredicate("gecode_constraint_dom_250", gecode_constraint_dom_250, 5); +YAP_UserCPredicate("gecode_constraint_dom_252", gecode_constraint_dom_252, 5); +YAP_UserCPredicate("gecode_constraint_dom_255", gecode_constraint_dom_255, 5); +YAP_UserCPredicate("gecode_constraint_dom_258", gecode_constraint_dom_258, 5); +YAP_UserCPredicate("gecode_constraint_dom_262", gecode_constraint_dom_262, 5); +YAP_UserCPredicate("gecode_constraint_dom_264", gecode_constraint_dom_264, 5); +YAP_UserCPredicate("gecode_constraint_dom_266", gecode_constraint_dom_266, 5); +YAP_UserCPredicate("gecode_constraint_dom_256", gecode_constraint_dom_256, 6); +YAP_UserCPredicate("gecode_constraint_dom_265", gecode_constraint_dom_265, 6); +YAP_UserCPredicate("gecode_constraint_element_268", gecode_constraint_element_268, 4); +YAP_UserCPredicate("gecode_constraint_element_270", gecode_constraint_element_270, 4); +YAP_UserCPredicate("gecode_constraint_element_274", gecode_constraint_element_274, 4); +YAP_UserCPredicate("gecode_constraint_element_278", gecode_constraint_element_278, 4); +YAP_UserCPredicate("gecode_constraint_element_280", gecode_constraint_element_280, 4); +YAP_UserCPredicate("gecode_constraint_element_282", gecode_constraint_element_282, 4); +YAP_UserCPredicate("gecode_constraint_element_288", gecode_constraint_element_288, 4); +YAP_UserCPredicate("gecode_constraint_element_269", gecode_constraint_element_269, 5); +YAP_UserCPredicate("gecode_constraint_element_271", gecode_constraint_element_271, 5); +YAP_UserCPredicate("gecode_constraint_element_275", gecode_constraint_element_275, 5); +YAP_UserCPredicate("gecode_constraint_element_279", gecode_constraint_element_279, 5); +YAP_UserCPredicate("gecode_constraint_element_281", gecode_constraint_element_281, 5); +YAP_UserCPredicate("gecode_constraint_element_283", gecode_constraint_element_283, 5); +YAP_UserCPredicate("gecode_constraint_element_289", gecode_constraint_element_289, 5); +YAP_UserCPredicate("gecode_constraint_element_272", gecode_constraint_element_272, 7); +YAP_UserCPredicate("gecode_constraint_element_276", gecode_constraint_element_276, 7); +YAP_UserCPredicate("gecode_constraint_element_284", gecode_constraint_element_284, 7); +YAP_UserCPredicate("gecode_constraint_element_286", gecode_constraint_element_286, 7); +YAP_UserCPredicate("gecode_constraint_element_273", gecode_constraint_element_273, 8); +YAP_UserCPredicate("gecode_constraint_element_277", gecode_constraint_element_277, 8); +YAP_UserCPredicate("gecode_constraint_element_285", gecode_constraint_element_285, 8); +YAP_UserCPredicate("gecode_constraint_element_287", gecode_constraint_element_287, 8); +YAP_UserCPredicate("gecode_constraint_extensional_290", gecode_constraint_extensional_290, 4); +YAP_UserCPredicate("gecode_constraint_extensional_295", gecode_constraint_extensional_295, 4); +YAP_UserCPredicate("gecode_constraint_extensional_296", gecode_constraint_extensional_296, 4); +YAP_UserCPredicate("gecode_constraint_extensional_301", gecode_constraint_extensional_301, 4); +YAP_UserCPredicate("gecode_constraint_extensional_291", gecode_constraint_extensional_291, 5); +YAP_UserCPredicate("gecode_constraint_extensional_292", gecode_constraint_extensional_292, 5); +YAP_UserCPredicate("gecode_constraint_extensional_297", gecode_constraint_extensional_297, 5); +YAP_UserCPredicate("gecode_constraint_extensional_298", gecode_constraint_extensional_298, 5); +YAP_UserCPredicate("gecode_constraint_extensional_293", gecode_constraint_extensional_293, 6); +YAP_UserCPredicate("gecode_constraint_extensional_299", gecode_constraint_extensional_299, 6); +YAP_UserCPredicate("gecode_constraint_extensional_294", gecode_constraint_extensional_294, 3); +YAP_UserCPredicate("gecode_constraint_extensional_300", gecode_constraint_extensional_300, 3); +YAP_UserCPredicate("gecode_constraint_ite_302", gecode_constraint_ite_302, 5); +YAP_UserCPredicate("gecode_constraint_ite_304", gecode_constraint_ite_304, 5); +YAP_UserCPredicate("gecode_constraint_ite_305", gecode_constraint_ite_305, 5); +YAP_UserCPredicate("gecode_constraint_ite_307", gecode_constraint_ite_307, 5); +YAP_UserCPredicate("gecode_constraint_ite_303", gecode_constraint_ite_303, 6); +YAP_UserCPredicate("gecode_constraint_ite_306", gecode_constraint_ite_306, 6); +YAP_UserCPredicate("gecode_constraint_linear_308", gecode_constraint_linear_308, 4); +YAP_UserCPredicate("gecode_constraint_linear_312", gecode_constraint_linear_312, 4); +YAP_UserCPredicate("gecode_constraint_linear_320", gecode_constraint_linear_320, 4); +YAP_UserCPredicate("gecode_constraint_linear_322", gecode_constraint_linear_322, 4); +YAP_UserCPredicate("gecode_constraint_linear_340", gecode_constraint_linear_340, 4); +YAP_UserCPredicate("gecode_constraint_linear_344", gecode_constraint_linear_344, 4); +YAP_UserCPredicate("gecode_constraint_linear_309", gecode_constraint_linear_309, 5); +YAP_UserCPredicate("gecode_constraint_linear_310", gecode_constraint_linear_310, 5); +YAP_UserCPredicate("gecode_constraint_linear_313", gecode_constraint_linear_313, 5); +YAP_UserCPredicate("gecode_constraint_linear_314", gecode_constraint_linear_314, 5); +YAP_UserCPredicate("gecode_constraint_linear_316", gecode_constraint_linear_316, 5); +YAP_UserCPredicate("gecode_constraint_linear_318", gecode_constraint_linear_318, 5); +YAP_UserCPredicate("gecode_constraint_linear_321", gecode_constraint_linear_321, 5); +YAP_UserCPredicate("gecode_constraint_linear_323", gecode_constraint_linear_323, 5); +YAP_UserCPredicate("gecode_constraint_linear_324", gecode_constraint_linear_324, 5); +YAP_UserCPredicate("gecode_constraint_linear_328", gecode_constraint_linear_328, 5); +YAP_UserCPredicate("gecode_constraint_linear_332", gecode_constraint_linear_332, 5); +YAP_UserCPredicate("gecode_constraint_linear_336", gecode_constraint_linear_336, 5); +YAP_UserCPredicate("gecode_constraint_linear_341", gecode_constraint_linear_341, 5); +YAP_UserCPredicate("gecode_constraint_linear_342", gecode_constraint_linear_342, 5); +YAP_UserCPredicate("gecode_constraint_linear_345", gecode_constraint_linear_345, 5); +YAP_UserCPredicate("gecode_constraint_linear_346", gecode_constraint_linear_346, 5); +YAP_UserCPredicate("gecode_constraint_linear_311", gecode_constraint_linear_311, 6); +YAP_UserCPredicate("gecode_constraint_linear_315", gecode_constraint_linear_315, 6); +YAP_UserCPredicate("gecode_constraint_linear_317", gecode_constraint_linear_317, 6); +YAP_UserCPredicate("gecode_constraint_linear_319", gecode_constraint_linear_319, 6); +YAP_UserCPredicate("gecode_constraint_linear_325", gecode_constraint_linear_325, 6); +YAP_UserCPredicate("gecode_constraint_linear_326", gecode_constraint_linear_326, 6); +YAP_UserCPredicate("gecode_constraint_linear_329", gecode_constraint_linear_329, 6); +YAP_UserCPredicate("gecode_constraint_linear_330", gecode_constraint_linear_330, 6); +YAP_UserCPredicate("gecode_constraint_linear_333", gecode_constraint_linear_333, 6); +YAP_UserCPredicate("gecode_constraint_linear_334", gecode_constraint_linear_334, 6); +YAP_UserCPredicate("gecode_constraint_linear_337", gecode_constraint_linear_337, 6); +YAP_UserCPredicate("gecode_constraint_linear_338", gecode_constraint_linear_338, 6); +YAP_UserCPredicate("gecode_constraint_linear_343", gecode_constraint_linear_343, 6); +YAP_UserCPredicate("gecode_constraint_linear_347", gecode_constraint_linear_347, 6); +YAP_UserCPredicate("gecode_constraint_linear_327", gecode_constraint_linear_327, 7); +YAP_UserCPredicate("gecode_constraint_linear_331", gecode_constraint_linear_331, 7); +YAP_UserCPredicate("gecode_constraint_linear_335", gecode_constraint_linear_335, 7); +YAP_UserCPredicate("gecode_constraint_linear_339", gecode_constraint_linear_339, 7); +YAP_UserCPredicate("gecode_constraint_max_348", gecode_constraint_max_348, 3); +YAP_UserCPredicate("gecode_constraint_max_349", gecode_constraint_max_349, 3); +YAP_UserCPredicate("gecode_constraint_max_350", gecode_constraint_max_350, 4); +YAP_UserCPredicate("gecode_constraint_max_351", gecode_constraint_max_351, 4); +YAP_UserCPredicate("gecode_constraint_max_352", gecode_constraint_max_352, 4); +YAP_UserCPredicate("gecode_constraint_max_353", gecode_constraint_max_353, 5); +YAP_UserCPredicate("gecode_constraint_member_354", gecode_constraint_member_354, 3); +YAP_UserCPredicate("gecode_constraint_member_358", gecode_constraint_member_358, 3); +YAP_UserCPredicate("gecode_constraint_member_355", gecode_constraint_member_355, 4); +YAP_UserCPredicate("gecode_constraint_member_356", gecode_constraint_member_356, 4); +YAP_UserCPredicate("gecode_constraint_member_359", gecode_constraint_member_359, 4); +YAP_UserCPredicate("gecode_constraint_member_360", gecode_constraint_member_360, 4); +YAP_UserCPredicate("gecode_constraint_member_357", gecode_constraint_member_357, 5); +YAP_UserCPredicate("gecode_constraint_member_361", gecode_constraint_member_361, 5); +YAP_UserCPredicate("gecode_constraint_min_362", gecode_constraint_min_362, 3); +YAP_UserCPredicate("gecode_constraint_min_363", gecode_constraint_min_363, 3); +YAP_UserCPredicate("gecode_constraint_min_364", gecode_constraint_min_364, 4); +YAP_UserCPredicate("gecode_constraint_min_365", gecode_constraint_min_365, 4); +YAP_UserCPredicate("gecode_constraint_min_366", gecode_constraint_min_366, 4); +YAP_UserCPredicate("gecode_constraint_min_367", gecode_constraint_min_367, 5); +YAP_UserCPredicate("gecode_constraint_mod_368", gecode_constraint_mod_368, 4); +YAP_UserCPredicate("gecode_constraint_mod_369", gecode_constraint_mod_369, 5); +YAP_UserCPredicate("gecode_constraint_mult_370", gecode_constraint_mult_370, 4); +YAP_UserCPredicate("gecode_constraint_mult_371", gecode_constraint_mult_371, 4); +YAP_UserCPredicate("gecode_constraint_mult_372", gecode_constraint_mult_372, 5); +YAP_UserCPredicate("gecode_constraint_nooverlap_373", gecode_constraint_nooverlap_373, 6); +YAP_UserCPredicate("gecode_constraint_nooverlap_376", gecode_constraint_nooverlap_376, 6); +YAP_UserCPredicate("gecode_constraint_nooverlap_374", gecode_constraint_nooverlap_374, 7); +YAP_UserCPredicate("gecode_constraint_nooverlap_379", gecode_constraint_nooverlap_379, 7); +YAP_UserCPredicate("gecode_constraint_nooverlap_375", gecode_constraint_nooverlap_375, 5); +YAP_UserCPredicate("gecode_constraint_nooverlap_377", gecode_constraint_nooverlap_377, 8); +YAP_UserCPredicate("gecode_constraint_nooverlap_380", gecode_constraint_nooverlap_380, 8); +YAP_UserCPredicate("gecode_constraint_nooverlap_378", gecode_constraint_nooverlap_378, 9); +YAP_UserCPredicate("gecode_constraint_nroot_381", gecode_constraint_nroot_381, 4); +YAP_UserCPredicate("gecode_constraint_nroot_382", gecode_constraint_nroot_382, 4); +YAP_UserCPredicate("gecode_constraint_nroot_383", gecode_constraint_nroot_383, 5); +YAP_UserCPredicate("gecode_constraint_nvalues_384", gecode_constraint_nvalues_384, 4); +YAP_UserCPredicate("gecode_constraint_nvalues_386", gecode_constraint_nvalues_386, 4); +YAP_UserCPredicate("gecode_constraint_nvalues_388", gecode_constraint_nvalues_388, 4); +YAP_UserCPredicate("gecode_constraint_nvalues_390", gecode_constraint_nvalues_390, 4); +YAP_UserCPredicate("gecode_constraint_nvalues_385", gecode_constraint_nvalues_385, 5); +YAP_UserCPredicate("gecode_constraint_nvalues_387", gecode_constraint_nvalues_387, 5); +YAP_UserCPredicate("gecode_constraint_nvalues_389", gecode_constraint_nvalues_389, 5); +YAP_UserCPredicate("gecode_constraint_nvalues_391", gecode_constraint_nvalues_391, 5); +YAP_UserCPredicate("gecode_constraint_order_392", gecode_constraint_order_392, 6); +YAP_UserCPredicate("gecode_constraint_order_393", gecode_constraint_order_393, 7); +YAP_UserCPredicate("gecode_constraint_path_394", gecode_constraint_path_394, 7); +YAP_UserCPredicate("gecode_constraint_path_397", gecode_constraint_path_397, 7); +YAP_UserCPredicate("gecode_constraint_path_400", gecode_constraint_path_400, 7); +YAP_UserCPredicate("gecode_constraint_path_395", gecode_constraint_path_395, 8); +YAP_UserCPredicate("gecode_constraint_path_398", gecode_constraint_path_398, 8); +YAP_UserCPredicate("gecode_constraint_path_401", gecode_constraint_path_401, 8); +YAP_UserCPredicate("gecode_constraint_path_396", gecode_constraint_path_396, 6); +YAP_UserCPredicate("gecode_constraint_path_405", gecode_constraint_path_405, 6); +YAP_UserCPredicate("gecode_constraint_path_399", gecode_constraint_path_399, 9); +YAP_UserCPredicate("gecode_constraint_path_402", gecode_constraint_path_402, 4); +YAP_UserCPredicate("gecode_constraint_path_403", gecode_constraint_path_403, 5); +YAP_UserCPredicate("gecode_constraint_path_404", gecode_constraint_path_404, 5); +YAP_UserCPredicate("gecode_constraint_pow_406", gecode_constraint_pow_406, 4); +YAP_UserCPredicate("gecode_constraint_pow_407", gecode_constraint_pow_407, 4); +YAP_UserCPredicate("gecode_constraint_pow_408", gecode_constraint_pow_408, 5); +YAP_UserCPredicate("gecode_constraint_precede_409", gecode_constraint_precede_409, 3); +YAP_UserCPredicate("gecode_constraint_precede_410", gecode_constraint_precede_410, 4); +YAP_UserCPredicate("gecode_constraint_precede_411", gecode_constraint_precede_411, 4); +YAP_UserCPredicate("gecode_constraint_precede_412", gecode_constraint_precede_412, 5); +YAP_UserCPredicate("gecode_constraint_relax_413", gecode_constraint_relax_413, 5); +YAP_UserCPredicate("gecode_constraint_relax_414", gecode_constraint_relax_414, 5); +YAP_UserCPredicate("gecode_constraint_rel_415", gecode_constraint_rel_415, 4); +YAP_UserCPredicate("gecode_constraint_rel_417", gecode_constraint_rel_417, 4); +YAP_UserCPredicate("gecode_constraint_rel_423", gecode_constraint_rel_423, 4); +YAP_UserCPredicate("gecode_constraint_rel_427", gecode_constraint_rel_427, 4); +YAP_UserCPredicate("gecode_constraint_rel_431", gecode_constraint_rel_431, 4); +YAP_UserCPredicate("gecode_constraint_rel_433", gecode_constraint_rel_433, 4); +YAP_UserCPredicate("gecode_constraint_rel_435", gecode_constraint_rel_435, 4); +YAP_UserCPredicate("gecode_constraint_rel_437", gecode_constraint_rel_437, 4); +YAP_UserCPredicate("gecode_constraint_rel_440", gecode_constraint_rel_440, 4); +YAP_UserCPredicate("gecode_constraint_rel_441", gecode_constraint_rel_441, 4); +YAP_UserCPredicate("gecode_constraint_rel_442", gecode_constraint_rel_442, 4); +YAP_UserCPredicate("gecode_constraint_rel_443", gecode_constraint_rel_443, 4); +YAP_UserCPredicate("gecode_constraint_rel_445", gecode_constraint_rel_445, 4); +YAP_UserCPredicate("gecode_constraint_rel_447", gecode_constraint_rel_447, 4); +YAP_UserCPredicate("gecode_constraint_rel_449", gecode_constraint_rel_449, 4); +YAP_UserCPredicate("gecode_constraint_rel_451", gecode_constraint_rel_451, 4); +YAP_UserCPredicate("gecode_constraint_rel_454", gecode_constraint_rel_454, 4); +YAP_UserCPredicate("gecode_constraint_rel_455", gecode_constraint_rel_455, 4); +YAP_UserCPredicate("gecode_constraint_rel_457", gecode_constraint_rel_457, 4); +YAP_UserCPredicate("gecode_constraint_rel_459", gecode_constraint_rel_459, 4); +YAP_UserCPredicate("gecode_constraint_rel_461", gecode_constraint_rel_461, 4); +YAP_UserCPredicate("gecode_constraint_rel_465", gecode_constraint_rel_465, 4); +YAP_UserCPredicate("gecode_constraint_rel_469", gecode_constraint_rel_469, 4); +YAP_UserCPredicate("gecode_constraint_rel_471", gecode_constraint_rel_471, 4); +YAP_UserCPredicate("gecode_constraint_rel_473", gecode_constraint_rel_473, 4); +YAP_UserCPredicate("gecode_constraint_rel_475", gecode_constraint_rel_475, 4); +YAP_UserCPredicate("gecode_constraint_rel_416", gecode_constraint_rel_416, 5); +YAP_UserCPredicate("gecode_constraint_rel_418", gecode_constraint_rel_418, 5); +YAP_UserCPredicate("gecode_constraint_rel_419", gecode_constraint_rel_419, 5); +YAP_UserCPredicate("gecode_constraint_rel_421", gecode_constraint_rel_421, 5); +YAP_UserCPredicate("gecode_constraint_rel_424", gecode_constraint_rel_424, 5); +YAP_UserCPredicate("gecode_constraint_rel_425", gecode_constraint_rel_425, 5); +YAP_UserCPredicate("gecode_constraint_rel_428", gecode_constraint_rel_428, 5); +YAP_UserCPredicate("gecode_constraint_rel_429", gecode_constraint_rel_429, 5); +YAP_UserCPredicate("gecode_constraint_rel_432", gecode_constraint_rel_432, 5); +YAP_UserCPredicate("gecode_constraint_rel_434", gecode_constraint_rel_434, 5); +YAP_UserCPredicate("gecode_constraint_rel_436", gecode_constraint_rel_436, 5); +YAP_UserCPredicate("gecode_constraint_rel_438", gecode_constraint_rel_438, 5); +YAP_UserCPredicate("gecode_constraint_rel_444", gecode_constraint_rel_444, 5); +YAP_UserCPredicate("gecode_constraint_rel_446", gecode_constraint_rel_446, 5); +YAP_UserCPredicate("gecode_constraint_rel_448", gecode_constraint_rel_448, 5); +YAP_UserCPredicate("gecode_constraint_rel_450", gecode_constraint_rel_450, 5); +YAP_UserCPredicate("gecode_constraint_rel_452", gecode_constraint_rel_452, 5); +YAP_UserCPredicate("gecode_constraint_rel_456", gecode_constraint_rel_456, 5); +YAP_UserCPredicate("gecode_constraint_rel_458", gecode_constraint_rel_458, 5); +YAP_UserCPredicate("gecode_constraint_rel_460", gecode_constraint_rel_460, 5); +YAP_UserCPredicate("gecode_constraint_rel_462", gecode_constraint_rel_462, 5); +YAP_UserCPredicate("gecode_constraint_rel_463", gecode_constraint_rel_463, 5); +YAP_UserCPredicate("gecode_constraint_rel_466", gecode_constraint_rel_466, 5); +YAP_UserCPredicate("gecode_constraint_rel_467", gecode_constraint_rel_467, 5); +YAP_UserCPredicate("gecode_constraint_rel_470", gecode_constraint_rel_470, 5); +YAP_UserCPredicate("gecode_constraint_rel_472", gecode_constraint_rel_472, 5); +YAP_UserCPredicate("gecode_constraint_rel_474", gecode_constraint_rel_474, 5); +YAP_UserCPredicate("gecode_constraint_rel_476", gecode_constraint_rel_476, 5); +YAP_UserCPredicate("gecode_constraint_rel_420", gecode_constraint_rel_420, 6); +YAP_UserCPredicate("gecode_constraint_rel_422", gecode_constraint_rel_422, 6); +YAP_UserCPredicate("gecode_constraint_rel_426", gecode_constraint_rel_426, 6); +YAP_UserCPredicate("gecode_constraint_rel_430", gecode_constraint_rel_430, 6); +YAP_UserCPredicate("gecode_constraint_rel_464", gecode_constraint_rel_464, 6); +YAP_UserCPredicate("gecode_constraint_rel_468", gecode_constraint_rel_468, 6); +YAP_UserCPredicate("gecode_constraint_rel_439", gecode_constraint_rel_439, 3); +YAP_UserCPredicate("gecode_constraint_rel_453", gecode_constraint_rel_453, 3); +YAP_UserCPredicate("gecode_constraint_sequence_477", gecode_constraint_sequence_477, 6); +YAP_UserCPredicate("gecode_constraint_sequence_479", gecode_constraint_sequence_479, 6); +YAP_UserCPredicate("gecode_constraint_sequence_478", gecode_constraint_sequence_478, 7); +YAP_UserCPredicate("gecode_constraint_sequence_480", gecode_constraint_sequence_480, 7); +YAP_UserCPredicate("gecode_constraint_sorted_481", gecode_constraint_sorted_481, 4); +YAP_UserCPredicate("gecode_constraint_sorted_484", gecode_constraint_sorted_484, 4); +YAP_UserCPredicate("gecode_constraint_sorted_482", gecode_constraint_sorted_482, 5); +YAP_UserCPredicate("gecode_constraint_sorted_483", gecode_constraint_sorted_483, 3); +YAP_UserCPredicate("gecode_constraint_sqr_485", gecode_constraint_sqr_485, 3); +YAP_UserCPredicate("gecode_constraint_sqr_486", gecode_constraint_sqr_486, 3); +YAP_UserCPredicate("gecode_constraint_sqr_487", gecode_constraint_sqr_487, 4); +YAP_UserCPredicate("gecode_constraint_sqrt_488", gecode_constraint_sqrt_488, 3); +YAP_UserCPredicate("gecode_constraint_sqrt_489", gecode_constraint_sqrt_489, 3); +YAP_UserCPredicate("gecode_constraint_sqrt_490", gecode_constraint_sqrt_490, 4); +YAP_UserCPredicate("gecode_constraint_unary_491", gecode_constraint_unary_491, 4); +YAP_UserCPredicate("gecode_constraint_unary_494", gecode_constraint_unary_494, 4); +YAP_UserCPredicate("gecode_constraint_unary_497", gecode_constraint_unary_497, 4); +YAP_UserCPredicate("gecode_constraint_unary_501", gecode_constraint_unary_501, 4); +YAP_UserCPredicate("gecode_constraint_unary_492", gecode_constraint_unary_492, 5); +YAP_UserCPredicate("gecode_constraint_unary_495", gecode_constraint_unary_495, 5); +YAP_UserCPredicate("gecode_constraint_unary_498", gecode_constraint_unary_498, 5); +YAP_UserCPredicate("gecode_constraint_unary_499", gecode_constraint_unary_499, 5); +YAP_UserCPredicate("gecode_constraint_unary_502", gecode_constraint_unary_502, 5); +YAP_UserCPredicate("gecode_constraint_unary_493", gecode_constraint_unary_493, 3); +YAP_UserCPredicate("gecode_constraint_unary_496", gecode_constraint_unary_496, 6); +YAP_UserCPredicate("gecode_constraint_unary_500", gecode_constraint_unary_500, 6); +YAP_UserCPredicate("gecode_constraint_unshare_503", gecode_constraint_unshare_503, 2); +YAP_UserCPredicate("gecode_constraint_unshare_505", gecode_constraint_unshare_505, 2); +YAP_UserCPredicate("gecode_constraint_unshare_504", gecode_constraint_unshare_504, 3); +YAP_UserCPredicate("gecode_constraint_unshare_506", gecode_constraint_unshare_506, 3); +YAP_UserCPredicate("gecode_constraint_when_507", gecode_constraint_when_507, 3); +YAP_UserCPredicate("gecode_constraint_when_508", gecode_constraint_when_508, 4); +YAP_UserCPredicate("gecode_constraint_when_509", gecode_constraint_when_509, 4); +YAP_UserCPredicate("gecode_constraint_when_510", gecode_constraint_when_510, 5); From b1b6afe801ff734a74b8672293f80a48c93a6823 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Mon, 22 Apr 2019 12:17:00 +0100 Subject: [PATCH 11/29] bee --- packages/real/yap4r/src/Makevars.in | 4 +- packages/swi-minisat2/C/Alg.h | 57 -- packages/swi-minisat2/C/BasicHeap.h | 98 --- packages/swi-minisat2/C/BoxedVec.h | 147 ---- packages/swi-minisat2/C/CMakeLists.txt | 51 -- packages/swi-minisat2/C/Heap.h | 169 ---- packages/swi-minisat2/C/Makefile.in | 96 --- packages/swi-minisat2/C/Map.h | 118 --- packages/swi-minisat2/C/Queue.h | 82 -- packages/swi-minisat2/C/Solver.C | 791 ------------------ packages/swi-minisat2/C/Solver.h | 311 ------- packages/swi-minisat2/C/SolverTypes.h | 199 ----- packages/swi-minisat2/C/Sort.h | 93 -- packages/swi-minisat2/C/Vec.h | 133 --- packages/swi-minisat2/C/pl-minisat.C | 175 ---- packages/swi-minisat2/CMakeLists.txt | 18 - packages/swi-minisat2/Makefile.in | 51 -- packages/swi-minisat2/README | 8 - packages/swi-minisat2/README.YAP | 13 - packages/swi-minisat2/cnf.pl | 100 --- packages/swi-minisat2/examples/adder.pl | 23 - .../swi-minisat2/examples/pearl_examples.pl | 54 -- packages/swi-minisat2/minisat.pl | 361 -------- 23 files changed, 2 insertions(+), 3150 deletions(-) delete mode 100644 packages/swi-minisat2/C/Alg.h delete mode 100644 packages/swi-minisat2/C/BasicHeap.h delete mode 100644 packages/swi-minisat2/C/BoxedVec.h delete mode 100644 packages/swi-minisat2/C/CMakeLists.txt delete mode 100644 packages/swi-minisat2/C/Heap.h delete mode 100644 packages/swi-minisat2/C/Makefile.in delete mode 100644 packages/swi-minisat2/C/Map.h delete mode 100644 packages/swi-minisat2/C/Queue.h delete mode 100644 packages/swi-minisat2/C/Solver.C delete mode 100644 packages/swi-minisat2/C/Solver.h delete mode 100644 packages/swi-minisat2/C/SolverTypes.h delete mode 100644 packages/swi-minisat2/C/Sort.h delete mode 100644 packages/swi-minisat2/C/Vec.h delete mode 100644 packages/swi-minisat2/C/pl-minisat.C delete mode 100644 packages/swi-minisat2/CMakeLists.txt delete mode 100644 packages/swi-minisat2/Makefile.in delete mode 100644 packages/swi-minisat2/README delete mode 100644 packages/swi-minisat2/README.YAP delete mode 100644 packages/swi-minisat2/cnf.pl delete mode 100644 packages/swi-minisat2/examples/adder.pl delete mode 100644 packages/swi-minisat2/examples/pearl_examples.pl delete mode 100644 packages/swi-minisat2/minisat.pl diff --git a/packages/real/yap4r/src/Makevars.in b/packages/real/yap4r/src/Makevars.in index 18c55bee1..c22fda795 100644 --- a/packages/real/yap4r/src/Makevars.in +++ b/packages/real/yap4r/src/Makevars.in @@ -1,5 +1,5 @@ -PKG_LIBS=-Wl,-rpath=${YAP_LIBDIR} -Wl,-rpath=${YAP_DLLDIR} \ - -L${YAP_LIBDIR} -L${YAP_DLLDIR} -lreal -lYAP++ -lYap +PKG_LIBS=${CMAKE_SHARED_LINKER_FLAGS} #-Wl,-rpath=${YAP_LIBDIR} -Wl,-rpath=${YAP_DLLDIR} \ + #-L${YAP_LIBDIR} -L${YAP_DLLDIR} -lreal -lYAP++ -lYap PKG_CXXFLAGS=-I${YAP_SOURCE_DIR}/CXX -I${YAP_BINARY_DIR}\ -I${YAP_SOURCE_DIR}/include -I${YAP_SOURCE_DIR}/H\ -I${YAP_SOURCE_DIR}/OPTYap -I${YAP_SOURCE_DIR}/os\ diff --git a/packages/swi-minisat2/C/Alg.h b/packages/swi-minisat2/C/Alg.h deleted file mode 100644 index 240962dfc..000000000 --- a/packages/swi-minisat2/C/Alg.h +++ /dev/null @@ -1,57 +0,0 @@ -/*******************************************************************************************[Alg.h] -MiniSat -- Copyright (c) 2003-2006, Niklas Een, Niklas Sorensson - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and -associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or -substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT -NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT -OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -**************************************************************************************************/ - -#ifndef Alg_h -#define Alg_h - -//================================================================================================= -// Useful functions on vectors - - -#if 1 -template -static inline void remove(V& ts, const T& t) -{ - int j = 0; - for (; j < ts.size() && ts[j] != t; j++); - assert(j < ts.size()); - for (; j < ts.size()-1; j++) ts[j] = ts[j+1]; - ts.pop(); -} -#else -template -static inline void remove(V& ts, const T& t) -{ - int j = 0; - for (; j < ts.size() && ts[j] != t; j++); - assert(j < ts.size()); - ts[j] = ts.last(); - ts.pop(); -} -#endif - -template -static inline bool find(V& ts, const T& t) -{ - int j = 0; - for (; j < ts.size() && ts[j] != t; j++); - return j < ts.size(); -} - -#endif diff --git a/packages/swi-minisat2/C/BasicHeap.h b/packages/swi-minisat2/C/BasicHeap.h deleted file mode 100644 index 556d98f84..000000000 --- a/packages/swi-minisat2/C/BasicHeap.h +++ /dev/null @@ -1,98 +0,0 @@ -/******************************************************************************************[Heap.h] -MiniSat -- Copyright (c) 2003-2006, Niklas Een, Niklas Sorensson - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and -associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or -substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT -NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT -OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -**************************************************************************************************/ - -#ifndef BasicHeap_h -#define BasicHeap_h - -#include "Vec.h" - -//================================================================================================= -// A heap implementation with support for decrease/increase key. - - -template -class BasicHeap { - Comp lt; - vec heap; // heap of ints - - // Index "traversal" functions - static inline int left (int i) { return i*2+1; } - static inline int right (int i) { return (i+1)*2; } - static inline int parent(int i) { return (i-1) >> 1; } - - inline void percolateUp(int i) - { - int x = heap[i]; - while (i != 0 && lt(x, heap[parent(i)])){ - heap[i] = heap[parent(i)]; - i = parent(i); - } - heap [i] = x; - } - - - inline void percolateDown(int i) - { - int x = heap[i]; - while (left(i) < heap.size()){ - int child = right(i) < heap.size() && lt(heap[right(i)], heap[left(i)]) ? right(i) : left(i); - if (!lt(heap[child], x)) break; - heap[i] = heap[child]; - i = child; - } - heap[i] = x; - } - - - bool heapProperty(int i) { - return i >= heap.size() - || ((i == 0 || !lt(heap[i], heap[parent(i)])) && heapProperty(left(i)) && heapProperty(right(i))); } - - - public: - BasicHeap(const C& c) : comp(c) { } - - int size () const { return heap.size(); } - bool empty () const { return heap.size() == 0; } - int operator[](int index) const { return heap[index+1]; } - void clear (bool dealloc = false) { heap.clear(dealloc); } - void insert (int n) { heap.push(n); percolateUp(heap.size()-1); } - - - int removeMin() { - int r = heap[0]; - heap[0] = heap.last(); - heap.pop(); - if (heap.size() > 1) percolateDown(0); - return r; - } - - - // DEBUG: consistency checking - bool heapProperty() { - return heapProperty(1); } - - - // COMPAT: should be removed - int getmin () { return removeMin(); } -}; - - -//================================================================================================= -#endif diff --git a/packages/swi-minisat2/C/BoxedVec.h b/packages/swi-minisat2/C/BoxedVec.h deleted file mode 100644 index bddf41008..000000000 --- a/packages/swi-minisat2/C/BoxedVec.h +++ /dev/null @@ -1,147 +0,0 @@ -/*******************************************************************************************[Vec.h] -MiniSat -- Copyright (c) 2003-2006, Niklas Een, Niklas Sorensson - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and -associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or -substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT -NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT -OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -**************************************************************************************************/ - -#ifndef BoxedVec_h -#define BoxedVec_h - -#include -#include -#include - -//================================================================================================= -// Automatically resizable arrays -// -// NOTE! Don't use this vector on datatypes that cannot be re-located in memory (with realloc) - -template -class bvec { - - static inline int imin(int x, int y) { - int mask = (x-y) >> (sizeof(int)*8-1); - return (x&mask) + (y&(~mask)); } - - static inline int imax(int x, int y) { - int mask = (y-x) >> (sizeof(int)*8-1); - return (x&mask) + (y&(~mask)); } - - struct Vec_t { - int sz; - int cap; - T data[0]; - - static Vec_t* alloc(Vec_t* x, int size){ - x = (Vec_t*)realloc((void*)x, sizeof(Vec_t) + sizeof(T)*size); - x->cap = size; - return x; - } - - }; - - Vec_t* ref; - - static const int init_size = 2; - static int nextSize (int current) { return (current * 3 + 1) >> 1; } - static int fitSize (int needed) { int x; for (x = init_size; needed > x; x = nextSize(x)); return x; } - - void fill (int size) { - assert(ref != NULL); - for (T* i = ref->data; i < ref->data + size; i++) - new (i) T(); - } - - void fill (int size, const T& pad) { - assert(ref != NULL); - for (T* i = ref->data; i < ref->data + size; i++) - new (i) T(pad); - } - - // Don't allow copying (error prone): - altvec& operator = (altvec& other) { assert(0); } - altvec (altvec& other) { assert(0); } - -public: - void clear (bool dealloc = false) { - if (ref != NULL){ - for (int i = 0; i < ref->sz; i++) - (*ref).data[i].~T(); - - if (dealloc) { - free(ref); ref = NULL; - }else - ref->sz = 0; - } - } - - // Constructors: - altvec(void) : ref (NULL) { } - altvec(int size) : ref (Vec_t::alloc(NULL, fitSize(size))) { fill(size); ref->sz = size; } - altvec(int size, const T& pad) : ref (Vec_t::alloc(NULL, fitSize(size))) { fill(size, pad); ref->sz = size; } - ~altvec(void) { clear(true); } - - // Ownership of underlying array: - operator T* (void) { return ref->data; } // (unsafe but convenient) - operator const T* (void) const { return ref->data; } - - // Size operations: - int size (void) const { return ref != NULL ? ref->sz : 0; } - - void pop (void) { assert(ref != NULL && ref->sz > 0); int last = --ref->sz; ref->data[last].~T(); } - void push (const T& elem) { - int size = ref != NULL ? ref->sz : 0; - int cap = ref != NULL ? ref->cap : 0; - if (size == cap){ - cap = cap != 0 ? nextSize(cap) : init_size; - ref = Vec_t::alloc(ref, cap); - } - //new (&ref->data[size]) T(elem); - ref->data[size] = elem; - ref->sz = size+1; - } - - void push () { - int size = ref != NULL ? ref->sz : 0; - int cap = ref != NULL ? ref->cap : 0; - if (size == cap){ - cap = cap != 0 ? nextSize(cap) : init_size; - ref = Vec_t::alloc(ref, cap); - } - new (&ref->data[size]) T(); - ref->sz = size+1; - } - - void shrink (int nelems) { for (int i = 0; i < nelems; i++) pop(); } - void shrink_(int nelems) { for (int i = 0; i < nelems; i++) pop(); } - void growTo (int size) { while (this->size() < size) push(); } - void growTo (int size, const T& pad) { while (this->size() < size) push(pad); } - void capacity (int size) { growTo(size); } - - const T& last (void) const { return ref->data[ref->sz-1]; } - T& last (void) { return ref->data[ref->sz-1]; } - - // Vector interface: - const T& operator [] (int index) const { return ref->data[index]; } - T& operator [] (int index) { return ref->data[index]; } - - void copyTo(altvec& copy) const { copy.clear(); for (int i = 0; i < size(); i++) copy.push(ref->data[i]); } - void moveTo(altvec& dest) { dest.clear(true); dest.ref = ref; ref = NULL; } - -}; - - -#endif diff --git a/packages/swi-minisat2/C/CMakeLists.txt b/packages/swi-minisat2/C/CMakeLists.txt deleted file mode 100644 index 455a145d3..000000000 --- a/packages/swi-minisat2/C/CMakeLists.txt +++ /dev/null @@ -1,51 +0,0 @@ - -#cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) - - set ( MINISAT2_HEADERS -Alg.h -BasicHeap.h -BoxedVec.h -Heap.h -Map.h -Queue.h -Solver.h -SolverTypes.h -Sort.h -Vec.h -) - -set ( MINISAT2_SOURCES -Solver.C -pl-minisat.C -) - - - INCLUDE_DIRECTORIES( - ${CMAKE_CURRENT_SOURCE_DIR} - ) - - add_library(minisat2 ${MINISAT2_SOURCES} ${MINISAT2_HEADERS} ) - - set_target_properties (minisat2 PROPERTIES OUTPUT_NAME pl-minisat) - set_target_properties (minisat2 PROPERTIES PREFIX "") - - - if(DEFINED YAP_MAJOR_VERSION) - TARGET_LINK_LIBRARIES(minisat2 - libYap - ) - else() - ADD_LIBRARY(minisat2 SHARED ${MINISAT2_SOURCES} ) - endif() - - #set_property(TARGET minisat2 PROPERTY CXX_STANDARD 11) - #set_property(TARGET minisat2 PROPERTY CXX_STANDARD_REQUIRED ON) - - install ( - TARGETS minisat2 - RUNTIME DESTINATION ${CMAKE_INSTALL_BIINDIR} - ARCHIVE DESTINATION ${YAP_INSTALL_LIBDIR} - LIBRARY DESTINATION ${YAP_INSTALL_LIBDIR} - ) - - diff --git a/packages/swi-minisat2/C/Heap.h b/packages/swi-minisat2/C/Heap.h deleted file mode 100644 index b07ccd152..000000000 --- a/packages/swi-minisat2/C/Heap.h +++ /dev/null @@ -1,169 +0,0 @@ -/******************************************************************************************[Heap.h] -MiniSat -- Copyright (c) 2003-2006, Niklas Een, Niklas Sorensson - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and -associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or -substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT -NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT -OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -**************************************************************************************************/ - -#ifndef Heap_h -#define Heap_h - -#include "Vec.h" - -//================================================================================================= -// A heap implementation with support for decrease/increase key. - - -template -class Heap { - Comp lt; - vec heap; // heap of ints - vec indices; // int -> index in heap - - // Index "traversal" functions - static inline int left (int i) { return i*2+1; } - static inline int right (int i) { return (i+1)*2; } - static inline int parent(int i) { return (i-1) >> 1; } - - - inline void percolateUp(int i) - { - int x = heap[i]; - while (i != 0 && lt(x, heap[parent(i)])){ - heap[i] = heap[parent(i)]; - indices[heap[i]] = i; - i = parent(i); - } - heap [i] = x; - indices[x] = i; - } - - - inline void percolateDown(int i) - { - int x = heap[i]; - while (left(i) < heap.size()){ - int child = right(i) < heap.size() && lt(heap[right(i)], heap[left(i)]) ? right(i) : left(i); - if (!lt(heap[child], x)) break; - heap[i] = heap[child]; - indices[heap[i]] = i; - i = child; - } - heap [i] = x; - indices[x] = i; - } - - - bool heapProperty (int i) const { - return i >= heap.size() - || ((i == 0 || !lt(heap[i], heap[parent(i)])) && heapProperty(left(i)) && heapProperty(right(i))); } - - - public: - Heap(const Comp& c) : lt(c) { } - - int size () const { return heap.size(); } - bool empty () const { return heap.size() == 0; } - bool inHeap (int n) const { return n < indices.size() && indices[n] >= 0; } - int operator[](int index) const { assert(index < heap.size()); return heap[index]; } - - void decrease (int n) { assert(inHeap(n)); percolateUp(indices[n]); } - - // RENAME WHEN THE DEPRECATED INCREASE IS REMOVED. - void increase_ (int n) { assert(inHeap(n)); percolateDown(indices[n]); } - - - void insert(int n) - { - indices.growTo(n+1, -1); - assert(!inHeap(n)); - - indices[n] = heap.size(); - heap.push(n); - percolateUp(indices[n]); - } - - - int removeMin() - { - int x = heap[0]; - heap[0] = heap.last(); - indices[heap[0]] = 0; - indices[x] = -1; - heap.pop(); - if (heap.size() > 1) percolateDown(0); - return x; - } - - - void clear(bool dealloc = false) - { - for (int i = 0; i < heap.size(); i++) - indices[heap[i]] = -1; -#ifdef NDEBUG - for (int i = 0; i < indices.size(); i++) - assert(indices[i] == -1); -#endif - heap.clear(dealloc); - } - - - // Fool proof variant of insert/decrease/increase - void update (int n) - { - if (!inHeap(n)) - insert(n); - else { - percolateUp(indices[n]); - percolateDown(indices[n]); - } - } - - - // Delete elements from the heap using a given filter function (-object). - // *** this could probaly be replaced with a more general "buildHeap(vec&)" method *** - template - void filter(const F& filt) { - int i,j; - for (i = j = 0; i < heap.size(); i++) - if (filt(heap[i])){ - heap[j] = heap[i]; - indices[heap[i]] = j++; - }else - indices[heap[i]] = -1; - - heap.shrink(i - j); - for (int i = heap.size() / 2 - 1; i >= 0; i--) - percolateDown(i); - - assert(heapProperty()); - } - - - // DEBUG: consistency checking - bool heapProperty() const { - return heapProperty(1); } - - - // COMPAT: should be removed - void setBounds (int n) { } - void increase (int n) { decrease(n); } - int getmin () { return removeMin(); } - -}; - - -//================================================================================================= -#endif diff --git a/packages/swi-minisat2/C/Makefile.in b/packages/swi-minisat2/C/Makefile.in deleted file mode 100644 index 7469cadb2..000000000 --- a/packages/swi-minisat2/C/Makefile.in +++ /dev/null @@ -1,96 +0,0 @@ -# -# default base directory for YAP installation -# (EROOT for architecture-dependent files) -# -GCC=@GCC@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ -ROOTDIR = $(prefix) -EROOTDIR = @exec_prefix@ -abs_top_builddir = @abs_top_builddir@ -# -# where the binary should be -# -BINDIR = $(EROOTDIR)/bin -# -# where YAP should look for libraries -# -LIBDIR=@libdir@ -YAPLIBDIR=@libdir@/Yap -# -# -DEFS=@DEFS@ -D_YAP_NOT_INSTALLED_=1 -CC=@CC@ -CXX=@CXX@ -CXXFLAGS= @SHLIB_CXXFLAGS@ $(YAP_EXTRAS) $(DEFS) -I$(srcdir) -I../../.. -I$(srcdir)/../../../os -I$(srcdir)/../../../include @CPPFLAGS@ -LDFLAGS=@LDFLAGS@ -# -# -# You shouldn't need to change what follows. -# -INSTALL=@INSTALL@ -INSTALL_DATA=@INSTALL_DATA@ -INSTALL_PROGRAM=@INSTALL_PROGRAM@ -SHELL=/bin/sh -RANLIB=@RANLIB@ -srcdir=@srcdir@ -SO=@SO@ -#4.1VPATH=@srcdir@:@srcdir@/OPTYap -CWD=$(PWD) -# - -HEADERS= \ - $(srcdir)/Alg.h \ - $(srcdir)/BasicHeap.h \ - $(srcdir)/BoxedVec.h \ - $(srcdir)/Heap.h \ - $(srcdir)/Map.h \ - $(srcdir)/Queue.h \ - $(srcdir)/Solver.h \ - $(srcdir)/SolverTypes.h \ - $(srcdir)/Sort.h \ - $(srcdir)/Vec.h -C_SOURCES=$(srcdir)/pl-minisat.C $(srcdir)/Solver.C - -OBJS = \ - Solver.o \ - pl-minisat.o - -SOBJS=pl-minisat.@SO@ - -#in some systems we just create a single object, in others we need to -# create a libray - -all: $(SOBJS) - -# default rule -Solver.o : $(srcdir)/Solver.C - $(CXX) -c $(CXXFLAGS) $(srcdir)/Solver.C -o Solver.o - -pl-minisat.o : $(srcdir)/pl-minisat.C - $(CXX) -c $(CXXFLAGS) $(srcdir)/pl-minisat.C -o pl-minisat.o - -@DO_SECOND_LD@pl-minisat.@SO@: $(OBJS) -@DO_SECOND_LD@ @SHLIB_CXX_LD@ $(LDFLAGS) -o pl-minisat.@SO@ $(OBJS) @EXTRA_LIBS_FOR_SWIDLLS@ - -install: all - $(INSTALL_PROGRAM) $(SOBJS) $(DESTDIR)$(YAPLIBDIR) - -install-examples: - -clean: - rm -f *.o *~ $(OBJS) $(SOBJS) *.BAK - -distclean: - rm -f Makefile $(OBJS) - - -depend: $(HEADERS) $(C_SOURCES) - -@if test "$(GCC)" = yes; then\ - $(CC) -MM -MG $(CFLAGS) -I$(srcdir) -I$(srcdir)/../../../include -I$(srcdir)/../../../H $(C_SOURCES) >> Makefile;\ - else\ - makedepend -f - -- $(CFLAGS) -I$(srcdir)/../../../H -I$(srcdir)/../../../include -- $(C_SOURCES) |\ - sed 's|.*/\([^:]*\):|\1:|' >> Makefile ;\ - fi - -# DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/packages/swi-minisat2/C/Map.h b/packages/swi-minisat2/C/Map.h deleted file mode 100644 index b6d76a31c..000000000 --- a/packages/swi-minisat2/C/Map.h +++ /dev/null @@ -1,118 +0,0 @@ -/*******************************************************************************************[Map.h] -MiniSat -- Copyright (c) 2003-2006, Niklas Een, Niklas Sorensson - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and -associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or -substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT -NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT -OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -**************************************************************************************************/ - -#ifndef Map_h -#define Map_h - -#include - -#include "Vec.h" - -//================================================================================================= -// Default hash/equals functions -// - -template struct Hash { uint32_t operator()(const K& k) const { return hash(k); } }; -template struct Equal { bool operator()(const K& k1, const K& k2) const { return k1 == k2; } }; - -template struct DeepHash { uint32_t operator()(const K* k) const { return hash(*k); } }; -template struct DeepEqual { bool operator()(const K* k1, const K* k2) const { return *k1 == *k2; } }; - -//================================================================================================= -// Some primes -// - -static const int nprimes = 25; -static const int primes [nprimes] = { 31, 73, 151, 313, 643, 1291, 2593, 5233, 10501, 21013, 42073, 84181, 168451, 337219, 674701, 1349473, 2699299, 5398891, 10798093, 21596719, 43193641, 86387383, 172775299, 345550609, 691101253 }; - -//================================================================================================= -// Hash table implementation of Maps -// - -template, class E = Equal > -class Map { - struct Pair { K key; D data; }; - - H hash; - E equals; - - vec* table; - int cap; - int size; - - // Don't allow copying (error prone): - Map& operator = (Map& other) { assert(0); } - Map (Map& other) { assert(0); } - - int32_t index (const K& k) const { return hash(k) % cap; } - void _insert (const K& k, const D& d) { table[index(k)].push(); table[index(k)].last().key = k; table[index(k)].last().data = d; } - void rehash () { - const vec* old = table; - - int newsize = primes[0]; - for (int i = 1; newsize <= cap && i < nprimes; i++) - newsize = primes[i]; - - table = new vec[newsize]; - - for (int i = 0; i < cap; i++){ - for (int j = 0; j < old[i].size(); j++){ - _insert(old[i][j].key, old[i][j].data); }} - - delete [] old; - - cap = newsize; - } - - - public: - - Map () : table(NULL), cap(0), size(0) {} - Map (const H& h, const E& e) : Map(), hash(h), equals(e) {} - ~Map () { delete [] table; } - - void insert (const K& k, const D& d) { if (size+1 > cap / 2) rehash(); _insert(k, d); size++; } - bool peek (const K& k, D& d) { - if (size == 0) return false; - const vec& ps = table[index(k)]; - for (int i = 0; i < ps.size(); i++) - if (equals(ps[i].key, k)){ - d = ps[i].data; - return true; } - return false; - } - - void remove (const K& k) { - assert(table != NULL); - vec& ps = table[index(k)]; - int j = 0; - for (; j < ps.size() && !equals(ps[j].key, k); j++); - assert(j < ps.size()); - ps[j] = ps.last(); - ps.pop(); - } - - void clear () { - cap = size = 0; - delete [] table; - table = NULL; - } -}; - -#endif diff --git a/packages/swi-minisat2/C/Queue.h b/packages/swi-minisat2/C/Queue.h deleted file mode 100644 index 2cc110ce9..000000000 --- a/packages/swi-minisat2/C/Queue.h +++ /dev/null @@ -1,82 +0,0 @@ -/*****************************************************************************************[Queue.h] -MiniSat -- Copyright (c) 2003-2006, Niklas Een, Niklas Sorensson - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and -associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or -substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT -NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT -OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -**************************************************************************************************/ - -#ifndef Queue_h -#define Queue_h - -#include "Vec.h" - -//================================================================================================= - - -template -class Queue { - vec elems; - int first; - -public: - Queue(void) : first(0) { } - - void insert(T x) { elems.push(x); } - T peek () const { return elems[first]; } - void pop () { first++; } - - void clear(bool dealloc = false) { elems.clear(dealloc); first = 0; } - int size(void) { return elems.size() - first; } - - //bool has(T x) { for (int i = first; i < elems.size(); i++) if (elems[i] == x) return true; return false; } - - const T& operator [] (int index) const { return elems[first + index]; } - -}; - -//template -//class Queue { -// vec buf; -// int first; -// int end; -// -//public: -// typedef T Key; -// -// Queue() : buf(1), first(0), end(0) {} -// -// void clear () { buf.shrinkTo(1); first = end = 0; } -// int size () { return (end >= first) ? end - first : end - first + buf.size(); } -// -// T peek () { assert(first != end); return buf[first]; } -// void pop () { assert(first != end); first++; if (first == buf.size()) first = 0; } -// void insert(T elem) { // INVARIANT: buf[end] is always unused -// buf[end++] = elem; -// if (end == buf.size()) end = 0; -// if (first == end){ // Resize: -// vec tmp((buf.size()*3 + 1) >> 1); -// //**/printf("queue alloc: %d elems (%.1f MB)\n", tmp.size(), tmp.size() * sizeof(T) / 1000000.0); -// int i = 0; -// for (int j = first; j < buf.size(); j++) tmp[i++] = buf[j]; -// for (int j = 0 ; j < end ; j++) tmp[i++] = buf[j]; -// first = 0; -// end = buf.size(); -// tmp.moveTo(buf); -// } -// } -//}; - -//================================================================================================= -#endif diff --git a/packages/swi-minisat2/C/Solver.C b/packages/swi-minisat2/C/Solver.C deleted file mode 100644 index 4b61c6de6..000000000 --- a/packages/swi-minisat2/C/Solver.C +++ /dev/null @@ -1,791 +0,0 @@ -/****************************************************************************************[Solver.C] -MiniSat -- Copyright (c) 2003-2006, Niklas Een, Niklas Sorensson - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and -associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or -substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT -NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT -OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -**************************************************************************************************/ - -#include "Solver.h" -#include "Sort.h" -#include -#include - - -//================================================================================================= -// Constructor/Destructor: - - -Solver::Solver() : - - // Parameters: (formerly in 'SearchParams') - var_decay(1 / 0.95), clause_decay(1 / 0.999), random_var_freq(0.02) - , restart_first(100), restart_inc(1.5), learntsize_factor((double)1/(double)3), learntsize_inc(1.1) - - // More parameters: - // - , expensive_ccmin (true) - , polarity_mode (polarity_false) - , verbosity (0) - - // Statistics: (formerly in 'SolverStats') - // - , starts(0), decisions(0), rnd_decisions(0), propagations(0), conflicts(0) - , clauses_literals(0), learnts_literals(0), max_literals(0), tot_literals(0) - - //*************** - , allMinVarsAssigned(false) - //*************** - - , ok (true) - , cla_inc (1) - , var_inc (1) - , qhead (0) - , simpDB_assigns (-1) - , simpDB_props (0) - , order_heap (VarOrderLt(activity)) - , random_seed (91648253) - , progress_estimate(0) - , remove_satisfied (true) -{} - - -Solver::~Solver() -{ - for (int i = 0; i < learnts.size(); i++) std::free(learnts[i]); - for (int i = 0; i < clauses.size(); i++) std::free(clauses[i]); -} - - -//================================================================================================= -// Minor methods: - - -// Creates a new SAT variable in the solver. If 'decision_var' is cleared, variable will not be -// used as a decision variable (NOTE! This has effects on the meaning of a SATISFIABLE result). -// -Var Solver::newVar(bool sign, bool dvar) -{ - int v = nVars(); - watches .push(); // (list for positive literal) - watches .push(); // (list for negative literal) - reason .push(NULL); - assigns .push(toInt(l_Undef)); - level .push(-1); - activity .push(0); - seen .push(0); - - polarity .push((char)sign); - decision_var.push((char)dvar); - - insertVarOrder(v); - return v; -} - - - -bool Solver::addClause(vec& ps) -{ - assert(decisionLevel() == 0); - - if (!ok) - return false; - else{ - // Check if clause is satisfied and remove false/duplicate literals: - sort(ps); - Lit p; int i, j; - for (i = j = 0, p = lit_Undef; i < ps.size(); i++) - if (value(ps[i]) == l_True || ps[i] == ~p) - return true; - else if (value(ps[i]) != l_False && ps[i] != p) - ps[j++] = p = ps[i]; - ps.shrink(i - j); - } - - if (ps.size() == 0) - return ok = false; - else if (ps.size() == 1){ - assert(value(ps[0]) == l_Undef); - uncheckedEnqueue(ps[0]); - return ok = (propagate() == NULL); - }else{ - Clause* c = Clause_new(ps, false); - clauses.push(c); - attachClause(*c); - } - - return true; -} - - -//**************** -bool Solver::setminVars(vec& ps) -{ - minVars.clear(); - for (int i=0; i < ps.size(); i++){ - minVars.push(ps[i]); - } - allMinVarsAssigned = false; - - return true; -} -//**************** - - -void Solver::attachClause(Clause& c) { - assert(c.size() > 1); - watches[toInt(~c[0])].push(&c); - watches[toInt(~c[1])].push(&c); - if (c.learnt()) learnts_literals += c.size(); - else clauses_literals += c.size(); } - - -void Solver::detachClause(Clause& c) { - assert(c.size() > 1); - assert(find(watches[toInt(~c[0])], &c)); - assert(find(watches[toInt(~c[1])], &c)); - remove(watches[toInt(~c[0])], &c); - remove(watches[toInt(~c[1])], &c); - if (c.learnt()) learnts_literals -= c.size(); - else clauses_literals -= c.size(); } - - -void Solver::removeClause(Clause& c) { - detachClause(c); - std::free(&c); } - - -bool Solver::satisfied(const Clause& c) const { - for (int i = 0; i < c.size(); i++) - if (value(c[i]) == l_True) - return true; - return false; } - - -// Revert to the state at given level (keeping all assignment at 'level' but not beyond). -// -void Solver::cancelUntil(int level) { - if (decisionLevel() > level){ - for (int c = trail.size()-1; c >= trail_lim[level]; c--){ - Var x = var(trail[c]); - assigns[x] = toInt(l_Undef); - insertVarOrder(x); } - qhead = trail_lim[level]; - trail.shrink(trail.size() - trail_lim[level]); - trail_lim.shrink(trail_lim.size() - level); - } - - //************************** - if (lastMinVarDL > level){ - allMinVarsAssigned = false; - } - //************************** -} - - -//================================================================================================= -// Major methods: - - -Lit Solver::pickBranchLit(int polarity_mode, double random_var_freq) -{ - Var next = var_Undef; - - // Random decision: - if (drand(random_seed) < random_var_freq && !order_heap.empty()){ - next = order_heap[irand(random_seed,order_heap.size())]; - if (toLbool(assigns[next]) == l_Undef && decision_var[next]) - rnd_decisions++; } - - // Activity based decision: - while (next == var_Undef || toLbool(assigns[next]) != l_Undef || !decision_var[next]) - if (order_heap.empty()){ - next = var_Undef; - break; - }else - next = order_heap.removeMin(); - - bool sign = false; - switch (polarity_mode){ - case polarity_true: sign = false; break; - case polarity_false: sign = true; break; - case polarity_user: sign = polarity[next]; break; - case polarity_rnd: sign = irand(random_seed, 2); break; - default: assert(false); } - - return next == var_Undef ? lit_Undef : Lit(next, sign); -} - - -/*_________________________________________________________________________________________________ -| -| analyze : (confl : Clause*) (out_learnt : vec&) (out_btlevel : int&) -> [void] -| -| Description: -| Analyze conflict and produce a reason clause. -| -| Pre-conditions: -| * 'out_learnt' is assumed to be cleared. -| * Current decision level must be greater than root level. -| -| Post-conditions: -| * 'out_learnt[0]' is the asserting literal at level 'out_btlevel'. -| -| Effect: -| Will undo part of the trail, upto but not beyond the assumption of the current decision level. -|________________________________________________________________________________________________@*/ -void Solver::analyze(Clause* confl, vec& out_learnt, int& out_btlevel) -{ - int pathC = 0; - Lit p = lit_Undef; - - // Generate conflict clause: - // - out_learnt.push(); // (leave room for the asserting literal) - int index = trail.size() - 1; - out_btlevel = 0; - - do{ - assert(confl != NULL); // (otherwise should be UIP) - Clause& c = *confl; - - if (c.learnt()) - claBumpActivity(c); - - for (int j = (p == lit_Undef) ? 0 : 1; j < c.size(); j++){ - Lit q = c[j]; - - if (!seen[var(q)] && level[var(q)] > 0){ - varBumpActivity(var(q)); - seen[var(q)] = 1; - if (level[var(q)] >= decisionLevel()) - pathC++; - else{ - out_learnt.push(q); - if (level[var(q)] > out_btlevel) - out_btlevel = level[var(q)]; - } - } - } - - // Select next clause to look at: - while (!seen[var(trail[index--])]); - p = trail[index+1]; - confl = reason[var(p)]; - seen[var(p)] = 0; - pathC--; - - }while (pathC > 0); - out_learnt[0] = ~p; - - // Simplify conflict clause: - // - int i, j; - if (expensive_ccmin){ - uint32_t abstract_level = 0; - for (i = 1; i < out_learnt.size(); i++) - abstract_level |= abstractLevel(var(out_learnt[i])); // (maintain an abstraction of levels involved in conflict) - - out_learnt.copyTo(analyze_toclear); - for (i = j = 1; i < out_learnt.size(); i++) - if (reason[var(out_learnt[i])] == NULL || !litRedundant(out_learnt[i], abstract_level)) - out_learnt[j++] = out_learnt[i]; - }else{ - out_learnt.copyTo(analyze_toclear); - for (i = j = 1; i < out_learnt.size(); i++){ - Clause& c = *reason[var(out_learnt[i])]; - for (int k = 1; k < c.size(); k++) - if (!seen[var(c[k])] && level[var(c[k])] > 0){ - out_learnt[j++] = out_learnt[i]; - break; } - } - } - max_literals += out_learnt.size(); - out_learnt.shrink(i - j); - tot_literals += out_learnt.size(); - - // Find correct backtrack level: - // - if (out_learnt.size() == 1) - out_btlevel = 0; - else{ - int max_i = 1; - for (int i = 2; i < out_learnt.size(); i++) - if (level[var(out_learnt[i])] > level[var(out_learnt[max_i])]) - max_i = i; - Lit p = out_learnt[max_i]; - out_learnt[max_i] = out_learnt[1]; - out_learnt[1] = p; - out_btlevel = level[var(p)]; - } - - - for (int j = 0; j < analyze_toclear.size(); j++) seen[var(analyze_toclear[j])] = 0; // ('seen[]' is now cleared) -} - - -// Check if 'p' can be removed. 'abstract_levels' is used to abort early if the algorithm is -// visiting literals at levels that cannot be removed later. -bool Solver::litRedundant(Lit p, uint32_t abstract_levels) -{ - analyze_stack.clear(); analyze_stack.push(p); - int top = analyze_toclear.size(); - while (analyze_stack.size() > 0){ - assert(reason[var(analyze_stack.last())] != NULL); - Clause& c = *reason[var(analyze_stack.last())]; analyze_stack.pop(); - - for (int i = 1; i < c.size(); i++){ - Lit p = c[i]; - if (!seen[var(p)] && level[var(p)] > 0){ - if (reason[var(p)] != NULL && (abstractLevel(var(p)) & abstract_levels) != 0){ - seen[var(p)] = 1; - analyze_stack.push(p); - analyze_toclear.push(p); - }else{ - for (int j = top; j < analyze_toclear.size(); j++) - seen[var(analyze_toclear[j])] = 0; - analyze_toclear.shrink(analyze_toclear.size() - top); - return false; - } - } - } - } - - return true; -} - - -/*_________________________________________________________________________________________________ -| -| analyzeFinal : (p : Lit) -> [void] -| -| Description: -| Specialized analysis procedure to express the final conflict in terms of assumptions. -| Calculates the (possibly empty) set of assumptions that led to the assignment of 'p', and -| stores the result in 'out_conflict'. -|________________________________________________________________________________________________@*/ -void Solver::analyzeFinal(Lit p, vec& out_conflict) -{ - out_conflict.clear(); - out_conflict.push(p); - - if (decisionLevel() == 0) - return; - - seen[var(p)] = 1; - - for (int i = trail.size()-1; i >= trail_lim[0]; i--){ - Var x = var(trail[i]); - if (seen[x]){ - if (reason[x] == NULL){ - assert(level[x] > 0); - out_conflict.push(~trail[i]); - }else{ - Clause& c = *reason[x]; - for (int j = 1; j < c.size(); j++) - if (level[var(c[j])] > 0) - seen[var(c[j])] = 1; - } - seen[x] = 0; - } - } - - seen[var(p)] = 0; -} - - -void Solver::uncheckedEnqueue(Lit p, Clause* from) -{ - assert(value(p) == l_Undef); - assigns [var(p)] = toInt(lbool(!sign(p))); // <<== abstract but not uttermost effecient - level [var(p)] = decisionLevel(); - reason [var(p)] = from; - trail.push(p); -} - - -/*_________________________________________________________________________________________________ -| -| propagate : [void] -> [Clause*] -| -| Description: -| Propagates all enqueued facts. If a conflict arises, the conflicting clause is returned, -| otherwise NULL. -| -| Post-conditions: -| * the propagation queue is empty, even if there was a conflict. -|________________________________________________________________________________________________@*/ -Clause* Solver::propagate() -{ - Clause* confl = NULL; - int num_props = 0; - - while (qhead < trail.size()){ - Lit p = trail[qhead++]; // 'p' is enqueued fact to propagate. - vec& ws = watches[toInt(p)]; - Clause **i, **j, **end; - num_props++; - - for (i = j = (Clause**)ws, end = i + ws.size(); i != end;){ - Clause& c = **i++; - - // Make sure the false literal is data[1]: - Lit false_lit = ~p; - if (c[0] == false_lit) - c[0] = c[1], c[1] = false_lit; - - assert(c[1] == false_lit); - - // If 0th watch is true, then clause is already satisfied. - Lit first = c[0]; - if (value(first) == l_True){ - *j++ = &c; - }else{ - // Look for new watch: - for (int k = 2; k < c.size(); k++) - if (value(c[k]) != l_False){ - c[1] = c[k]; c[k] = false_lit; - watches[toInt(~c[1])].push(&c); - goto FoundWatch; } - - // Did not find watch -- clause is unit under assignment: - *j++ = &c; - if (value(first) == l_False){ - confl = &c; - qhead = trail.size(); - // Copy the remaining watches: - while (i < end) - *j++ = *i++; - }else - uncheckedEnqueue(first, &c); - } - FoundWatch:; - } - ws.shrink(i - j); - } - propagations += num_props; - simpDB_props -= num_props; - - return confl; -} - -/*_________________________________________________________________________________________________ -| -| reduceDB : () -> [void] -| -| Description: -| Remove half of the learnt clauses, minus the clauses locked by the current assignment. Locked -| clauses are clauses that are reason to some assignment. Binary clauses are never removed. -|________________________________________________________________________________________________@*/ -struct reduceDB_lt { bool operator () (Clause* x, Clause* y) { return x->size() > 2 && (y->size() == 2 || x->activity() < y->activity()); } }; -void Solver::reduceDB() -{ - int i, j; - double extra_lim = cla_inc / learnts.size(); // Remove any clause below this activity - - sort(learnts, reduceDB_lt()); - for (i = j = 0; i < learnts.size() / 2; i++){ - if (learnts[i]->size() > 2 && !locked(*learnts[i])) - removeClause(*learnts[i]); - else - learnts[j++] = learnts[i]; - } - for (; i < learnts.size(); i++){ - if (learnts[i]->size() > 2 && !locked(*learnts[i]) && learnts[i]->activity() < extra_lim) - removeClause(*learnts[i]); - else - learnts[j++] = learnts[i]; - } - learnts.shrink(i - j); -} - - -void Solver::removeSatisfied(vec& cs) -{ - int i,j; - for (i = j = 0; i < cs.size(); i++){ - if (satisfied(*cs[i])) - removeClause(*cs[i]); - else - cs[j++] = cs[i]; - } - cs.shrink(i - j); -} - - -/*_________________________________________________________________________________________________ -| -| simplify : [void] -> [bool] -| -| Description: -| Simplify the clause database according to the current top-level assigment. Currently, the only -| thing done here is the removal of satisfied clauses, but more things can be put here. -|________________________________________________________________________________________________@*/ -bool Solver::simplify() -{ - assert(decisionLevel() == 0); - - if (!ok || propagate() != NULL) - return ok = false; - - if (nAssigns() == simpDB_assigns || (simpDB_props > 0)) - return true; - - // Remove satisfied clauses: - removeSatisfied(learnts); - if (remove_satisfied) // Can be turned off. - removeSatisfied(clauses); - - // Remove fixed variables from the variable heap: - order_heap.filter(VarFilter(*this)); - - simpDB_assigns = nAssigns(); - simpDB_props = clauses_literals + learnts_literals; // (shouldn't depend on stats really, but it will do for now) - - return true; -} - - -/*_________________________________________________________________________________________________ -| -| search : (nof_conflicts : int) (nof_learnts : int) (params : const SearchParams&) -> [lbool] -| -| Description: -| Search for a model the specified number of conflicts, keeping the number of learnt clauses -| below the provided limit. NOTE! Use negative value for 'nof_conflicts' or 'nof_learnts' to -| indicate infinity. -| -| Output: -| 'l_True' if a partial assigment that is consistent with respect to the clauseset is found. If -| all variables are decision variables, this means that the clause set is satisfiable. 'l_False' -| if the clause set is unsatisfiable. 'l_Undef' if the bound on number of conflicts is reached. -|________________________________________________________________________________________________@*/ -lbool Solver::search(int nof_conflicts, int nof_learnts) -{ - assert(ok); - int backtrack_level; - int conflictC = 0; - vec learnt_clause; - - starts++; - - // bool first = true; - - for (;;){ - Clause* confl = propagate(); - if (confl != NULL){ - // CONFLICT - conflicts++; conflictC++; - if (decisionLevel() == 0) return l_False; - - // first = false; - - learnt_clause.clear(); - analyze(confl, learnt_clause, backtrack_level); - cancelUntil(backtrack_level); - assert(value(learnt_clause[0]) == l_Undef); - - if (learnt_clause.size() == 1){ - uncheckedEnqueue(learnt_clause[0]); - }else{ - Clause* c = Clause_new(learnt_clause, true); - learnts.push(c); - attachClause(*c); - claBumpActivity(*c); - uncheckedEnqueue(learnt_clause[0], c); - } - - varDecayActivity(); - claDecayActivity(); - - }else{ - // NO CONFLICT - - if (nof_conflicts >= 0 && conflictC >= nof_conflicts){ - // Reached bound on number of conflicts: - progress_estimate = progressEstimate(); - cancelUntil(0); - return l_Undef; } - - // Simplify the set of problem clauses: - if (decisionLevel() == 0 && !simplify()) - return l_False; - - if (nof_learnts >= 0 && learnts.size()-nAssigns() >= nof_learnts) - // Reduce the set of learnt clauses: - reduceDB(); - - Lit next = lit_Undef; - while (decisionLevel() < assumptions.size()){ - // Perform user provided assumption: - Lit p = assumptions[decisionLevel()]; - if (value(p) == l_True){ - // Dummy decision level: - newDecisionLevel(); - }else if (value(p) == l_False){ - analyzeFinal(~p, conflict); - return l_False; - }else{ - next = p; - break; - } - } - - - //************************** - if (next == lit_Undef){ - // New variable decision: - decisions++; - - if (!allMinVarsAssigned){ - for (int i=0; i& assumps) -{ - model.clear(); - conflict.clear(); - - allMinVarsAssigned = false; - - if (!ok) return false; - - assumps.copyTo(assumptions); - - double nof_conflicts = restart_first; - double nof_learnts = nClauses() * learntsize_factor; - lbool status = l_Undef; - - if (verbosity >= 1){ - reportf("============================[ Search Statistics ]==============================\n"); - reportf("| Conflicts | ORIGINAL | LEARNT | Progress |\n"); - reportf("| | Vars Clauses Literals | Limit Clauses Lit/Cl | |\n"); - reportf("===============================================================================\n"); - } - - // Search: - while (status == l_Undef){ - if (verbosity >= 1) - reportf("| %9d | %7d %8d %8d | %8d %8d %6.0f | %6.3f %% |\n", (int)conflicts, order_heap.size(), nClauses(), (int)clauses_literals, (int)nof_learnts, nLearnts(), (double)learnts_literals/nLearnts(), progress_estimate*100), fflush(stdout); - status = search((int)nof_conflicts, (int)nof_learnts); - nof_conflicts *= restart_inc; - nof_learnts *= learntsize_inc; - } - - if (verbosity >= 1) - reportf("===============================================================================\n"); - - - if (status == l_True){ - // Extend & copy model: - model.growTo(nVars()); - for (int i = 0; i < nVars(); i++) model[i] = value(i); -#ifndef NDEBUG - verifyModel(); -#endif - }else{ - assert(status == l_False); - if (conflict.size() == 0) - ok = false; - } - - cancelUntil(0); - return status == l_True; -} - - - - -void Solver::verifyModel() -{ - bool failed = false; - for (int i = 0; i < clauses.size(); i++){ - assert(clauses[i]->mark() == 0); - Clause& c = *clauses[i]; - for (int j = 0; j < c.size(); j++) - if (modelValue(c[j]) == l_True) - goto next; - - reportf("unsatisfied clause: "); - printClause(*clauses[i]); - reportf("\n"); - failed = true; - next:; - } - - assert(!failed); - - // reportf("Verified %d original clauses.\n", clauses.size()); -} - - -void Solver::checkLiteralCount() -{ - // Check that sizes are calculated correctly: - int cnt = 0; - for (int i = 0; i < clauses.size(); i++) - if (clauses[i]->mark() == 0) - cnt += clauses[i]->size(); - - if ((int)clauses_literals != cnt){ - fprintf(stderr, "literal count: %d, real value = %d\n", (int)clauses_literals, cnt); - assert((int)clauses_literals == cnt); - } -} diff --git a/packages/swi-minisat2/C/Solver.h b/packages/swi-minisat2/C/Solver.h deleted file mode 100644 index fc41a7e0b..000000000 --- a/packages/swi-minisat2/C/Solver.h +++ /dev/null @@ -1,311 +0,0 @@ -/****************************************************************************************[Solver.h] -MiniSat -- Copyright (c) 2003-2006, Niklas Een, Niklas Sorensson - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and -associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or -substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT -NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT -OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -**************************************************************************************************/ - -#ifndef Solver_h -#define Solver_h - -#include - -#include "Vec.h" -#include "Heap.h" -#include "Alg.h" - -#include "SolverTypes.h" - - -//================================================================================================= -// Solver -- the main class: - - -class Solver { -public: - - // Constructor/Destructor: - // - Solver(); - ~Solver(); - - // Problem specification: - // - Var newVar (bool polarity = true, bool dvar = true); // Add a new variable with parameters specifying variable mode. - bool addClause (vec& ps); // Add a clause to the solver. NOTE! 'ps' may be shrunk by this method! - bool setminVars(vec& ps); - - // Solving: - // - bool simplify (); // Removes already satisfied clauses. - bool solve (const vec& assumps); // Search for a model that respects a given set of assumptions. - bool solve (); // Search without assumptions. - bool okay () const; // FALSE means solver is in a conflicting state - - // Variable mode: - // - void setPolarity (Var v, bool b); // Declare which polarity the decision heuristic should use for a variable. Requires mode 'polarity_user'. - void setDecisionVar (Var v, bool b); // Declare if a variable should be eligible for selection in the decision heuristic. - - // Read state: - // - lbool value (Var x) const; // The current value of a variable. - lbool value (Lit p) const; // The current value of a literal. - lbool modelValue (Lit p) const; // The value of a literal in the last model. The last call to solve must have been satisfiable. - int nAssigns () const; // The current number of assigned literals. - int nClauses () const; // The current number of original clauses. - int nLearnts () const; // The current number of learnt clauses. - int nVars () const; // The current number of variables. - - // Extra results: (read-only member variable) - // - vec model; // If problem is satisfiable, this vector contains the model (if any). - vec conflict; // If problem is unsatisfiable (possibly under assumptions), - // this vector represent the final conflict clause expressed in the assumptions. - - // Mode of operation: - // - double var_decay; // Inverse of the variable activity decay factor. (default 1 / 0.95) - double clause_decay; // Inverse of the clause activity decay factor. (1 / 0.999) - double random_var_freq; // The frequency with which the decision heuristic tries to choose a random variable. (default 0.02) - int restart_first; // The initial restart limit. (default 100) - double restart_inc; // The factor with which the restart limit is multiplied in each restart. (default 1.5) - double learntsize_factor; // The intitial limit for learnt clauses is a factor of the original clauses. (default 1 / 3) - double learntsize_inc; // The limit for learnt clauses is multiplied with this factor each restart. (default 1.1) - bool expensive_ccmin; // Controls conflict clause minimization. (default TRUE) - int polarity_mode; // Controls which polarity the decision heuristic chooses. See enum below for allowed modes. (default polarity_false) - int verbosity; // Verbosity level. 0=silent, 1=some progress report (default 0) - - enum { polarity_true = 0, polarity_false = 1, polarity_user = 2, polarity_rnd = 3 }; - - // Statistics: (read-only member variable) - // - uint64_t starts, decisions, rnd_decisions, propagations, conflicts; - uint64_t clauses_literals, learnts_literals, max_literals, tot_literals; - -protected: - - // Helper structures: - // - struct VarOrderLt { - const vec& activity; - bool operator () (Var x, Var y) const { return activity[x] > activity[y]; } - VarOrderLt(const vec& act) : activity(act) { } - }; - - friend class VarFilter; - struct VarFilter { - const Solver& s; - VarFilter(const Solver& _s) : s(_s) {} - bool operator()(Var v) const { return toLbool(s.assigns[v]) == l_Undef && s.decision_var[v]; } - }; - - // Solver state: - // - - //**************** - bool allMinVarsAssigned; - int lastMinVarDL; - vec minVars; - //**************** - - - bool ok; // If FALSE, the constraints are already unsatisfiable. No part of the solver state may be used! - vec clauses; // List of problem clauses. - vec learnts; // List of learnt clauses. - double cla_inc; // Amount to bump next clause with. - vec activity; // A heuristic measurement of the activity of a variable. - double var_inc; // Amount to bump next variable with. - vec > watches; // 'watches[lit]' is a list of constraints watching 'lit' (will go there if literal becomes true). - vec assigns; // The current assignments (lbool:s stored as char:s). - vec polarity; // The preferred polarity of each variable. - vec decision_var; // Declares if a variable is eligible for selection in the decision heuristic. - vec trail; // Assignment stack; stores all assigments made in the order they were made. - vec trail_lim; // Separator indices for different decision levels in 'trail'. - vec reason; // 'reason[var]' is the clause that implied the variables current value, or 'NULL' if none. - vec level; // 'level[var]' contains the level at which the assignment was made. - int qhead; // Head of queue (as index into the trail -- no more explicit propagation queue in MiniSat). - int simpDB_assigns; // Number of top-level assignments since last execution of 'simplify()'. - int64_t simpDB_props; // Remaining number of propagations that must be made before next execution of 'simplify()'. - vec assumptions; // Current set of assumptions provided to solve by the user. - Heap order_heap; // A priority queue of variables ordered with respect to the variable activity. - double random_seed; // Used by the random variable selection. - double progress_estimate;// Set by 'search()'. - bool remove_satisfied; // Indicates whether possibly inefficient linear scan for satisfied clauses should be performed in 'simplify'. - - // Temporaries (to reduce allocation overhead). Each variable is prefixed by the method in which it is - // used, exept 'seen' wich is used in several places. - // - vec seen; - vec analyze_stack; - vec analyze_toclear; - vec add_tmp; - - // Main internal methods: - // - void insertVarOrder (Var x); // Insert a variable in the decision order priority queue. - Lit pickBranchLit (int polarity_mode, double random_var_freq); // Return the next decision variable. - void newDecisionLevel (); // Begins a new decision level. - void uncheckedEnqueue (Lit p, Clause* from = NULL); // Enqueue a literal. Assumes value of literal is undefined. - bool enqueue (Lit p, Clause* from = NULL); // Test if fact 'p' contradicts current state, enqueue otherwise. - Clause* propagate (); // Perform unit propagation. Returns possibly conflicting clause. - void cancelUntil (int level); // Backtrack until a certain level. - void analyze (Clause* confl, vec& out_learnt, int& out_btlevel); // (bt = backtrack) - void analyzeFinal (Lit p, vec& out_conflict); // COULD THIS BE IMPLEMENTED BY THE ORDINARIY "analyze" BY SOME REASONABLE GENERALIZATION? - bool litRedundant (Lit p, uint32_t abstract_levels); // (helper method for 'analyze()') - lbool search (int nof_conflicts, int nof_learnts); // Search for a given number of conflicts. - void reduceDB (); // Reduce the set of learnt clauses. - void removeSatisfied (vec& cs); // Shrink 'cs' to contain only non-satisfied clauses. - - // Maintaining Variable/Clause activity: - // - void varDecayActivity (); // Decay all variables with the specified factor. Implemented by increasing the 'bump' value instead. - void varBumpActivity (Var v); // Increase a variable with the current 'bump' value. - void claDecayActivity (); // Decay all clauses with the specified factor. Implemented by increasing the 'bump' value instead. - void claBumpActivity (Clause& c); // Increase a clause with the current 'bump' value. - - // Operations on clauses: - // - void attachClause (Clause& c); // Attach a clause to watcher lists. - void detachClause (Clause& c); // Detach a clause to watcher lists. - void removeClause (Clause& c); // Detach and free a clause. - bool locked (const Clause& c) const; // Returns TRUE if a clause is a reason for some implication in the current state. - bool satisfied (const Clause& c) const; // Returns TRUE if a clause is satisfied in the current state. - - // Misc: - // - int decisionLevel () const; // Gives the current decisionlevel. - uint32_t abstractLevel (Var x) const; // Used to represent an abstraction of sets of decision levels. - double progressEstimate () const; // DELETE THIS ?? IT'S NOT VERY USEFUL ... - - // Debug: - void printLit (Lit l); - template - void printClause (const C& c); - void verifyModel (); - void checkLiteralCount(); - - // Static helpers: - // - - // Returns a random float 0 <= x < 1. Seed must never be 0. - static inline double drand(double& seed) { - seed *= 1389796; - int q = (int)(seed / 2147483647); - seed -= (double)q * 2147483647; - return seed / 2147483647; } - - // Returns a random integer 0 <= x < size. Seed must never be 0. - static inline int irand(double& seed, int size) { - return (int)(drand(seed) * size); } -}; - - -//================================================================================================= -// Implementation of inline methods: - - -inline void Solver::insertVarOrder(Var x) { - if (!order_heap.inHeap(x) && decision_var[x]) order_heap.insert(x); } - -inline void Solver::varDecayActivity() { var_inc *= var_decay; } -inline void Solver::varBumpActivity(Var v) { - if ( (activity[v] += var_inc) > 1e100 ) { - // Rescale: - for (int i = 0; i < nVars(); i++) - activity[i] *= 1e-100; - var_inc *= 1e-100; } - - // Update order_heap with respect to new activity: - if (order_heap.inHeap(v)) - order_heap.decrease(v); } - -inline void Solver::claDecayActivity() { cla_inc *= clause_decay; } -inline void Solver::claBumpActivity (Clause& c) { - if ( (c.activity() += cla_inc) > 1e20 ) { - // Rescale: - for (int i = 0; i < learnts.size(); i++) - learnts[i]->activity() *= 1e-20; - cla_inc *= 1e-20; } } - -inline bool Solver::enqueue (Lit p, Clause* from) { return value(p) != l_Undef ? value(p) != l_False : (uncheckedEnqueue(p, from), true); } -inline bool Solver::locked (const Clause& c) const { return reason[var(c[0])] == &c && value(c[0]) == l_True; } -inline void Solver::newDecisionLevel() { trail_lim.push(trail.size()); } - -inline int Solver::decisionLevel () const { return trail_lim.size(); } -inline uint32_t Solver::abstractLevel (Var x) const { return 1 << (level[x] & 31); } -inline lbool Solver::value (Var x) const { return toLbool(assigns[x]); } -inline lbool Solver::value (Lit p) const { return toLbool(assigns[var(p)]) ^ sign(p); } -inline lbool Solver::modelValue (Lit p) const { return model[var(p)] ^ sign(p); } -inline int Solver::nAssigns () const { return trail.size(); } -inline int Solver::nClauses () const { return clauses.size(); } -inline int Solver::nLearnts () const { return learnts.size(); } -inline int Solver::nVars () const { return assigns.size(); } -inline void Solver::setPolarity (Var v, bool b) { polarity [v] = (char)b; } -inline void Solver::setDecisionVar(Var v, bool b) { decision_var[v] = (char)b; if (b) { insertVarOrder(v); } } -inline bool Solver::solve () { vec tmp; return solve(tmp); } -inline bool Solver::okay () const { return ok; } - - - -//================================================================================================= -// Debug + etc: - - -#define reportf(...) ( fflush(stdout), fprintf(stderr, __VA_ARGS__), fflush(stderr) ) - -static inline void logLit(FILE* f, Lit l) -{ - fprintf(f, "%sx%d", sign(l) ? "~" : "", var(l)+1); -} - -static inline void logLits(FILE* f, const vec& ls) -{ - fprintf(f, "[ "); - if (ls.size() > 0){ - logLit(f, ls[0]); - for (int i = 1; i < ls.size(); i++){ - fprintf(f, ", "); - logLit(f, ls[i]); - } - } - fprintf(f, "] "); -} - -static inline const char* showBool(bool b) { return b ? "true" : "false"; } - - -// Just like 'assert()' but expression will be evaluated in the release version as well. -static inline void check(bool expr) { assert(expr); } - - -inline void Solver::printLit(Lit l) -{ - reportf("%s%d:%c", sign(l) ? "-" : "", var(l)+1, value(l) == l_True ? '1' : (value(l) == l_False ? '0' : 'X')); -} - - -template -inline void Solver::printClause(const C& c) -{ - for (int i = 0; i < c.size(); i++){ - printLit(c[i]); - fprintf(stderr, " "); - } -} - - -//================================================================================================= -#endif diff --git a/packages/swi-minisat2/C/SolverTypes.h b/packages/swi-minisat2/C/SolverTypes.h deleted file mode 100644 index 567e57f1d..000000000 --- a/packages/swi-minisat2/C/SolverTypes.h +++ /dev/null @@ -1,199 +0,0 @@ -/***********************************************************************************[SolverTypes.h] -MiniSat -- Copyright (c) 2003-2006, Niklas Een, Niklas Sorensson - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and -associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or -substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT -NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT -OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -**************************************************************************************************/ - - -#ifndef SolverTypes_h -#define SolverTypes_h - -#include -#include - -//================================================================================================= -// Variables, literals, lifted booleans, clauses: - - -// NOTE! Variables are just integers. No abstraction here. They should be chosen from 0..N, -// so that they can be used as array indices. - -typedef int Var; -#define var_Undef (-1) - - -class Lit { - int x; - public: - Lit() : x(2*var_Undef) { } // (lit_Undef) - explicit Lit(Var var, bool sign = false) : x((var+var) + (int)sign) { } - - // Don't use these for constructing/deconstructing literals. Use the normal constructors instead. - friend int toInt (Lit p); // Guarantees small, positive integers suitable for array indexing. - friend Lit toLit (int i); // Inverse of 'toInt()' - friend Lit operator ~(Lit p); - friend bool sign (Lit p); - friend int var (Lit p); - friend Lit unsign (Lit p); - friend Lit id (Lit p, bool sgn); - - bool operator == (Lit p) const { return x == p.x; } - bool operator != (Lit p) const { return x != p.x; } - bool operator < (Lit p) const { return x < p.x; } // '<' guarantees that p, ~p are adjacent in the ordering. -}; - -inline int toInt (Lit p) { return p.x; } -inline Lit toLit (int i) { Lit p; p.x = i; return p; } -inline Lit operator ~(Lit p) { Lit q; q.x = p.x ^ 1; return q; } -inline bool sign (Lit p) { return p.x & 1; } -inline int var (Lit p) { return p.x >> 1; } -inline Lit unsign (Lit p) { Lit q; q.x = p.x & ~1; return q; } -inline Lit id (Lit p, bool sgn) { Lit q; q.x = p.x ^ (int)sgn; return q; } - -const Lit lit_Undef(var_Undef, false); // }- Useful special constants. -const Lit lit_Error(var_Undef, true ); // } - - -//================================================================================================= -// Lifted booleans: - - -class lbool { - char value; - explicit lbool(int v) : value(v) { } - -public: - lbool() : value(0) { } - lbool(bool x) : value((int)x*2-1) { } - int toInt(void) const { return value; } - - bool operator == (lbool b) const { return value == b.value; } - bool operator != (lbool b) const { return value != b.value; } - lbool operator ^ (bool b) const { return b ? lbool(-value) : lbool(value); } - - friend int toInt (lbool l); - friend lbool toLbool(int v); -}; -inline int toInt (lbool l) { return l.toInt(); } -inline lbool toLbool(int v) { return lbool(v); } - -const lbool l_True = toLbool( 1); -const lbool l_False = toLbool(-1); -const lbool l_Undef = toLbool( 0); - -//================================================================================================= -// Clause -- a simple class for representing a clause: - - -class Clause { - uint32_t size_etc; - union { float act; uint32_t abst; } extra; - Lit data[0]; - -public: - void calcAbstraction() { - uint32_t abstraction = 0; - for (int i = 0; i < size(); i++) - abstraction |= 1 << (var(data[i]) & 31); - extra.abst = abstraction; } - - // NOTE: This constructor cannot be used directly (doesn't allocate enough memory). - template - Clause(const V& ps, bool learnt) { - size_etc = (ps.size() << 3) | (uint32_t)learnt; - for (int i = 0; i < ps.size(); i++) data[i] = ps[i]; - if (learnt) extra.act = 0; else calcAbstraction(); } - - // -- use this function instead: - template - friend Clause* Clause_new(const V& ps, bool learnt); - - int size () const { return size_etc >> 3; } - void shrink (int i) { assert(i <= size()); size_etc = (((size_etc >> 3) - i) << 3) | (size_etc & 7); } - void pop () { shrink(1); } - bool learnt () const { return size_etc & 1; } - uint32_t mark () const { return (size_etc >> 1) & 3; } - void mark (uint32_t m) { size_etc = (size_etc & ~6) | ((m & 3) << 1); } - const Lit& last () const { return data[size()-1]; } - - // NOTE: somewhat unsafe to change the clause in-place! Must manually call 'calcAbstraction' afterwards for - // subsumption operations to behave correctly. - Lit& operator [] (int i) { return data[i]; } - Lit operator [] (int i) const { return data[i]; } - operator const Lit* (void) const { return data; } - - float& activity () { return extra.act; } - uint32_t abstraction () const { return extra.abst; } - - Lit subsumes (const Clause& other) const; - void strengthen (Lit p); -}; - - -template -Clause* Clause_new(const V& ps, bool learnt) { - assert(sizeof(Lit) == sizeof(uint32_t)); - assert(sizeof(float) == sizeof(uint32_t)); - void* mem = std::malloc(sizeof(Clause) + sizeof(uint32_t)*(ps.size())); - return new (mem) Clause(ps, learnt); } -/*_________________________________________________________________________________________________ -| -| subsumes : (other : const Clause&) -> Lit -| -| Description: -| Checks if clause subsumes 'other', and at the same time, if it can be used to simplify 'other' -| by subsumption resolution. -| -| Result: -| lit_Error - No subsumption or simplification -| lit_Undef - Clause subsumes 'other' -| p - The literal p can be deleted from 'other' -|________________________________________________________________________________________________@*/ -inline Lit Clause::subsumes(const Clause& other) const -{ - if (other.size() < size() || (extra.abst & ~other.extra.abst) != 0) - return lit_Error; - - Lit ret = lit_Undef; - const Lit* c = (const Lit*)(*this); - const Lit* d = (const Lit*)other; - - for (int i = 0; i < size(); i++) { - // search for c[i] or ~c[i] - for (int j = 0; j < other.size(); j++) - if (c[i] == d[j]) - goto ok; - else if (ret == lit_Undef && c[i] == ~d[j]){ - ret = c[i]; - goto ok; - } - - // did not find it - return lit_Error; - ok:; - } - - return ret; -} - - -inline void Clause::strengthen(Lit p) -{ - remove(*this, p); - calcAbstraction(); -} - -#endif diff --git a/packages/swi-minisat2/C/Sort.h b/packages/swi-minisat2/C/Sort.h deleted file mode 100644 index 1f301f5c2..000000000 --- a/packages/swi-minisat2/C/Sort.h +++ /dev/null @@ -1,93 +0,0 @@ -/******************************************************************************************[Sort.h] -MiniSat -- Copyright (c) 2003-2006, Niklas Een, Niklas Sorensson - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and -associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or -substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT -NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT -OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -**************************************************************************************************/ - -#ifndef Sort_h -#define Sort_h - -#include "Vec.h" - -//================================================================================================= -// Some sorting algorithms for vec's - - -template -struct LessThan_default { - bool operator () (T x, T y) { return x < y; } -}; - - -template -void selectionSort(T* array, int size, LessThan lt) -{ - int i, j, best_i; - T tmp; - - for (i = 0; i < size-1; i++){ - best_i = i; - for (j = i+1; j < size; j++){ - if (lt(array[j], array[best_i])) - best_i = j; - } - tmp = array[i]; array[i] = array[best_i]; array[best_i] = tmp; - } -} -template static inline void selectionSort(T* array, int size) { - selectionSort(array, size, LessThan_default()); } - -template -void sort(T* array, int size, LessThan lt) -{ - if (size <= 15) - selectionSort(array, size, lt); - - else{ - T pivot = array[size / 2]; - T tmp; - int i = -1; - int j = size; - - for(;;){ - do i++; while(lt(array[i], pivot)); - do j--; while(lt(pivot, array[j])); - - if (i >= j) break; - - tmp = array[i]; array[i] = array[j]; array[j] = tmp; - } - - sort(array , i , lt); - sort(&array[i], size-i, lt); - } -} -template static inline void sort(T* array, int size) { - sort(array, size, LessThan_default()); } - - -//================================================================================================= -// For 'vec's: - - -template void sort(vec& v, LessThan lt) { - sort((T*)v, v.size(), lt); } -template void sort(vec& v) { - sort(v, LessThan_default()); } - - -//================================================================================================= -#endif diff --git a/packages/swi-minisat2/C/Vec.h b/packages/swi-minisat2/C/Vec.h deleted file mode 100644 index 14e00adbc..000000000 --- a/packages/swi-minisat2/C/Vec.h +++ /dev/null @@ -1,133 +0,0 @@ -/*******************************************************************************************[Vec.h] -MiniSat -- Copyright (c) 2003-2006, Niklas Een, Niklas Sorensson - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and -associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or -substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT -NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT -OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -**************************************************************************************************/ - -#ifndef Vec_h -#define Vec_h - -#include -#include -#include - -//================================================================================================= -// Automatically resizable arrays -// -// NOTE! Don't use this vector on datatypes that cannot be re-located in memory (with std::realloc) - -template -class vec { - T* data; - int sz; - int cap; - - void init(int size, const T& pad); - void grow(int min_cap); - - // Don't allow copying (error prone): - vec& operator = (vec& other) { assert(0); return *this; } - vec (vec& other) { assert(0); } - - static inline int imin(int x, int y) { - int mask = (x-y) >> (sizeof(int)*8-1); - return (x&mask) + (y&(~mask)); } - - static inline int imax(int x, int y) { - int mask = (y-x) >> (sizeof(int)*8-1); - return (x&mask) + (y&(~mask)); } - -public: - // Types: - typedef int Key; - typedef T Datum; - - // Constructors: - vec(void) : data(NULL) , sz(0) , cap(0) { } - vec(int size) : data(NULL) , sz(0) , cap(0) { growTo(size); } - vec(int size, const T& pad) : data(NULL) , sz(0) , cap(0) { growTo(size, pad); } - vec(T* array, int size) : data(array), sz(size), cap(size) { } // (takes ownership of array -- will be deallocated with 'free()') - ~vec(void) { clear(true); } - - // Ownership of underlying array: - T* release (void) { T* ret = data; data = NULL; sz = 0; cap = 0; return ret; } - operator T* (void) { return data; } // (unsafe but convenient) - operator const T* (void) const { return data; } - - // Size operations: - int size (void) const { return sz; } - void shrink (int nelems) { assert(nelems <= sz); for (int i = 0; i < nelems; i++) sz--, data[sz].~T(); } - void shrink_(int nelems) { assert(nelems <= sz); sz -= nelems; } - void pop (void) { sz--, data[sz].~T(); } - void growTo (int size); - void growTo (int size, const T& pad); - void clear (bool dealloc = false); - void capacity (int size) { grow(size); } - - // Stack interface: -#if 1 - void push (void) { if (sz == cap) { cap = imax(2, (cap*3+1)>>1); data = (T*)std::realloc(data, cap * sizeof(T)); } new (&data[sz]) T(); sz++; } - //void push (const T& elem) { if (sz == cap) { cap = imax(2, (cap*3+1)>>1); data = (T*)std::realloc(data, cap * sizeof(T)); } new (&data[sz]) T(elem); sz++; } - void push (const T& elem) { if (sz == cap) { cap = imax(2, (cap*3+1)>>1); data = (T*)std::realloc(data, cap * sizeof(T)); } data[sz++] = elem; } - void push_ (const T& elem) { assert(sz < cap); data[sz++] = elem; } -#else - void push (void) { if (sz == cap) grow(sz+1); new (&data[sz]) T() ; sz++; } - void push (const T& elem) { if (sz == cap) grow(sz+1); new (&data[sz]) T(elem); sz++; } -#endif - - const T& last (void) const { return data[sz-1]; } - T& last (void) { return data[sz-1]; } - - // Vector interface: - const T& operator [] (int index) const { return data[index]; } - T& operator [] (int index) { return data[index]; } - - - // Duplicatation (preferred instead): - void copyTo(vec& copy) const { copy.clear(); copy.growTo(sz); for (int i = 0; i < sz; i++) new (©[i]) T(data[i]); } - void moveTo(vec& dest) { dest.clear(true); dest.data = data; dest.sz = sz; dest.cap = cap; data = NULL; sz = 0; cap = 0; } -}; - -template -void vec::grow(int min_cap) { - if (min_cap <= cap) return; - if (cap == 0) cap = (min_cap >= 2) ? min_cap : 2; - else do cap = (cap*3+1) >> 1; while (cap < min_cap); - data = (T*)std::realloc(data, cap * sizeof(T)); } - -template -void vec::growTo(int size, const T& pad) { - if (sz >= size) return; - grow(size); - for (int i = sz; i < size; i++) new (&data[i]) T(pad); - sz = size; } - -template -void vec::growTo(int size) { - if (sz >= size) return; - grow(size); - for (int i = sz; i < size; i++) new (&data[i]) T(); - sz = size; } - -template -void vec::clear(bool dealloc) { - if (data != NULL){ - for (int i = 0; i < sz; i++) data[i].~T(); - sz = 0; - if (dealloc) std::free(data), data = NULL, cap = 0; } } - - -#endif diff --git a/packages/swi-minisat2/C/pl-minisat.C b/packages/swi-minisat2/C/pl-minisat.C deleted file mode 100644 index dca924705..000000000 --- a/packages/swi-minisat2/C/pl-minisat.C +++ /dev/null @@ -1,175 +0,0 @@ -//#include -#include -#include -#include - -#include "Solver.h" - -#define val(i) ((s->model[i] != l_Undef) ? ((s->model[i]==l_True)? i+1:-1*(i+1)):0) - -Solver *s = NULL; - - -extern "C" foreign_t minisat_new_solver() -{ - s = new Solver; - PL_succeed; -} - - -extern "C" foreign_t minisat_delete_solver() -{ - if (s) { - delete s; - s = NULL; - } - PL_succeed; -} - -static inline Lit pl2lit(term_t pl_literal) -{ - int pl_lit_int, var; - PL_get_integer(pl_literal,&pl_lit_int); - var = abs(pl_lit_int)-1; - while (var >= s->nVars()) s->newVar(); - return (pl_lit_int > 0) ? Lit(var) : ~Lit(var); -} - - -extern "C" foreign_t minisat_set_minvars(term_t l) -{ - term_t head = PL_new_term_ref(); /* variable for the elements */ - term_t list = PL_copy_term_ref(l); /* copy as we need to write */ - - vec lits; - - while( PL_get_list(list, head, list) ) { - lits.push( pl2lit(head) ); - } - - assert(PL_get_nil(list)); - - if (s->setminVars(lits)) PL_succeed; else PL_fail; -} - -extern "C" foreign_t minisat_add_clause(term_t l) -{ - term_t head = PL_new_term_ref(); /* variable for the elements */ - term_t list = PL_copy_term_ref(l); /* copy as we need to write */ - - vec lits; - - while( PL_get_list(list, head, list) ) { - lits.push( pl2lit(head) ); - } - - assert(PL_get_nil(list)); - - if (s->addClause(lits)) PL_succeed; else PL_fail; -} - - -extern "C" foreign_t minisat_solve(term_t assum) { - - term_t head = PL_new_term_ref(); /* variable for the elements */ - term_t list = PL_copy_term_ref(assum); /* copy as we need to write */ - - vec assumptions; - - while( PL_get_list(list, head, list) ) { - assumptions.push( pl2lit(head) ); - } - - if (s->solve(assumptions)) PL_succeed; else PL_fail; -} - - -extern "C" foreign_t minisat_get_var_assignment(term_t var, term_t res) -{ - int i; - - PL_get_integer(var,&i); - i--; - - if (i < s->nVars()) { - term_t a = PL_new_term_ref(); /* variable for the elements */ - PL_put_integer(a, val(i)); - return PL_unify(a,res); - } else { - PL_fail; - } -} - -extern "C" foreign_t minisat_nvars(term_t res) -{ - term_t a = PL_new_term_ref(); /* variable for the elements */ - PL_put_integer(a, s->nVars()); - return PL_unify(a,res); -} - - - - - - - - -//============================================================================= -static const PL_extension predicates[] = - { - // - // { "name", arity, function, PL_FA_ }, - // - - { "minisat_new_solver", 0, (void*)minisat_new_solver, 0 }, - { "minisat_delete_solver", 0, (void*)minisat_delete_solver, 0 }, - { "minisat_add_clause", 1, (void*)minisat_add_clause, 0 }, - { "minisat_solve", 1, (void*)minisat_solve, 0 }, - { "minisat_get_var_assignment", 2, (void*)minisat_get_var_assignment, 0 }, - { "minisat_nvars", 1, (void*)minisat_nvars, 0 }, - { NULL, 0, NULL, 0 } // terminating line - }; - -//----------------------------------------------------------------------------- -extern "C" install_t install() -{ - //Sdprintf("%% SWI-Prolog interface to MiniSat"); - //Sdprintf(" - built on "); - //Sdprintf(__DATE__); - //Sdprintf(", "); - //Sdprintf(__TIME__); - //Sdprintf(" ... "); - PL_register_extensions(predicates); /* This is the only PL_ call allowed */ - /* before PL_initialise(). It */ - /* ensures the foreign predicates */ - /* are available before loading */ - /* Prolog code */ - - //Sdprintf("OK\n"); -} - -//----------------------------------------------------------------------------- -// This part is for compiling into a standalone executable - -#ifdef READLINE -static void install_readline(int argc, char**argv) -{ - PL_install_readline(); -} -#endif - -int main(int argc, char **argv) -{ - -#ifdef READLINE - PL_initialise_hook(install_readline); -#endif - - install(); - if ( !PL_initialise(argc, argv) ) - PL_halt(1); - - PL_halt(PL_toplevel() ? 0 : 1); - - return 0; -} diff --git a/packages/swi-minisat2/CMakeLists.txt b/packages/swi-minisat2/CMakeLists.txt deleted file mode 100644 index b39ad2491..000000000 --- a/packages/swi-minisat2/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ - -set (PROGRAMS - cnf.pl - minisat.pl - ) - -set (EXAMPLE_PROGRAMS - examples/adder.pl - examples/pearl_examples.pl - ) - -install(FILES - ${PROGRAMS} - DESTINATION ${YAP_INSTALL_DATADIR} - ) - -add_subDIRECTORY (C) - diff --git a/packages/swi-minisat2/Makefile.in b/packages/swi-minisat2/Makefile.in deleted file mode 100644 index 1131ac9b2..000000000 --- a/packages/swi-minisat2/Makefile.in +++ /dev/null @@ -1,51 +0,0 @@ -# -# default base directory for YAP installation -# -# -ROOTDIR = @prefix@ -# -# where the binary should be -# -BINDIR = $(ROOTDIR)/bin -# -# where YAP should look for binary libraries -# -LIBDIR=@libdir@ -YAPLIBDIR=@libdir@/Yap -# -# where YAP should look for architecture-independent Prolog libraries -# -SHAREDIR=$(ROOTDIR)/share -# -# -# You shouldn't need to change what follows. -# -INSTALL=@INSTALL@ -INSTALL_DATA=@INSTALL_DATA@ -INSTALL_PROGRAM=@INSTALL_PROGRAM@ -srcdir=@srcdir@ -YAP_EXTRAS=@YAP_EXTRAS@ - -PROGRAMS= \ - $(srcdir)/cnf.pl \ - $(srcdir)/minisat.pl - -EXAMPLE_PROGRAMS= \ - $(srcdir)/examples/adder.pl \ - $(srcdir)/examples/pearl_examples.pl - -all: - -install: $(PROGRAMS) install-examples - mkdir -p $(DESTDIR)$(SHAREDIR)/Yap - mkdir -p $(DESTDIR)$(SHAREDIR)/doc/Yap/packages/examples/minisat - for p in $(PROGRAMS); do $(INSTALL_DATA) $$p $(DESTDIR)$(SHAREDIR)/Yap; done - for p in $(EXAMPLE_PROGRAMS); do $(INSTALL_DATA) $$p $(DESTDIR)$(SHAREDIR)/doc/Yap/packages/examples/minisat; done - -install-examples: - -clean: - -distclean: - rm Makefile - diff --git a/packages/swi-minisat2/README b/packages/swi-minisat2/README deleted file mode 100644 index 110f81236..000000000 --- a/packages/swi-minisat2/README +++ /dev/null @@ -1,8 +0,0 @@ -You need to put the file swi-minisat2.tgz in a directory where you want -the solver and the interface and then do: - -% tar zxvf swi-minisat2.tgz -% ./configure.sh -% make -% make clean - diff --git a/packages/swi-minisat2/README.YAP b/packages/swi-minisat2/README.YAP deleted file mode 100644 index 27a2d12c6..000000000 --- a/packages/swi-minisat2/README.YAP +++ /dev/null @@ -1,13 +0,0 @@ -This is the minisat package as described in - -Michael Codish, Vitaly Lagoon, Peter J. Stuckey: Logic programming -with satisfiability. TPLP 8(1): 121-128 (2008) - -We thank the authors for kindly allowing us to use this package in YAP. - -Please check the examples in $install/share/Yap/minisat/examples and -the TPLP paper to understand how the system can be used. - -Last, please contact yap-users AT sf.net for any bugs first, as they -may have been caused by the YAP port. - diff --git a/packages/swi-minisat2/cnf.pl b/packages/swi-minisat2/cnf.pl deleted file mode 100644 index b2e10e78e..000000000 --- a/packages/swi-minisat2/cnf.pl +++ /dev/null @@ -1,100 +0,0 @@ -%%============================================================================ -%% CNF.pl -%% Convertor of Boolean formulae to CNF -%% Copyright (c) 2006, Michael Codish, Vitaly Lagoon, and Peter J. Stuckey -%% -%% Permission is hereby granted, free of charge, to any person obtaining a -%% copy of this software and associated documentation files (the -%% "Software"), to deal in the Software without restriction, including -%% without limitation the rights to use, copy, modify, merge, publish, -%% distribute, sublicense, and/or sell copies of the Software, and to -%% permit persons to whom the Software is furnished to do so, subject to -%% the following conditions: -%% -%% The above copyright notice and this permission notice shall be included -%% in all copies or substantial portions of the Software. -%% -%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -%% OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -%% MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -%% NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -%% LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -%% OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -%% WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -:- module(cnf,[cnf/2,cnf_dl/2]). - -cnf(F,Cnf) :- cnf_dl(F,Cnf-[]). - -cnf_dl(F,[[B]|Cnf1]-Cnf2) :- iff(F,+,B,Cnf2,Cnf1). - - -iff(V,_,B,Acc,Cnf) :- var(V), !, V=B, Cnf=Acc. -iff(1,_,B,Acc,Cnf) :- !, B=1, Cnf=Acc. -iff(0,_,B,Acc,Cnf) :- !, B=0, Cnf=Acc. - -iff(-X,+,B,Acc,Cnf) :- !, iff(X,-,BX,Acc,Cnf), neglit(BX,B). -iff(-X,-,B,Acc,Cnf) :- !, iff(X,+,BX,Acc,Cnf), neglit(BX,B). -iff(-X,*,B,Acc,Cnf) :- !, iff(X,*,BX,Acc,Cnf), neglit(BX,B). - -iff((X+Y),Polarity,B,Acc,Cnf) :- !, - iff(X,Polarity,BX,Acc,AccX), - iff(Y,Polarity,BY,AccX,AccXY), - ( - Polarity == + -> Cnf = [[-B,BX,BY]|AccXY] - ; - Polarity == - -> Cnf = [[B,-BX],[B,-BY]|AccXY] - ; - Cnf = [[-B,BX,BY], [B,-BX], [B,-BY] | AccXY] - ). - -iff((X*Y),Polarity,B,Acc,Cnf) :- !, - iff(X,Polarity,BX,Acc,AccX), - iff(Y,Polarity,BY,AccX,AccXY), - ( - Polarity == + -> Cnf = [[-B,BX],[-B,BY]|AccXY] - ; - Polarity == - -> Cnf = [[B,-BX,-BY]|AccXY] - ; - Cnf = [[B,-BX,-BY], [-B,BX], [-B,BY] | AccXY] - ). - -iff((X==Y),Polarity,B,Acc,Cnf) :- !, - iff(X,*,BX,Acc,AccX), - iff(Y,*,BY,AccX,AccXY), - ( - Polarity == + -> Cnf = [[-BX,BY,-B],[BX,-BY,-B] | AccXY] - ; - Polarity == - -> Cnf = [[-BX,-BY,B],[BX,BY,B] | AccXY] - ; - Cnf = [[-BX,BY,-B],[BX,-BY,-B],[-BX,-BY,B],[BX,BY,B] | AccXY] - ). - -iff((xor(X, Y)),Polarity,B,Acc,Cnf) :- !, - iff(X,*,BX,Acc,AccX), - iff(Y,*,BY,AccX,AccXY), - ( - Polarity == + -> Cnf = [[-BX,-BY,-B],[BX,BY,-B] | AccXY] - ; - Polarity == - -> Cnf = [[-BX,BY,B],[BX,-BY,B] | AccXY] - ; - Cnf = [[-BX,BY,B],[BX,-BY,B],[-BX,-BY,-B],[BX,BY,-B] | AccXY] - ). - -iff((X->Y;Z),Polarity,B,Acc,Cnf) :- !, - iff(X,*,BX,Acc,AccX), - iff(Y,Polarity,BY,AccX,AccXY), - iff(Z,Polarity,BZ,AccXY,AccXYZ), - ( - Polarity == + -> Cnf = [[-BX,BY,-B],[BX,BZ,-B],[BY,BZ,-B]|AccXYZ] - ; - Polarity == - -> Cnf = [[-BX,-BY,B],[BX,-BZ,B],[-BY,-BZ,B]|AccXYZ] - ; - Cnf = [[-BX,BY,-B], [BX,BZ,-B], [BY,BZ,-B], - [-BX,-BY,B], [BX,-BZ,B], [-BY,-BZ,B] | AccXYZ] - ). - -neglit(V,-V) :- var(V), !. -neglit(-V,V). -neglit(0,1). -neglit(1,0). diff --git a/packages/swi-minisat2/examples/adder.pl b/packages/swi-minisat2/examples/adder.pl deleted file mode 100644 index 058e02dce..000000000 --- a/packages/swi-minisat2/examples/adder.pl +++ /dev/null @@ -1,23 +0,0 @@ -:- module(adder,[sum/3]). - -sum([B],[S],(S==B)). -sum([B1,B2|Bs],Sum,F1*F2*F3) :- - split([B1,B2|Bs],Xs,Ys), - sum(Xs,S1,F1), sum(Ys,S2,F2),add(S1,S2,Sum,F3). - -split([],[],[]). -split([X],[X],[0]). -split([X,Y|XYs],[X|Xs],[Y|Ys]) :- split(XYs,Xs,Ys). - -add([X|Xs],[Y|Ys],[Z|Zs],(Z==SumXY)*Sum) :- - halfadder(X,Y,SumXY,CarryXY), - adder(Xs,Ys,CarryXY,Zs,Sum). - -adder([],[],Carry,[Z],Z==Carry). -adder([X|Xs],[Y|Ys],Carry,[Z|Zs],(Z==SumXY)*Rest) :- - fulladder(X,Y,Carry,SumXY,CarryXY), - adder(Xs,Ys,CarryXY,Zs,Rest). - -fulladder(X, Y, C, (X xor Y xor C), (C->(X+Y);(X*Y)) ). -halfadder(X, Y, (X xor Y), X*Y ). - diff --git a/packages/swi-minisat2/examples/pearl_examples.pl b/packages/swi-minisat2/examples/pearl_examples.pl deleted file mode 100644 index 0655e7876..000000000 --- a/packages/swi-minisat2/examples/pearl_examples.pl +++ /dev/null @@ -1,54 +0,0 @@ - -:- use_module(library(cnf)). -:- use_module(library(minisat)). -:- use_module(adder). - -%% Example, pg3 -%% -%% ?- cnf(X==Y,Cnf). -%% Cnf = [[T], [-X, Y, -T], [X, -Y, -T]] -%% ?- cnf((X*Y)+(-X*Z),Cnf). -%% Cnf = [[T], [-T, T1, T2], [-T2, -X], -%% [-T2, Z], [-T1, X], [-T1, Y]] - - -%% Example, pg4 -%% -%% ?- sum([X+Y,X*Y,X==Y,X xor Y],[S1,S2,S3],Psi). -%% Psi = (T1==X+Y)*(T2==(X==Y))*(T3==T1 xor T2)*(T4==T1*T2)*(T5==X*Y)* -%% (T6==X xor Y)*(T7==T5 xor T6)* (T8==T5*T6)*(S1==T3 xor T7)* -%% (S2==T4 xor T8 xor (T3*T7))* (S3==(T3*T7->T4+T8;T4*T8)) - - -%% Examples, pg6 -%% -%% ?- cnf(X==Y,Cnf), solve(Cnf). -%% X=0, Y=0 -%% -%% ?- cnf(X==Y,Cnf), sat(Cnf). -%% Yes -%% -%% ?- sum([X+Y,X*Y,X==Y,X xor Y],Sum,F), cnf(F,Cnf), solve(Cnf). -%% X = 0, Y = 0 -%% Sum = [1, 0, 0] -%% -%% ?- sum([X+Y,X*Y,X==Y,X xor Y],[0,1,0],F), cnf(F,Cnf), solve(Cnf). -%% X = 0, Y = 1 -%% -%% ?- sum([X+Y,X*Y,X==Y,X xor Y],Sum,F), cnf(F,Cnf), -%% maximize(Sum,Cnf), solve(Cnf). -%% Sum=[1,1,0] -%% X=1, Y=1 - - -%% Figure 3, pg 6 -%% -%% partialMaxSat(+,+). -partialMaxSat(Phi,Psi) :- - sum(Psi,Max,SumPsi), cnf(Phi*SumPsi,Cnf), - maximize(Max,Cnf), solve(Cnf). - -%% Example, pg 7 -%% -%% ?- partialMaxSat(X+Y,[X*Y,X==Y,X xor Y,-X+Y, -X, -Y, X]). -%% X = 1, Y = 1 diff --git a/packages/swi-minisat2/minisat.pl b/packages/swi-minisat2/minisat.pl deleted file mode 100644 index 386f70c22..000000000 --- a/packages/swi-minisat2/minisat.pl +++ /dev/null @@ -1,361 +0,0 @@ -%%============================================================================ -%% The SWI-Prolog interface to MiniSat SAT solver -%% http://www.cs.chalmers.se/Cs/Research/FormalMethods/MiniSat/MiniSat.html -%% -%% Copyright (c) 2006, Michael Codish, Vitaly Lagoon, and Peter J. Stuckey -%% -%% Permission is hereby granted, free of charge, to any person obtaining a -%% copy of this software and associated documentation files (the -%% "Software"), to deal in the Software without restriction, including -%% without limitation the rights to use, copy, modify, merge, publish, -%% distribute, sublicense, and/or sell copies of the Software, and to -%% permit persons to whom the Software is furnished to do so, subject to -%% the following conditions: -%% -%% The above copyright notice and this permission notice shall be included -%% in all copies or substantial portions of the Software. -%% -%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -%% OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -%% MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -%% NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -%% LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -%% OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -%% WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -:- module(minisat,[ - solve/1, - sat/1, - sat_init/0, - sat_deinit/0, - sat_add_clauses/3, - sat_solve/1, - - minimize/2, - maximize/2, - minimize_v1/2, - maximize_v1/2, - minimize_v2/2, - maximize_v2/2, - minimize_v3/2, - maximize_v3/2 -]). - -:- use_module(library(shlib)). - -:- use_module(library(lists)). - -:- load_foreign_library('pl-minisat',install). - -:- dynamic tmp/1. - - - -%% -%% -sat_init :- - minisat_new_solver, % - create the new solve - minisat_add_clause([-1]), % - add zero - minisat_add_clause([2]). % - add one - -%% -%% -sat_deinit :- - minisat_delete_solver. - - - -%% -%% -sat_add_clauses(Cs, Vs, MiniSat_Vs) :- - term_variables(Cs,CsVars), - \+ \+ ( - bind2index(CsVars), - add_cnf_clauses(Cs), - asserta(tmp(Vs)) - ), - retract(tmp(MiniSat_Vs)). - -add_cnf_clauses([]). -add_cnf_clauses([Cl|Cls]) :- - to_minisat(Cl,MiniSatCl), - minisat_add_clause(MiniSatCl), - add_cnf_clauses(Cls). - -to_minisat([],[]). -to_minisat([L|Ls],[N|Ns]) :- - minisat_aux(L,N), - to_minisat(Ls,Ns). - -minisat_aux(0,1) :- !. -minisat_aux(1,2) :- !. -minisat_aux(-(1),1) :- !. -minisat_aux(-(0),2) :- !. -minisat_aux(N,NN) :- NN is N. - - -bind2index(Vs) :- - minisat_nvars(N), - N1 is N+1, - bind2index_aux(Vs,N1). - -bind2index_aux([],_N). -bind2index_aux([V|Ns],N) :- - var(V), - !, - V=N, - N1 is N+1, bind2index_aux(Ns,N1). -bind2index_aux([V|Ns],N) :- - integer(V), - bind2index_aux(Ns,N). - -%% -%% -sat_solve(As) :- - to_minisat(As,MINISAT_As), - minisat_solve(MINISAT_As). - - -%% -%% -sat_get_values([],[]). -sat_get_values([SAT_V|SVs],[PL_V|PL_Vs]) :- - minisat_get_var_assignment(SAT_V,N), - ( N<0 -> PL_V=0 ; PL_V=1), - sat_get_values(SVs,PL_Vs). - - - - -%% -%% sat(+CNF): succeds if CNF is satisfaiable, it does not bind the variables in CNF -%% - -sat(CNF) :- - sat_init, - sat_add_clauses(CNF,_,_), - sat_solve([]), - sat_deinit, - !. -sat(_CNF) :- - sat_deinit, - !, - fail. - - -%% -%% solve(+CNF): like CNF/1 but bind the variables of CNF to the solution -%% -solve(CNF) :- - sat_init, - term_variables(CNF,CNF_Vs), - sat_add_clauses(CNF,CNF_Vs,SAT_Vs), - sat_solve([]), - sat_get_values(SAT_Vs,CNF_Vs), - sat_deinit, - !. -solve(_) :- - sat_deinit, - !, - fail. - - -%% -%% -%% -minimize(Vec,CNF) :- minimize_v1(Vec,CNF). -maximize(Vec,CNF) :- maximize_v1(Vec,CNF). - - -%% -%% -minimize_v1(Vec,CNF) :- - minimize_v1_aux(Vec,CNF), - sat(CNF). - -minimize_v1_aux([],_CNF). -minimize_v1_aux([B|Bs],CNF) :- - minimize_v1_aux(Bs,CNF), - ( (B=0, sat(CNF)) -> true ; B=1 ). - - -%% -%% -maximize_v1(Vec,CNF) :- - maximize_v1_aux(Vec,CNF), - sat(CNF). - -maximize_v1_aux([],_CNF). -maximize_v1_aux([B|Bs],CNF) :- - maximize_v1_aux(Bs,CNF), - ( (B=1, sat(CNF)) -> true ; B=0 ). - - - - -%% -%% -minimize_v2(Vec,CNF) :- - retractall(tmp(_)), - reverse(Vec,Vec_MSB), - term_variables(CNF,CNF_Vars), - sat_init, - sat_add_clauses(CNF,[Vec_MSB,CNF_Vars],[Vec_MSB_SVars,CNF_SVars]), - minimize_v2_loop(Vec_MSB_SVars), - sat_get_values(CNF_SVars,CNF_Vars), - sat_deinit, - !. - -minimize_v2_loop([]) :- - sat_solve([]). -minimize_v2_loop([V|Vs]) :- - ( sat_solve([-V]) -> - eliminate_prefix(Vs,0,New_Vs) - ; - sat_add_clauses([[V]],_,_), - New_Vs=Vs - ), - minimize_v2_loop(New_Vs). - - - -%% -%% -maximize_v2(Vec,CNF) :- - reverse(Vec,Vec_MSB), - term_variables(CNF,CNF_Vars), - sat_init, - sat_add_clauses(CNF,[Vec_MSB,CNF_Vars],[Vec_MSB_SVars,CNF_SVars]), - maximize_v2_loop(Vec_MSB_SVars), - sat_get_values(CNF_SVars,CNF_Vars), - sat_deinit, - !. - -maximize_v2_loop([]) :- - sat_solve([]). -maximize_v2_loop([V|Vs]) :- - ( sat_solve([V]) -> - eliminate_prefix(Vs,1,New_Vs) - ; - sat_add_clauses([[V]],_,_), - New_Vs=Vs - ), - maximize_v2_loop(New_Vs). - - - - - -%% -%% -minimize_v3(Vec,CNF) :- - retractall(tmp(_)), - term_variables(CNF,CNF_Vars), - sat_init, - sat_add_clauses(CNF,[Vec,CNF_Vars],[Vec_SVars,CNF_SVars]), - sat_solve([]), - sat_get_values(Vec_SVars,Curr_Min), - sat_get_values(CNF_SVars,Curr_Sol), - minimize_v3_loop(Vec_SVars,CNF_SVars,Curr_Min,Curr_Sol,Vec,CNF_Vars), - minisat_delete_solver, - !. - -minimize_v3_loop(Vec,CNF_SVars,Last_Min,_Last_Sol,Final_Min,Final_Sol) :- - xs_gt_ys(Last_Min,Vec,CNF-[]), - sat_add_clauses(CNF,_,_), - sat_solve([]), - sat_get_values(Vec,Curr_Min), - sat_get_values(CNF_SVars,Curr_Sol), - !, - minimize_v3_loop(Vec,CNF_SVars,Curr_Min,Curr_Sol,Final_Min,Final_Sol). -minimize_v3_loop(_Vec,_CNF_SVars,Final_Min,Final_Sol,Final_Min,Final_Sol) :- - !. - - - -%% -%% -maximize_v3(Vec,CNF) :- - retractall(tmp(_)), - term_variables(CNF,CNF_Vars), - sat_init, - sat_add_clauses(CNF,[Vec,CNF_Vars],[Vec_SVars,CNF_SVars]), - sat_solve([]), - sat_get_values(Vec_SVars,Curr_Max), - sat_get_values(CNF_SVars,Curr_Sol), - maximize_v3_loop(Vec_SVars,CNF_SVars,Curr_Max,Curr_Sol,Vec,CNF_Vars), - minisat_delete_solver, - !. - -maximize_v3_loop(Vec,CNF_SVars,Last_Max,_Last_Sol,Final_Max,Final_Sol) :- - xs_gt_ys(Vec,Last_Max,CNF-[]), - sat_add_clauses(CNF,_,_), - sat_solve([]), - sat_get_values(Vec,Curr_Max), - sat_get_values(CNF_SVars,Curr_Sol), - !, - maximize_v3_loop(Vec,CNF_SVars,Curr_Max,Curr_Sol,Final_Max,Final_Sol). -maximize_v3_loop(_Vec,_CNF_SVars,Final_Max,Final_Sol,Final_Max,Final_Sol) :- - !. - - - - -%% -%% -eliminate_prefix([],_Bit,[]) :- !. -eliminate_prefix([V|Vs],Bit,New_Vs) :- - sat_get_values([V],[VVal]), - VVal = Bit, - ( Bit = 0 -> sat_add_clauses([[-V]],_,_) ; sat_add_clauses([[V]],_,_) ), - !, - eliminate_prefix(Vs,Bit,New_Vs). -eliminate_prefix(Vs,Vs). - - - -%% -%% -% B == (Xs = Ys) -xs_eq_ys([X],[Y],B,Cnf1-Cnf2) :- - !, - eq(X,Y,B,Cnf1-Cnf2). -xs_eq_ys([X|Xs],[Y|Ys],B,Cnf1-Cnf4) :- - eq(X,Y,B1,Cnf1-Cnf2), - xs_eq_ys(Xs,Ys,B2,Cnf2-Cnf3), - and(B1,B2,B,Cnf3-Cnf4). - -%% -xs_gt_ys(Xs,Ys,[[B]|Cnf1]-Cnf2) :- - xs_gt_ys(Xs,Ys,B,Cnf1-Cnf2). - -%% -%% -xs_gt_ys([X],[Y],B,Cnf1-Cnf2) :- !, - gt(X,Y,B,Cnf1-Cnf2). -xs_gt_ys(Xs,Ys,B, Cnf1-Cnf6) :- - split(Xs,LoXs,HiXs), - split(Ys,LoYs,HiYs), - xs_gt_ys(HiXs,HiYs,B1,Cnf1-Cnf2), - xs_eq_ys(HiXs,HiYs,B2,Cnf2-Cnf3), - xs_gt_ys(LoXs,LoYs,B3,Cnf3-Cnf4), - and(B2,B3,Tmp, Cnf4-Cnf5), - or(B1,Tmp,B,Cnf5-Cnf6). - -% Z == X > Y (equivalently Z == X * -Y) -gt(X,Y,Z,[[Z,-X,Y],[-Z,X],[-Z,-Y]|Cnf]-Cnf). - -% Z == (X == Y) -eq(X,Y,Z, [[-Z,-X,Y],[-Z,X,-Y], - [Z,X,Y],[Z,-X,-Y] | Cnf]-Cnf). - -% Z == X or Y -or(X,Y,Z, [[Z,-X],[Z,-Y],[-Z,X,Y] | Cnf]-Cnf). - -% Z == X and Y -and(X,Y,Z, [[Z,X,Y],[-Z,X],[-Z,Y] | Cnf]-Cnf). - -% -split(Xs,As,Bs) :- - length(Xs,N), M is N // 2, - length(As,M), append(As,Bs,Xs). From 71fc7238ff607b0cdddb5f153ffa09b110f59c13 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Mon, 22 Apr 2019 12:18:22 +0100 Subject: [PATCH 12/29] exec --- .gitignore | 1 + C/exec.c | 8 ++++---- CMakeLists.txt | 7 +------ H/Yapproto.h | 4 ++-- H/fields.h | 4 ++-- H/locals.h | 2 +- pl/boot.yap | 2 +- 7 files changed, 12 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index faccf25e8..dbae7786b 100644 --- a/.gitignore +++ b/.gitignore @@ -215,3 +215,4 @@ cmake/docs/Doxyfile *.stackdump *.gz +.Rproj.user diff --git a/C/exec.c b/C/exec.c index 27a873971..f7098440f 100755 --- a/C/exec.c +++ b/C/exec.c @@ -1628,10 +1628,10 @@ static bool exec_absmi(bool top, yap_reset_t reset_mode USES_REGS) { pop_text_stack(i + 1); return out; } + void Yap_PrepGoal(arity_t arity, CELL *pt, YAP_dogoalinfo *gip USES_REGS) { -void Yap_PrepGoal(arity_t arity, CELL *pt, YAP_dogoalinfo *gip USES_REGS) { /* create an initial pseudo environment so that when garbage - collection is going up in the environment chain it doesn't get + collection is going up in the environment chain it doesn't ge t confused */ Yap_ResetException(worker_id); // sl = Yap_InitSlot(t); @@ -1652,7 +1652,7 @@ void Yap_PrepGoal(arity_t arity, CELL *pt, YAP_dogoalinfo *gip USES_REGS) { /* keep a place where you can inform you had an exception */ if (pt) { int i; - for (i = 0; i < arity; i++) { + for (i = 0; i < 3; i++) { XREGS[i + 1] = *pt++; } } @@ -1678,7 +1678,7 @@ void Yap_PrepGoal(arity_t arity, CELL *pt, YAP_dogoalinfo *gip USES_REGS) { static bool do_goal(yamop *CodeAdr, int arity, CELL *pt, YAP_dogoalinfo *gi, bool top USES_REGS) { bool out; - Yap_PrepGoal(arity, pt, gi PASS_REGS); + Yap_PrepGoal(arity, pt, gi PASS_REGS); // CACHE_A1(); P = (yamop *)CodeAdr; // S = CellPtr(RepPredProp( diff --git a/CMakeLists.txt b/CMakeLists.txt index e0600e0fd..7cb812396 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,3 @@ - # value of 3.4.0 or lower. cmake_minimum_required(VERSION 3.4) @@ -905,11 +904,7 @@ add_subDIRECTORY(packages/ProbLog) endif() -if (WITH_MINISAT) - -add_subDIRECTORY(packages/swi-minisat2) - -endif() +add_subDIRECTORY(packages/bee) if (WITH_CLPQR) diff --git a/H/Yapproto.h b/H/Yapproto.h index 5e1999050..5ddce5ee5 100755 --- a/H/Yapproto.h +++ b/H/Yapproto.h @@ -203,12 +203,12 @@ extern void Yap_fail_all(choiceptr bb USES_REGS); extern Term Yap_ExecuteCallMetaCall(Term,Term); extern void Yap_InitExecFs(void); extern bool Yap_JumpToEnv(void); -extern Term Yap_RunTopGoal(Term, bool); +extern Term Yap_RunTopGoal(Term, YAP_dogoalinfo *gip,bool); extern bool Yap_execute_goal(Term, int, Term, bool); extern bool Yap_exec_absmi(bool, yap_reset_t); extern void Yap_trust_last(void); extern void Yap_closeGoal(bool out, yamop *saved_p, yamop * saved_cp, Int saved_e, Int saved_b, yhandle_t hdl, bool pass_ex); -extern void Yap_PrepGoal(UInt, CELL *, choiceptr USES_REGS); +extern void Yap_PrepGoal(arity_t arity, CELL *pt, YAP_dogoalinfo *gip USES_REGS); extern bool Yap_execute_pred(struct pred_entry *ppe, CELL *pt, bool pass_exception USES_REGS); extern int Yap_dogc(int extra_args, Term *tp USES_REGS); diff --git a/H/fields.h b/H/fields.h index bc486302e..d60ec86c5 100644 --- a/H/fields.h +++ b/H/fields.h @@ -34,7 +34,7 @@ #define HENVYOP(N, NAME, op, NEXTNAME, PFAIL) DEF NAME Yap_heap_regs->NAME##_ #define HCPYOP(N, NAME, OP, FAILP) DEF NAME Yap_heap_regs->NAME##_ -#include "heap.h" +#include "YapHeap.h" #undef HM #undef HSPACE @@ -72,7 +72,7 @@ DEF GLOBAL_##NAME Yap_heap_regs->NAME##_ #define HCPYOP(N, NAME, OP, FAILP) DEF GLOBAL_##NAME Yap_heap_regs->NAME##_ -#include "heap.h" +#include "YapHeap.h" #undef LOC #undef LOCL diff --git a/H/locals.h b/H/locals.h index 7380c1c5d..e42e9dcd2 100644 --- a/H/locals.h +++ b/H/locals.h @@ -3,7 +3,7 @@ // Macro support #ifndef LOCAL #include "Yap.h" -#include "heap.h" +#include "YapHeap.h" #define LOCAL(A, B) A B #define LOCAL_INIT(A, B, C) \ A B; \ diff --git a/pl/boot.yap b/pl/boot.yap index 941e1c8c7..377e5db00 100644 --- a/pl/boot.yap +++ b/pl/boot.yap @@ -267,7 +267,7 @@ initialize_prolog :- :- c_compile( 'protect.yap' ). :- ['absf.yap']. -%:- stop_low_level_trace. +%:- ..............................lp------------------------------------------------------------------. :- use_module('error.yap'). :- [ From a87654b0b0c627b6e9cc22642ef251050ca95273 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Wed, 24 Apr 2019 10:31:05 +0100 Subject: [PATCH 13/29] exec --- C/utilpreds.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/C/utilpreds.c b/C/utilpreds.c index 2247f9344..487e921c0 100644 --- a/C/utilpreds.c +++ b/C/utilpreds.c @@ -151,8 +151,9 @@ clean_complex_tr(tr_fr_ptr TR0 USES_REGS) { } #define expand_stack(S0,SP,SF,TYPE) \ - { size_t sz = SF-S0, used = SP-S0; \ - S0 = Realloc(S0, (1024+sz)*sizeof(TYPE) PASS_REGS); \ + { size_t sz = SF-S0, used = SP-S0;\ +sz = 1024+sz; \ + S0 = Realloc(S0, sz*sizeof(TYPE) PASS_REGS); \ SP = S0+used; SF = S0+sz; } #define MIN_ARENA_SIZE (1048L) From b97338f84d0fd3b59f71a3ca8d87e4c68fd463c2 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Wed, 24 Apr 2019 12:10:06 +0100 Subject: [PATCH 14/29] reset excess change --- .gitignore | 1 - C/absmi.c | 57 ++++++--------- C/absmi_insts.h | 9 +-- C/c_interface.c | 146 ++++++++++++++++++------------------- C/control_absmi_insts.h | 2 +- C/exec.c | 157 ++++++++++++++++++---------------------- C/lu_absmi_insts.h | 1 + C/prim_absmi_insts.h | 138 +++++++++++++++++------------------ C/utilpreds.c | 5 +- CMakeLists.txt | 7 +- CXX/yapi.cpp | 152 +++++++++++++++++++------------------- H/YapHandles.h | 31 -------- H/Yapproto.h | 4 +- H/fields.h | 4 +- H/locals.h | 2 +- include/YapDefs.h | 4 +- pl/boot.yap | 2 +- 17 files changed, 337 insertions(+), 385 deletions(-) diff --git a/.gitignore b/.gitignore index dbae7786b..faccf25e8 100644 --- a/.gitignore +++ b/.gitignore @@ -215,4 +215,3 @@ cmake/docs/Doxyfile *.stackdump *.gz -.Rproj.user diff --git a/C/absmi.c b/C/absmi.c index 0f07a5186..fcd31e639 100755 --- a/C/absmi.c +++ b/C/absmi.c @@ -916,26 +916,24 @@ static int interrupt_dexecute(USES_REGS1) { static void undef_goal(USES_REGS1) { PredEntry *pe = PredFromDefCode(P); - /* avoid trouble with undefined dynamic procedures */ - /* I assume they were not locked beforehand */ - #if defined(YAPOR) || defined(THREADS) + BEGD(d0); +/* avoid trouble with undefined dynamic procedures */ +/* I assume they were not locked beforehand */ +#if defined(YAPOR) || defined(THREADS) if (!PP) { PELOCK(19, pe); PP = pe; } #endif - BACKUP_MACHINE_REGS(); -if (pe->PredFlags & (DynamicPredFlag | LogUpdatePredFlag | MultiFileFlag) ) { + if (pe->PredFlags & (DynamicPredFlag | LogUpdatePredFlag | MultiFileFlag) ) { #if defined(YAPOR) || defined(THREADS) UNLOCKPE(19, PP); PP = NULL; #endif CalculateStackGap(PASS_REGS1); P = FAILCODE; - RECOVER_MACHINE_REGS(); return; } -#if DEBUG if (UndefCode == NULL || UndefCode->OpcodeOfPred == UNDEF_OPCODE) { fprintf(stderr,"call to undefined Predicates %s ->", IndicatorOfPred(pe)); Yap_DebugPlWriteln(ARG1); @@ -948,28 +946,16 @@ if (pe->PredFlags & (DynamicPredFlag | LogUpdatePredFlag | MultiFileFlag) ) { #endif CalculateStackGap(PASS_REGS1); P = FAILCODE; - RECOVER_MACHINE_REGS(); return; } -#endif #if defined(YAPOR) || defined(THREADS) UNLOCKPE(19, PP); PP = NULL; - #endif - CELL o = AbsPair(HR); - if (pe->ModuleOfPred == PROLOG_MODULE) { - if (CurrentModule == PROLOG_MODULE) - HR[0] = TermProlog; - else - HR[0] = CurrentModule; - } else { - HR[0] = Yap_Module_Name(pe); - } - HR += 2; +#endif if (pe->ArityOfPE == 0) { - HR[-1] = MkAtomTerm((Atom)(pe->FunctorOfPred)); + d0 = MkAtomTerm((Atom)(pe->FunctorOfPred)); } else { - HR[-1] = AbsAppl(HR); + d0 = AbsAppl(HR); *HR++ = (CELL)pe->FunctorOfPred; CELL *ip=HR; UInt imax = pe->ArityOfPE; @@ -998,20 +984,30 @@ if (pe->PredFlags & (DynamicPredFlag | LogUpdatePredFlag | MultiFileFlag) ) { ENDD(d1); } } - ARG1 = o; - ARG2 = MkVarTerm(); + ARG1 = AbsPair(HR); + HR[1] = d0; +ENDD(d0); + if (pe->ModuleOfPred == PROLOG_MODULE) { + if (CurrentModule == PROLOG_MODULE) + HR[0] = TermProlog; + else + HR[0] = CurrentModule; + } else { + HR[0] = Yap_Module_Name(pe); + } + ARG2 = Yap_getUnknownModule(Yap_GetModuleEntry(HR[0])); + HR += 2; #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) low_level_trace(enter_pred, UndefCode, XREGS + 1); #endif /* LOW_LEVEL_TRACE */ P = UndefCode->CodeOfPred; - RECOVER_MACHINE_REGS(); } static void spy_goal(USES_REGS1) { PredEntry *pe = PredFromDefCode(P); - BACKUP_MACHINE_REGS(); + #if defined(YAPOR) || defined(THREADS) if (!PP) { PELOCK(14, pe); @@ -1031,7 +1027,6 @@ static void spy_goal(USES_REGS1) { PP = NULL; } #endif - RECOVER_MACHINE_REGS(); return; } } @@ -1049,7 +1044,6 @@ static void spy_goal(USES_REGS1) { } #endif Yap_NilError(CALL_COUNTER_UNDERFLOW_EVENT, ""); - RECOVER_MACHINE_REGS(); return; } LOCAL_PredEntriesCounter--; @@ -1061,7 +1055,6 @@ static void spy_goal(USES_REGS1) { } #endif Yap_NilError(PRED_ENTRY_COUNTER_UNDERFLOW_EVENT, ""); - RECOVER_MACHINE_REGS(); return; } if ((pe->PredFlags & (CountPredFlag | ProfiledPredFlag | SpiedPredFlag)) == @@ -1073,7 +1066,6 @@ static void spy_goal(USES_REGS1) { } #endif P = pe->cs.p_code.TrueCodeOfPred; - RECOVER_MACHINE_REGS(); return; } } @@ -1092,7 +1084,6 @@ static void spy_goal(USES_REGS1) { PP = NULL; } #endif - RECOVER_MACHINE_REGS(); return; } } @@ -1162,7 +1153,6 @@ static void spy_goal(USES_REGS1) { low_level_trace(enter_pred, pt0, XREGS + 1); #endif /* LOW_LEVEL_TRACE */ } - RECOVER_MACHINE_REGS(); } Int Yap_absmi(int inp) { @@ -1323,10 +1313,11 @@ Int Yap_absmi(int inp) { #endif /* USE_THREADED_CODE */ #if PUSH_REGS - old_regs = Yap_regp; + old_regs = &Yap_REGS; /* done, let us now initialize this space */ init_absmi_regs(&absmi_regs); + /* the registers are all set up, let's swap */ #ifdef THREADS pthread_setspecific(Yap_yaamregs_key, (const void *)&absmi_regs); diff --git a/C/absmi_insts.h b/C/absmi_insts.h index 6aeaff66f..5499274c2 100644 --- a/C/absmi_insts.h +++ b/C/absmi_insts.h @@ -9,8 +9,8 @@ #endif /* INDENT_CODE */ BOp(Ystop, l); - //LOCAL_CBorder = 0; - //SET_ASP(YREG, E_CB * sizeof(CELL)); + LOCAL_CBorder = 0; + SET_ASP(YREG, E_CB * sizeof(CELL)); /* make sure ASP is initialized */ saveregs(); @@ -20,13 +20,12 @@ #if BP_FREE P1REG = PCBACKUP; #endif - //LOCAL_CBorder = 0; + LOCAL_CBorder = 0; return 1; ENDBOp(); BOp(Nstop, e); - //B= B->cp_b; - //SET_ASP(YREG, E_CB * sizeof(CELL)); + SET_ASP(YREG, E_CB * sizeof(CELL)); saveregs(); #if PUSH_REGS restore_absmi_regs(old_regs); diff --git a/C/c_interface.c b/C/c_interface.c index 6113a0b29..a6e9d223a 100755 --- a/C/c_interface.c +++ b/C/c_interface.c @@ -421,25 +421,8 @@ X_API void *YAP_BlobOfTerm(Term t) { if (IsVarTerm(t)) return NULL; - if (!IsBigIntTerm(t)) { - if (IsAtomTerm(t)) { - AtomEntry *ae = RepAtom(AtomOfTerm(t)); - StaticArrayEntry *pp; - - READ_LOCK(ae->ARWLock); - pp = RepStaticArrayProp(ae->PropsOfAE); - while (!EndOfPAEntr(pp) && pp->KindOfPE != ArrayProperty) - pp = RepStaticArrayProp(pp->NextOfPE); - if (EndOfPAEntr(pp) || pp->ValueOfVE.ints == NULL) { - READ_UNLOCK(ae->ARWLock); - return NULL; - } else { - READ_UNLOCK(ae->ARWLock); - return pp->ValueOfVE.ints; - } - } + if (!IsBigIntTerm(t)) return NULL; - } src = (MP_INT *)(RepAppl(t) + 2); return (void *)(src + 1); } @@ -994,10 +977,6 @@ static Int execute_cargs(PredEntry *pe, CPredicate exec_code USES_REGS) { "YAP only supports SWI C-call with arity =< 10"); return false; } - arity_t i; - for (i = 0; i < pe->ArityOfPE; i++) { - XREGS[i+1] = Yap_GetFromSlot(a1+i); - } Yap_RecoverSlots(pe->ArityOfPE, a1); return rc; } @@ -1759,35 +1738,35 @@ static int run_emulator(USES_REGS1) { X_API bool YAP_EnterGoal(YAP_PredEntryPtr ape, CELL *ptr, YAP_dogoalinfo *dgi) { CACHE_REGS PredEntry *pe = ape; - bool out; - fprintf(stderr,"EnterGoal: H=%ld ENV=%ld B=%ld TR=%ld P=%p CP=%p, Slots=%ld\n",HR-H0,LCL0-ENV,LCL0-(CELL*)B,(CELL*)TR-LCL0, P, CP, - LOCAL_CurSlot); + bool out; + // fprintf(stderr,"EnterGoal: H=%d ENV=%p B=%d TR=%d P=%p CP=%p + // Slots=%d\n",HR-H0,LCL0-ENV,LCL0-(CELL*)B,(CELL*)TR-LCL0, P, CP, + // LOCAL_CurSlot); BACKUP_MACHINE_REGS(); LOCAL_ActiveError->errorNo = YAP_NO_ERROR; LOCAL_PrologMode = UserMode; dgi->p = P; dgi->cp = CP; - dgi->b_top = LCL0 - (CELL *)B; - dgi->e = LCL0-ENV; + dgi->b0 = LCL0 - (CELL *)B; dgi->CurSlot = LOCAL_CurSlot; // ensure our current ENV receives current P. - Yap_PrepGoal(pe->ArityOfPE, nullptr, dgi PASS_REGS); + Yap_PrepGoal(pe->ArityOfPE, nullptr, B PASS_REGS); P = pe->CodeOfPred; - // __android_log_print(ANDROID_LOG_INFO, "YAP ", "ap=%p %ld %x %x args=%x,%x - // slot=%ld", pe, pe->CodeOfPred->opc, FAILCODE, Deref(ARG1), Deref(ARG2), + // __android_log_print(ANDROID_LOG_INFO, "YAP ", "ap=%p %d %x %x args=%x,%x + // slot=%d", pe, pe->CodeOfPred->opc, FAILCODE, Deref(ARG1), Deref(ARG2), // LOCAL_CurSlot); + dgi->b = LCL0 - (CELL *)B; dgi->h = HR - H0; dgi->tr = (CELL *)TR - LCL0; - // HR-H0,LCL0-ENV,LCL0-(CELL*)B,(CELL*)TR-LCL0, P11= (LCL0 - (CELL*)B); - out = Yap_exec_absmi(true, false); - // fprintf(stderr,"EnterGoal success=%ld: H=%ld ENV=%p B=%ld TR=%ld P=%p CP=%p - // Slots=%ld\n", out,HR-H0,LCL0-ENV,LCL0-(CELL*)B,(CELL*)TR-LCL0, P, CP, - // LOCAL_CurSlot); - dgi->b_bottom = (LCL0 - (CELL*)B); - dgi->e = LCL0 - (CELL *)ENV; - dgi->y = LCL0 - (CELL *)YENV; + // fprintf(stderr,"PrepGoal: H=%d ENV=%p B=%d TR=%d P=%p CP=%p Slots=%d\n", + // HR-H0,LCL0-ENV,LCL0-(CELL*)B,(CELL*)TR-LCL0, P, CP, LOCAL_CurSlot); + out = Yap_exec_absmi(true, false); + // fprintf(stderr,"EnterGoal success=%d: H=%d ENV=%p B=%d TR=%d P=%p CP=%p + // Slots=%d\n", out,HR-H0,LCL0-ENV,LCL0-(CELL*)B,(CELL*)TR-LCL0, P, CP, + // LOCAL_CurSlot); + dgi->b = LCL0 - (CELL *)B; if (out) { dgi->EndSlot = LOCAL_CurSlot; Yap_StartSlots(); @@ -1805,8 +1784,8 @@ X_API bool YAP_RetryGoal(YAP_dogoalinfo *dgi) { bool out; BACKUP_MACHINE_REGS(); - myB = (choiceptr)(LCL0 - dgi->b_top); - myB0 = (choiceptr)(LCL0 - dgi->b_bottom); + myB = (choiceptr)(LCL0 - dgi->b); + myB0 = (choiceptr)(LCL0 - dgi->b0); CP = myB->cp_cp; /* sanity check */ if (B >= myB0) { @@ -1816,15 +1795,16 @@ X_API bool YAP_RetryGoal(YAP_dogoalinfo *dgi) { // get rid of garbage choice-points B = myB; } - // fprintf(stderr,"RetryGoal: H=%ld ENV=%p B=%ld TR=%ld P=%p CP=%p Slots=%ld\n", + // fprintf(stderr,"RetryGoal: H=%d ENV=%p B=%d TR=%d P=%p CP=%p Slots=%d\n", // HR-H0,LCL0-ENV,LCL0-(CELL*)B,(CELL*)TR-LCL0, P, CP, LOCAL_CurSlot); P = FAILCODE; /* make sure we didn't leave live slots when we backtrack */ + ASP = (CELL *)B; LOCAL_CurSlot = dgi->EndSlot; out = Yap_exec_absmi(true, true ); if (out) { dgi->EndSlot = LOCAL_CurSlot; - dgi->b_bottom = LCL0-CellPtr(myB); + dgi->b = LCL0 - (CELL *)B; } else { LOCAL_CurSlot = dgi->CurSlot; // ignore any slots created within the called goal @@ -1837,12 +1817,12 @@ X_API bool YAP_LeaveGoal(bool successful, YAP_dogoalinfo *dgi) { CACHE_REGS choiceptr myB, handler; - // fprintf(stderr,"LeaveGoal success=%ld: H=%d ENV=%p B=%ldd myB=%ldd TR=%ld - // P=%p CP=%p Slots=%ld\n", + // fprintf(stderr,"LeaveGoal success=%d: H=%d ENV=%p B=%ld myB=%ld TR=%d + // P=%p CP=%p Slots=%d\n", // successful,HR-H0,LCL0-ENV,LCL0-(CELL*)B,dgi->b0,(CELL*)TR-LCL0, P, CP, // LOCAL_CurSlot); BACKUP_MACHINE_REGS(); - myB = (choiceptr)(LCL0 - dgi->b_bottom); + myB = (choiceptr)(LCL0 - dgi->b); if (LOCAL_PrologMode & AsyncIntMode) { Yap_signal(YAP_FAIL_SIGNAL); } @@ -1868,39 +1848,25 @@ X_API bool YAP_LeaveGoal(bool successful, YAP_dogoalinfo *dgi) { } P = dgi->p; CP = dgi->cp; - ENV = LCL0-dgi->e; - YENV = LCL0-dgi->y; - /* ASP should be set to the top of the local stack when we - did the call */ - SET_ASP(YENV, E_CB * sizeof(CELL)); - - B = (choiceptr)(LCL0-dgi->b_top) RECOVER_MACHINE_REGS(); - fprintf(stderr,"LeftGoal success=%d: H=%ld ENV=%ld B=%ld TR=%ld P=%p CP=%p, Slots=%ld\n", successful,HR-H0,LCL0-ENV,LCL0-(CELL*)B,(CELL*)TR-LCL0, P, - CP, LOCAL_CurSlot); + // fprintf(stderr,"LeftGoal success=%d: H=%d ENV=%p B=%d TR=%d P=%p CP=%p + // Slots=%d\n", successful,HR-H0,LCL0-ENV,LCL0-(CELL*)B,(CELL*)TR-LCL0, P, + // CP, LOCAL_CurSlot); return TRUE; } X_API Int YAP_RunGoal(Term t) { CACHE_REGS Term out; - YAP_dogoalinfo gi; - gi.p = P; - gi.cp = CP; - gi.b_top = LCL0-CellPtr(B); - gi.CurSlot = Yap_CurrentHandle(); - gi.y = LCL0-YENV; - gi.e = LCL0-ENV; - yhandle_t cslot = LOCAL_CurSlot; + yhandle_t cslot = LOCAL_CurSlot; BACKUP_MACHINE_REGS(); LOCAL_AllowRestart = FALSE; LOCAL_PrologMode = UserMode; - out = Yap_RunTopGoal(t, &gi, true); + out = Yap_RunTopGoal(t, true); LOCAL_PrologMode = UserCCallMode; // should we catch the exception or pass it through? // We'll pass it through - SET_ASP(YENV, E_CB * sizeof(CELL)); RECOVER_MACHINE_REGS(); LOCAL_CurSlot = cslot; return out; @@ -1976,17 +1942,17 @@ X_API CELL *YAP_HeapStoreOpaqueTerm(Term t) { X_API Int YAP_RunGoalOnce(Term t) { CACHE_REGS Term out; - YAP_dogoalinfo gi; - Int oldPrologMode = LOCAL_PrologMode; + yamop *old_CP = CP; + Int oldPrologMode = LOCAL_PrologMode; + yhandle_t CSlot; BACKUP_MACHINE_REGS(); - Yap_push_state(&gi PASS_REGS); + CSlot = Yap_StartSlots(); LOCAL_PrologMode = UserMode; // Yap_heap_regs->yap_do_low_level_trace=true; - out = Yap_RunTopGoal(t, &gi, true); + out = Yap_RunTopGoal(t, true); LOCAL_PrologMode = oldPrologMode; // Yap_CloseSlots(CSlot); - Yap_pop_state(out, &gi PASS_REGS); if (!(oldPrologMode & UserCCallMode)) { /* called from top-level */ LOCAL_AllowRestart = FALSE; @@ -1996,6 +1962,38 @@ X_API Int YAP_RunGoalOnce(Term t) { // should we catch the exception or pass it through? // We'll pass it through // Yap_RaiseException(); + if (out) { + choiceptr cut_pt, ob; + + ob = NULL; + cut_pt = B; + while (cut_pt->cp_ap != NOCODE) { + /* make sure we prune C-choicepoints */ + if (POP_CHOICE_POINT(cut_pt->cp_b)) { + POP_EXECUTE(); + } + ob = cut_pt; + cut_pt = cut_pt->cp_b; + } +#ifdef YAPOR + CUT_prune_to(cut_pt); +#endif + if (ob) { + B = ob; + Yap_TrimTrail(); + } + B = cut_pt; + } else { + Yap_CloseSlots(CSlot); + } + ASP = B->cp_env; + ENV = (CELL *)ASP[E_E]; + B = (choiceptr)ASP[E_CB]; +#ifdef DEPTH_LIMITxs + DEPTH = ASP[E_DEPTH]; +#endif + P = (yamop *)ASP[E_CP]; + CP = old_CP; LOCAL_AllowRestart = FALSE; RECOVER_MACHINE_REGS(); return out; @@ -2080,7 +2078,7 @@ X_API void YAP_PruneGoal(YAP_dogoalinfo *gi) { CACHE_REGS BACKUP_B(); - choiceptr myB = (choiceptr)(LCL0 - gi->b_top); + choiceptr myB = (choiceptr)(LCL0 - gi->b); while (B != myB) { /* make sure we prune C-choicepoints */ if (POP_CHOICE_POINT(B->cp_b)) { @@ -2137,7 +2135,7 @@ int lvl = push_text_stack(); sno = Yap_OpenStream(tat, "r", MkAtomTerm(Yap_LookupAtom(fname)), LOCAL_encoding); __android_log_print( - ANDROID_LOG_INFO, "YAPDroid", "OpenStream got %ld ",sno); + ANDROID_LOG_INFO, "YAPDroid", "OpenStream got %d ",sno); if (sno < 0 || !Yap_ChDir(dirname((char *)d))) { *full = NULL; pop_text_stack(lvl); @@ -2179,7 +2177,7 @@ X_API void YAP_EndConsult(int sno, int *osnop, const char *full) { if (osnop >= 0) Yap_AddAlias(AtomLoopStream, *osnop); Yap_end_consult(); - __android_log_print(ANDROID_LOG_INFO, "YAPDroid ", " closing %s:%s(%ld), %ld", + __android_log_print(ANDROID_LOG_INFO, "YAPDroid ", " closing %s:%s(%d), %d", CurrentModule == 0 ? "prolog" : RepAtom(AtomOfTerm(CurrentModule))->StrOfAE, @@ -2208,8 +2206,8 @@ X_API Term YAP_ReadFromStream(int sno) { sigjmp_buf signew; if (sigsetjmp(signew, 0)) { Yap_syntax_error(LOCAL_toktide, sno, "ReadFromStream"); - RECOVER_MACHINE_REGS(); - return 0; + RECOVER_MACHINE_REGS(); + return 0; } else { o = Yap_read_term(sno, TermNil, false); } diff --git a/C/control_absmi_insts.h b/C/control_absmi_insts.h index 483609e1b..59469248e 100644 --- a/C/control_absmi_insts.h +++ b/C/control_absmi_insts.h @@ -1,4 +1,4 @@ -/************************************************************************ \ +/************************************************************************\ * Cut & Commit Inst ructions * diff --git a/C/exec.c b/C/exec.c index f7098440f..f332fd307 100755 --- a/C/exec.c +++ b/C/exec.c @@ -801,13 +801,14 @@ static Int execute_in_mod(USES_REGS1) { /* '$execute'(Goal) */ * * @method prune_inner_computation */ -static void prune_inner_computation(choiceptr parent, YAP_dogoalinfo *gi) { +static void prune_inner_computation(choiceptr parent) { /* code */ choiceptr cut_pt; + yamop *oP = P, *oCP = CP; + Int oENV = LCL0 - ENV; + cut_pt = B; - while (cut_pt && cut_pt->cp_b - && cut_pt->cp_ap != NOCODE && - cut_pt->cp_b <= parent) { + while (cut_pt && cut_pt->cp_b < parent) { cut_pt = cut_pt->cp_b; } if (!cut_pt) @@ -818,9 +819,9 @@ static void prune_inner_computation(choiceptr parent, YAP_dogoalinfo *gi) { B = cut_pt; Yap_TrimTrail(); LOCAL_AllowRestart = FALSE; - P = gi->p; - CP = gi->cp; - ENV = LCL0-gi->e; + P = oP; + CP = oCP; + ENV = LCL0 - oENV; B = parent; } @@ -829,7 +830,7 @@ static void prune_inner_computation(choiceptr parent, YAP_dogoalinfo *gi) { * after completing a computation. * @method complete_inner_computation */ -static void complete_inner_computation(choiceptr old_B, YAP_dogoalinfo *gi) { +static void complete_inner_computation(choiceptr old_B) { choiceptr myB = B; if (myB == NULL) { return; @@ -847,30 +848,30 @@ static void complete_inner_computation(choiceptr old_B, YAP_dogoalinfo *gi) { return; } // restore environment at call... - CP = gi->cp; - P = gi->p; - ENV = LCL0-gi->e; - YENV = LCL0-gi->y; - + CP = myB->cp_cp; + ENV = myB->cp_env; } static Int Yap_ignore(Term t, bool fail USES_REGS) { - YAP_dogoalinfo gi; - Yap_push_state(&gi); + yamop *oP = P, *oCP = CP; + Int oENV = LCL0 - ENV; + Int oYENV = LCL0 - YENV; + Int oB = LCL0 - (CELL *)B; yap_error_descriptor_t *ctx = malloc(sizeof(yap_error_descriptor_t)); bool newxp = Yap_pushErrorContext(true, ctx); - bool rc = Yap_RunTopGoal(t, &gi, false); - choiceptr B0 = (choiceptr)(LCL0-gi.b_top); + bool rc = Yap_RunTopGoal(t, false); if (!rc) { - complete_inner_computation(B0, &gi); + complete_inner_computation((choiceptr)(LCL0 - oB)); // We'll pass it through } else { - prune_inner_computation(B0, &gi); + prune_inner_computation((choiceptr)(LCL0 - oB)); } Yap_popErrorContext(newxp, true); - P = gi.p; - CP = gi.cp; - //YENV? + P = oP; + CP = oCP; + ENV = LCL0 - oENV; + YENV = LCL0 - oYENV; + B = (choiceptr)(LCL0 - oB); return true; } @@ -1000,39 +1001,30 @@ static bool watch_retry(Term d0 USES_REGS) { static Int setup_call_catcher_cleanup(USES_REGS1) { Term Setup = Deref(ARG1); - YAP_dogoalinfo gi; - gi.p = P; - gi.cp = CP; - gi.b_top = LCL0-CellPtr(B); - gi.CurSlot = Yap_CurrentHandle(); - gi.y = LCL0-YENV; - gi.e = LCL0-ENV; - bool rc; + choiceptr B0 = B; + yamop *oP = P, *oCP = CP; + Int oENV = LCL0 - ENV; + Int oYENV = LCL0 - YENV; + bool rc; Yap_DisableInterrupts(worker_id); - rc = Yap_RunTopGoal(Setup, &gi, false); + rc = Yap_RunTopGoal(Setup, false); Yap_EnableInterrupts(worker_id); if (Yap_RaiseException()) { return false; } - choiceptr B0=(choiceptr)(LCL0-gi.b_top); if (!rc) { - complete_inner_computation(B0, &gi); + complete_inner_computation(B0); // We'll pass it throughs return false; } else { - prune_inner_computation(B0, &gi); + prune_inner_computation(B0); } - YENV = LCL0-gi.y; - ENV = LCL0-gi.e; - B = (choiceptr)(LCL0-gi.b_top); - SET_ASP(YENV, E_CB * sizeof(CELL)); -#ifdef DEPTH_LIMIT - DEPTH = ENV[E_DEPTH]; -#endif - P = gi.p; - CP = gi.cp; + P = oP; + CP = oCP; + ENV = LCL0 - oENV; + YENV = LCL0 - oYENV; return rc; } @@ -1606,7 +1598,7 @@ static bool exec_absmi(bool top, yap_reset_t reset_mode USES_REGS) { ASP = (CELL *)PROTECT_FROZEN_B(B); if (B == NULL || B->cp_b == NULL || - (CELL *)(B->cp_b) >= LCL0 - LOCAL_CBorder) { + (CELL *)(B->cp_b) > LCL0 - LOCAL_CBorder) { LOCAL_RestartEnv = sighold; LOCAL_CBorder = OldBorder; pop_text_stack(i + 1); @@ -1617,8 +1609,8 @@ static bool exec_absmi(bool top, yap_reset_t reset_mode USES_REGS) { } YENV = ASP; YENV[E_CB] = Unsigned(B); + pop_text_stack(i + 1); out = Yap_absmi(0); - /* make sure we don't leave a FAIL signal hanging around */ Yap_get_signal(YAP_FAIL_SIGNAL); if (!Yap_has_a_signal()) @@ -1628,15 +1620,15 @@ static bool exec_absmi(bool top, yap_reset_t reset_mode USES_REGS) { pop_text_stack(i + 1); return out; } - void Yap_PrepGoal(arity_t arity, CELL *pt, YAP_dogoalinfo *gip USES_REGS) { +void Yap_PrepGoal(arity_t arity, CELL *pt, choiceptr saved_b USES_REGS) { /* create an initial pseudo environment so that when garbage - collection is going up in the environment chain it doesn't ge t + collection is going up in the environment chain it doesn't get confused */ Yap_ResetException(worker_id); // sl = Yap_InitSlot(t); YENV = ASP; - YENV[E_CP] = (CELL)CP; + YENV[E_CP] = (CELL)YESCODE; YENV[E_CB] = (CELL)B; YENV[E_E] = (CELL)ENV; #ifdef TABLING @@ -1652,33 +1644,31 @@ static bool exec_absmi(bool top, yap_reset_t reset_mode USES_REGS) { /* keep a place where you can inform you had an exception */ if (pt) { int i; - for (i = 0; i < 3; i++) { + for (i = 0; i < arity; i++) { XREGS[i + 1] = *pt++; } } - choiceptr oB = B; B = (choiceptr)ASP; B--; B->cp_h = HR; B->cp_tr = TR; - B->cp_cp = YESCODE; + B->cp_cp = CP; B->cp_ap = NOCODE; B->cp_env = ENV; - B->cp_b = oB; + B->cp_b = saved_b; #ifdef DEPTH_LIMIT B->cp_depth = DEPTH; #endif /* DEPTH_LIMIT */ - ASP = (CELL *)B; - ASP[E_CB] = (CELL)B; + YENV = ASP = (CELL *)B; + YENV[E_CB] = (CELL)B; HB = HR; CP = YESCODE; - ASP -= EnvSizeInCells; - gip->b_bottom = LCL0-CellPtr(B); } -static bool do_goal(yamop *CodeAdr, int arity, CELL *pt, YAP_dogoalinfo *gi, bool top USES_REGS) { +static bool do_goal(yamop *CodeAdr, int arity, CELL *pt, bool top USES_REGS) { + choiceptr saved_b = B; bool out; - Yap_PrepGoal(arity, pt, gi PASS_REGS); + Yap_PrepGoal(arity, pt, saved_b PASS_REGS); // CACHE_A1(); P = (yamop *)CodeAdr; // S = CellPtr(RepPredProp( @@ -1750,21 +1740,18 @@ void Yap_fail_all(choiceptr bb USES_REGS) { } bool Yap_execute_pred(PredEntry *ppe, CELL *pt, bool pass_ex USES_REGS) { + yamop *saved_p, *saved_cp; yamop *CodeAdr; bool out; - YAP_dogoalinfo gi; - gi.p = P; - gi.cp = CP; - gi.b_top = LCL0-CellPtr(B); - gi.CurSlot = Yap_CurrentHandle(); - gi.y = LCL0-YENV; - gi.e = LCL0-ENV; + + saved_p = P; + saved_cp = CP; LOCAL_PrologMode |= TopGoalMode; PELOCK(81, ppe); CodeAdr = ppe->CodeOfPred; UNLOCK(ppe->PELock); - out = do_goal(CodeAdr, ppe->ArityOfPE, pt, &gi, false PASS_REGS); + out = do_goal(CodeAdr, ppe->ArityOfPE, pt, false PASS_REGS); if (out) { choiceptr cut_B; @@ -1785,13 +1772,14 @@ bool Yap_execute_pred(PredEntry *ppe, CELL *pt, bool pass_ex USES_REGS) { #endif } #endif /* TABLING */ - B = (choiceptr)(LCL0-gi.b_top); - CP = gi.cp; - P = gi.p; + B = cut_B; + CP = saved_cp; + P = saved_p; + ASP = ENV; #ifdef DEPTH_LIMIT DEPTH = ENV[E_DEPTH]; #endif - ENV = LCL0-gi.e; + ENV = (CELL *)(ENV[E_E]); /* we have failed, and usually we would backtrack to this B, trouble is, we may also have a delayed cut to do */ if (B != NULL) @@ -1810,18 +1798,18 @@ bool Yap_execute_pred(PredEntry *ppe, CELL *pt, bool pass_ex USES_REGS) { } return true; } else if (out == 0) { - P = gi.p; - CP = gi.cp; + P = saved_p; + CP = saved_cp; HR = B->cp_h; #ifdef DEPTH_LIMIT DEPTH = B->cp_depth; #endif - /* YENV should be set to the current environment */ - YENV = ENV = LCL0-gi.e; /* ASP should be set to the top of the local stack when we did the call */ - SET_ASP(YENV, E_CB * sizeof(CELL)); - B =(choiceptr)(LCL0-gi.b_top); + ASP = B->cp_env; + /* YENV should be set to the current environment */ + YENV = ENV = (CELL *)((B->cp_env)[E_E]); + B = B->cp_b; SET_BB(B); HB = PROTECT_FROZEN_H(B); // should we catch the exception or pass it through? @@ -1896,7 +1884,7 @@ void Yap_trust_last(void) { } } -Term Yap_RunTopGoal(Term t, YAP_dogoalinfo *gip, bool handle_errors) { +Term Yap_RunTopGoal(Term t, bool handle_errors) { CACHE_REGS yamop *CodeAdr; Prop pe; @@ -1905,7 +1893,7 @@ Term Yap_RunTopGoal(Term t, YAP_dogoalinfo *gip, bool handle_errors) { UInt arity; Term tmod = CurrentModule; Term goal_out = 0; - LOCAL_PrologMode |= TopGoalMode; + LOCAL_PrologMode |= TopGoalMode; t = Yap_YapStripModule(t, &tmod); if (IsVarTerm(t)) { @@ -1975,7 +1963,7 @@ Term Yap_RunTopGoal(Term t, YAP_dogoalinfo *gip, bool handle_errors) { "unable to boot because of too little Trail space"); } #endif - goal_out = do_goal(CodeAdr, arity, pt, gip, handle_errors PASS_REGS); + goal_out = do_goal(CodeAdr, arity, pt, handle_errors PASS_REGS); return goal_out; } @@ -2141,13 +2129,11 @@ bool Yap_Reset(yap_reset_t mode, bool hard) { Yap_ResetException(worker_id); /* first, backtrack to the root */ - while (B->cp_b) { - if (B->cp_ap == NOCODE) - break; - B = B->cp_b; - } + while (B) { P = FAILCODE; Yap_exec_absmi(true, mode); + B = B->cp_b; + } /* reinitialize the engine */ Yap_InitYaamRegs(worker_id, false); GLOBAL_Initialised = true; @@ -2241,7 +2227,6 @@ static Int generate_pred_info(USES_REGS1) { void Yap_InitYaamRegs(int myworker_id, bool full_reset) { Term h0var; - YAP_dogoalinfo gi; // getchar(); #if PUSH_REGS /* Guarantee that after a longjmp we go back to the original abstract @@ -2313,7 +2298,7 @@ void Yap_InitYaamRegs(int myworker_id, bool full_reset) { PREG_ADDR = NULL; #endif cut_c_initialize(myworker_id); - Yap_PrepGoal(0, NULL, &gi PASS_REGS); + Yap_PrepGoal(0, NULL, NULL PASS_REGS); #ifdef FROZEN_STACKS H_FZ = HR; #ifdef YAPOR_SBA diff --git a/C/lu_absmi_insts.h b/C/lu_absmi_insts.h index 3d57b09e4..bc67bebdf 100644 --- a/C/lu_absmi_insts.h +++ b/C/lu_absmi_insts.h @@ -470,6 +470,7 @@ LogUpdClause *lcl = PREG->y_u.OtILl.d; UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]); + /* fprintf(stderr,"- %p/%p %d %d %p\n",PREG,ap,timestamp,ap->TimeStampOfPred,PREG->y_u.OtILl.d->ClCode);*/ #if defined(YAPOR) || defined(THREADS) if (PP != ap) { if (PP) UNLOCKPE(16,PP); diff --git a/C/prim_absmi_insts.h b/C/prim_absmi_insts.h index 679e9df4f..fc10ba1a4 100644 --- a/C/prim_absmi_insts.h +++ b/C/prim_absmi_insts.h @@ -1949,12 +1949,11 @@ Op(p_arg_vv, xxx); #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { - CELL HRs[3]; - HRs[0] = XREG(PREG->y_u.xxx.x1); - HRs[1] = XREG(PREG->y_u.xxx.x2); - HRs[2] = TermNil; + HR[0] = XREG(PREG->y_u.xxx.x1); + HR[1] = XREG(PREG->y_u.xxx.x2); + RESET_VARIABLE(HR + 2); low_level_trace(enter_pred, - RepPredProp(Yap_GetPredPropByFunc(FunctorArg, 0)), HRs); + RepPredProp(Yap_GetPredPropByFunc(FunctorArg, 0)), HR); } #endif /* LOW_LEVEL_TRACE */ BEGD(d0); @@ -2045,14 +2044,15 @@ Yap_AsmError( DOMAIN_ERROR_NOT_LESS_THAN_ZERO ); Op(p_arg_cv, xxn); #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { - CELL HRs[3]; + CELL *Ho = HR; Term t = MkIntegerTerm(PREG->y_u.xxn.c); - HRs[0] = t; - HRs[1] = XREG(PREG->y_u.xxn.xi); - HRs[2] = TermFoundVar; + HR[0] = t; + HR[1] = XREG(PREG->y_u.xxn.xi); + RESET_VARIABLE(HR + 2); low_level_trace(enter_pred, - RepPredProp(Yap_GetPredPropByFunc(FunctorArg, 0)), HRs); - } + RepPredProp(Yap_GetPredPropByFunc(FunctorArg, 0)), HR); + HR = Ho; + } #endif /* LOW_LEVEL_TRACE */ BEGD(d0); d0 = PREG->y_u.xxn.c; @@ -2118,13 +2118,12 @@ Yap_AsmError( DOMAIN_ERROR_NOT_LESS_THAN_ZERO ); Op(p_arg_y_vv, yxx); #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { - CELL HRs[3]; - - HRs[0] = XREG(PREG->y_u.yxx.x1); - HRs[1] = XREG(PREG->y_u.yxx.x2); - HRs[2] = TermFoundVar; - low_level_trace(enter_pred, - RepPredProp(Yap_GetPredPropByFunc(FunctorArg, 0)), HRs); + HR[0] = XREG(PREG->y_u.yxx.x1); + HR[1] = XREG(PREG->y_u.yxx.x2); + HR[2] = YREG[PREG->y_u.yxx.y]; + RESET_VARIABLE(HR + 2); + low_level_trace(enter_pred, + RepPredProp(Yap_GetPredPropByFunc(FunctorArg, 0)), HR); } #endif /* LOW_LEVEL_TRACE */ BEGD(d0); @@ -2216,13 +2215,15 @@ Yap_AsmError( DOMAIN_ERROR_NOT_LESS_THAN_ZERO ); Op(p_arg_y_cv, yxn); #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { - CELL HRs[3]; + CELL *Ho = HR; Term t = MkIntegerTerm(PREG->y_u.yxn.c); - HRs[0] = t; - HRs[1] = XREG(PREG->y_u.yxn.xi); - HRs[2] = TermNil; + HR[0] = t; + HR[1] = XREG(PREG->y_u.yxn.xi); + HR[2] = YREG[PREG->y_u.yxn.y]; + RESET_VARIABLE(HR + 2); low_level_trace(enter_pred, - RepPredProp(Yap_GetPredPropByFunc(FunctorArg, 0)), HRs); + RepPredProp(Yap_GetPredPropByFunc(FunctorArg, 0)), HR); + HR = Ho; } #endif /* LOW_LEVEL_TRACE */ BEGD(d0); @@ -2294,13 +2295,12 @@ Yap_AsmError( DOMAIN_ERROR_NOT_LESS_THAN_ZERO ); restart_func2s: #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { - CELL HRs[3]; - HRs[0] = TermNil; - HRs[1] = XREG(PREG->y_u.xxx.x1); - HRs[2] = XREG(PREG->y_u.xxx.x2); + RESET_VARIABLE(HR); + HR[1] = XREG(PREG->y_u.xxx.x1); + HR[2] = XREG(PREG->y_u.xxx.x2); low_level_trace(enter_pred, RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor, 0)), - HRs); + HR); } #endif /* LOW_LEVEL_TRACE */ /* We have to build the structure */ @@ -2412,13 +2412,12 @@ Yap_AsmError( DOMAIN_ERROR_NOT_LESS_THAN_ZERO ); restart_func2s_cv: #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { - CELL HRs[3]; - HRs[0] = TermNil; - HRs[1] = PREG->y_u.xxc.c; - HRs[2] = XREG(PREG->y_u.xxc.xi); + RESET_VARIABLE(HR); + HR[1] = PREG->y_u.xxc.c; + HR[2] = XREG(PREG->y_u.xxc.xi); low_level_trace(enter_pred, RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor, 0)), - HRs); + HR); } #endif /* LOW_LEVEL_TRACE */ BEGD(d0); @@ -2518,14 +2517,16 @@ Yap_AsmError( DOMAIN_ERROR_NOT_LESS_THAN_ZERO ); #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { Term ti; - CELL HRs[3]; - HRs[0] = TermNil; + CELL *hi = HR; + ti = MkIntegerTerm(PREG->y_u.xxn.c); - HRs[1] = XREG(PREG->y_u.xxn.xi); - HRs[2] = ti; + RESET_VARIABLE(HR); + HR[1] = XREG(PREG->y_u.xxn.xi); + HR[2] = ti; low_level_trace(enter_pred, RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor, 0)), - HRs); + HR); + HR = hi; } #endif /* LOW_LEVEL_TRACE */ /* We have to build the structure */ @@ -2610,13 +2611,12 @@ Yap_AsmError( DOMAIN_ERROR_NOT_LESS_THAN_ZERO ); restart_func2s_y: #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { - CELL HRs[3]; - HRs[0] = TermNil; - HRs[1] = XREG(PREG->y_u.yxx.x1); - HRs[2] = XREG(PREG->y_u.yxx.x2); + RESET_VARIABLE(HR); + HR[1] = XREG(PREG->y_u.yxx.x1); + HR[2] = XREG(PREG->y_u.yxx.x2); low_level_trace(enter_pred, RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor, 0)), - HRs); + HR); } #endif /* LOW_LEVEL_TRACE */ /* We have to build the structure */ @@ -2735,13 +2735,12 @@ Yap_AsmError( DOMAIN_ERROR_NOT_LESS_THAN_ZERO ); restart_func2s_y_cv: #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { - CELL HRs[3]; - HRs[0] = TermNil; - HRs[1] = PREG->y_u.yxc.c; - HRs[2] = XREG(PREG->y_u.yxc.xi); + RESET_VARIABLE(HR); + HR[1] = PREG->y_u.yxc.c; + HR[2] = XREG(PREG->y_u.yxc.xi); low_level_trace(enter_pred, RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor, 0)), - HRs); + HR); } #endif /* LOW_LEVEL_TRACE */ /* We have to build the structure */ @@ -2847,15 +2846,16 @@ Yap_AsmError( DOMAIN_ERROR_NOT_LESS_THAN_ZERO ); #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { Term ti; - CELL HRs[3]; + CELL *hi = HR; ti = MkIntegerTerm((Int)(PREG->y_u.yxn.c)); - HRs[0] = TermFoundVar; - HRs[1] = XREG(PREG->y_u.yxn.xi); - HRs[2] = ti; + RESET_VARIABLE(HR); + HR[1] = XREG(PREG->y_u.yxn.xi); + HR[2] = ti; low_level_trace(enter_pred, RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor, 0)), - HRs); + HR); + HR = hi; } #endif /* LOW_LEVEL_TRACE */ /* We have to build the structure */ @@ -2952,12 +2952,12 @@ Yap_AsmError( DOMAIN_ERROR_NOT_LESS_THAN_ZERO ); Op(p_func2f_xx, xxx); #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { - Term HRs[3]; - HRs[0] = XREG(PREG->y_u.xxx.x); - HRs[1] = HRs[2] = TermFoundVar; + HR[0] = XREG(PREG->y_u.xxx.x); + RESET_VARIABLE(HR + 1); + RESET_VARIABLE(HR + 2); low_level_trace(enter_pred, RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor, 0)), - HRs); + HR); } #endif /* LOW_LEVEL_TRACE */ BEGD(d0); @@ -3000,12 +3000,12 @@ Yap_AsmError( DOMAIN_ERROR_NOT_LESS_THAN_ZERO ); Op(p_func2f_xy, xxy); #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { - Term HRs[3]; - HRs[0] = XREG(PREG->y_u.xxy.x); - HRs[1] = HRs[2] = TermFoundVar; + HR[0] = XREG(PREG->y_u.xxy.x); + RESET_VARIABLE(HR + 1); + RESET_VARIABLE(HR + 2); low_level_trace(enter_pred, RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor, 0)), - HRs); + HR); } #endif /* LOW_LEVEL_TRACE */ BEGD(d0); @@ -3051,12 +3051,12 @@ Yap_AsmError( DOMAIN_ERROR_NOT_LESS_THAN_ZERO ); Op(p_func2f_yx, yxx); #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { - Term HRs[3]; - HRs[0] = XREG(PREG->y_u.yxx.x2); - HRs[1] = HRs[2] = TermFoundVar; + HR[0] = XREG(PREG->y_u.yxx.x2); + RESET_VARIABLE(HR + 1); + RESET_VARIABLE(HR + 2); low_level_trace(enter_pred, RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor, 0)), - HRs); + HR); } #endif /* LOW_LEVEL_TRACE */ BEGD(d0); @@ -3102,12 +3102,12 @@ Yap_AsmError( DOMAIN_ERROR_NOT_LESS_THAN_ZERO ); Op(p_func2f_yy, yyx); #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { - CELL HRs[3]; - HRs[0] = XREG(PREG->y_u.yyx.x); - HRs[1] = HRs[2] = TermFoundVar; + HR[0] = XREG(PREG->y_u.yyx.x); + RESET_VARIABLE(HR + 1); + RESET_VARIABLE(HR + 2); low_level_trace(enter_pred, RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor, 0)), - HRs); + HR); } #endif /* LOW_LEVEL_TRACE */ BEGD(d0); diff --git a/C/utilpreds.c b/C/utilpreds.c index 487e921c0..2247f9344 100644 --- a/C/utilpreds.c +++ b/C/utilpreds.c @@ -151,9 +151,8 @@ clean_complex_tr(tr_fr_ptr TR0 USES_REGS) { } #define expand_stack(S0,SP,SF,TYPE) \ - { size_t sz = SF-S0, used = SP-S0;\ -sz = 1024+sz; \ - S0 = Realloc(S0, sz*sizeof(TYPE) PASS_REGS); \ + { size_t sz = SF-S0, used = SP-S0; \ + S0 = Realloc(S0, (1024+sz)*sizeof(TYPE) PASS_REGS); \ SP = S0+used; SF = S0+sz; } #define MIN_ARENA_SIZE (1048L) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7cb812396..e0600e0fd 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,4 @@ + # value of 3.4.0 or lower. cmake_minimum_required(VERSION 3.4) @@ -904,7 +905,11 @@ add_subDIRECTORY(packages/ProbLog) endif() -add_subDIRECTORY(packages/bee) +if (WITH_MINISAT) + +add_subDIRECTORY(packages/swi-minisat2) + +endif() if (WITH_CLPQR) diff --git a/CXX/yapi.cpp b/CXX/yapi.cpp index 92e12894b..fe3a3789c 100644 --- a/CXX/yapi.cpp +++ b/CXX/yapi.cpp @@ -252,10 +252,10 @@ YAPStringTerm::YAPStringTerm(wchar_t *s, size_t len) YAPApplTerm::YAPApplTerm(YAPFunctor f, YAPTerm ts[]) { BACKUP_H(); arity_t arity = ArityOfFunctor(f.f); - Term o = AbsAppl(HR); - *HR++ = (CELL)f.f; + Term o = Yap_MkNewApplTerm(f.f, arity); + Term *tt = RepAppl(o) + 1; for (arity_t i = 0; i < arity; i++) - *HR++ = ts[i].term(); + tt[i] = ts[i].term(); mk(o); RECOVER_H(); } @@ -411,23 +411,6 @@ std::vector YAPPairTerm::listToArray() { return o; } -std::vector YAPPairTerm::listToVector() { - Term *tailp; - Term t1 = gt(); - Int l = Yap_SkipList(&t1, &tailp); - if (l < 0) { - throw YAPError(SOURCE(), TYPE_ERROR_LIST, (t), nullptr); - } - std::vector o = *new std::vector(l); - int i = 0; - Term t = gt(); - while (t != TermNil) { - o[i++] = YAPTerm(HeadOfTerm(t)); - t = TailOfTerm(t); - } - return o; -} - YAP_tag_t YAPTerm::tag() { Term tt = gt(); if (IsVarTerm(tt)) { @@ -612,9 +595,43 @@ bool YAPEngine::mgoal(Term t, Term tmod, bool release) { #endif CACHE_REGS BACKUP_MACHINE_REGS(); - bool rc = YAP_RunGoalOnce(t); + Term *ts = nullptr; + q.CurSlot = Yap_StartSlots(); + q.p = P; + q.cp = CP; + Term omod = CurrentModule; + PredEntry *ap = nullptr; + if (IsStringTerm(tmod)) + tmod = MkAtomTerm(Yap_LookupAtom(StringOfTerm(tmod))); + ap = Yap_get_pred(t, tmod, "C++"); + if (ap == nullptr || + ap->OpcodeOfPred == UNDEF_OPCODE) { + ap = rewriteUndefEngineQuery(ap, t, tmod); + } + if (IsApplTerm(t)) + ts = RepAppl(t) + 1; + else if (IsPairTerm(t)) + ts = RepPair(t); + /* legal ap */ + arity_t arity = ap->ArityOfPE; + + for (arity_t i = 0; i < arity; i++) { + XREGS[i + 1] = ts[i]; + } + ts = nullptr; + bool result; + // allow Prolog style exception handling + // don't forget, on success these guys may create slots + //__android_log_print(ANDROID_LOG_INFO, "YAPDroid", "exec "); + + result = (bool)YAP_EnterGoal(ap, nullptr, &q); + // std::cerr << "mgoal " << YAPTerm(tmod).text() << ":" << YAPTerm(t).text() << "\n"; + + YAP_LeaveGoal(result && !release, &q); + CurrentModule = LOCAL_SourceModule = omod; + // PyEval_RestoreThread(_save); RECOVER_MACHINE_REGS(); - return rc; + return result; } /** * called when a query must be terminated and its state fully recovered, @@ -631,51 +648,61 @@ Term YAPEngine::fun(Term t) { CACHE_REGS BACKUP_MACHINE_REGS(); Term tmod = Yap_CurrentModule(), *ts = nullptr; + PredEntry *ap; arity_t arity; Functor f; Atom name; - yhandle_t yt = Yap_NewHandles(1); if (IsApplTerm(t)) { ts = RepAppl(t) + 1; f = (Functor)ts[-1]; name = NameOfFunctor(f); arity = ArityOfFunctor(f); - t = AbsAppl(HR); - HR[0] = (CELL)Yap_MkFunctor(name, arity+1); - for (arity_t i = 0; i < arity; i++) { - HR[i + 1] = ts[i]; - } - HR += (arity+2); - arity++; + for (arity_t i = 0; i < arity; i++) + XREGS[i + 1] = ts[i]; } else if (IsAtomTerm(t)) { name = AtomOfTerm(t); - t = AbsAppl(HR); - HR[0] = (CELL)Yap_MkFunctor(name, 1); - HR += 2; - arity = 1; + f = nullptr; + arity = 0; } else if (IsPairTerm(t)) { - HR[0] = (CELL)Yap_MkFunctor(AtomDot, 3); - HR[1] = ts[0]; - HR[2] = ts[1]; - HR += 4; - arity = 3; + XREGS[1] = ts[0]; + XREGS[2] = ts[1]; + arity = 2; + name = AtomDot; + f = FunctorDot; } else { throw YAPError(SOURCE(), TYPE_ERROR_CALLABLE, t, 0); return 0L; } - RESET_VARIABLE(HR-1); - yt = Yap_InitHandle(t); - CACHE_REGS - BACKUP_MACHINE_REGS(); - bool rc = YAP_RunGoalOnce(t); - Term ot; - if (rc) - ot = ArgOfTerm(arity,Yap_GetFromHandle(yt)); - else - ot = TermNone; - RECOVER_MACHINE_REGS(); - return ot; + Term ot = XREGS[arity + 1] = MkVarTerm(); + yhandle_t h = Yap_InitHandle(ot); + arity++; + HR += arity; + f = Yap_MkFunctor(name, arity); + ap = (PredEntry *)(PredPropByFunc(f, tmod)); + if (ap == nullptr || ap->OpcodeOfPred == UNDEF_OPCODE) { + Term g = (Yap_MkApplTerm(f, arity, ts)); + ap = rewriteUndefEngineQuery(ap, g, (ap->ModuleOfPred)); + } + q.CurSlot = Yap_StartSlots(); + q.p = P; + q.cp = CP; + // make sure this is safe + // allow Prolog style exception handling + //__android_log_print(ANDROID_LOG_INFO, "YAPDroid", "exec "); + + bool result = (bool)YAP_EnterGoal(ap, nullptr, &q); + if (result) + ot = Yap_GetFromHandle(h); + else + ot = TermNone; + YAPCatchError(); + { + YAP_LeaveGoal(result, &q); + // PyEval_RestoreThread(_save); + RECOVER_MACHINE_REGS(); + return ot; + } } YAPQuery::YAPQuery(YAPFunctor f, YAPTerm mod, YAPTerm ts[]) @@ -700,27 +727,6 @@ YAPQuery::YAPQuery(YAPFunctor f, YAPTerm mod, YAPTerm ts[]) RECOVER_MACHINE_REGS(); } -YAPQuery::YAPQuery(YAPFunctor f, YAPTerm mod, Term ts[]) - : YAPPredicate(f, mod) { - - /* ignore flags for now */ - BACKUP_MACHINE_REGS(); - Term goal; - - if (ts) { - size_t arity = f.arity(); - goal = Yap_MkApplTerm(Yap_MkFunctor(f.name().asAtom(),arity), arity, ts); - nts = RepAppl(goal) + 1; - for (arity_t i = 0; i < arity; i++) - XREGS[i + 1] = ts[i]; - } else { - goal = MkVarTerm(); - } - openQuery(); - names = YAPPairTerm(TermNil); - RECOVER_MACHINE_REGS(); -} - #if 0 YAPQuery::YAPQuery(YAPFunctor f, YAPTerm ts[]) : YAPPredicate(f) { /* ignore flags for now */ @@ -821,7 +827,7 @@ bool YAPQuery::deterministic() { BACKUP_MACHINE_REGS(); if (!q_open || q_state == 0) return false; - choiceptr myB = (choiceptr)(LCL0 - q_h.b_top); + choiceptr myB = (choiceptr)(LCL0 - q_h.b); return (B >= myB); RECOVER_MACHINE_REGS(); } diff --git a/H/YapHandles.h b/H/YapHandles.h index bfc212dfc..f7a6be6d3 100755 --- a/H/YapHandles.h +++ b/H/YapHandles.h @@ -304,35 +304,4 @@ static inline Term Yap_PopHandle__(yhandle_t topHandle USES_REGS) { return Deref(LOCAL_HandleBase[topHandle]); } } -INLINE_ONLY void Yap_push_state(YAP_dogoalinfo *gi USES_REGS); - - INLINE_ONLY void Yap_push_state(YAP_dogoalinfo *gi USES_REGS) -{ - gi->p = P; - gi->cp = CP; - gi->b_top = LCL0-CellPtr(B); - gi->CurSlot = Yap_CurrentHandle(); - gi->y = LCL0-YENV; - gi->e = LCL0-ENV; - gi->a = LCL0-ASP; -} - -INLINE_ONLY void Yap_pop_state(bool out, YAP_dogoalinfo *gi USES_REGS); - -INLINE_ONLY void Yap_pop_state(bool out, YAP_dogoalinfo *gi USES_REGS) -{ - B = (choiceptr)(LCL0-gi->b_top); - YENV = LCL0-gi->y; - ENV = LCL0-gi->e; - if (out) { - Yap_TrimTrail(); - } - ASP = LCL0-gi->a; - Yap_CloseHandles(gi->CurSlot); - SET_ASP(YENV, E_CB * sizeof(CELL)); -#ifdef DEPTH_LIMIT - DEPTH = ENV[E_DEPTH]; -#endif -} - #endif diff --git a/H/Yapproto.h b/H/Yapproto.h index 5ddce5ee5..5e1999050 100755 --- a/H/Yapproto.h +++ b/H/Yapproto.h @@ -203,12 +203,12 @@ extern void Yap_fail_all(choiceptr bb USES_REGS); extern Term Yap_ExecuteCallMetaCall(Term,Term); extern void Yap_InitExecFs(void); extern bool Yap_JumpToEnv(void); -extern Term Yap_RunTopGoal(Term, YAP_dogoalinfo *gip,bool); +extern Term Yap_RunTopGoal(Term, bool); extern bool Yap_execute_goal(Term, int, Term, bool); extern bool Yap_exec_absmi(bool, yap_reset_t); extern void Yap_trust_last(void); extern void Yap_closeGoal(bool out, yamop *saved_p, yamop * saved_cp, Int saved_e, Int saved_b, yhandle_t hdl, bool pass_ex); -extern void Yap_PrepGoal(arity_t arity, CELL *pt, YAP_dogoalinfo *gip USES_REGS); +extern void Yap_PrepGoal(UInt, CELL *, choiceptr USES_REGS); extern bool Yap_execute_pred(struct pred_entry *ppe, CELL *pt, bool pass_exception USES_REGS); extern int Yap_dogc(int extra_args, Term *tp USES_REGS); diff --git a/H/fields.h b/H/fields.h index d60ec86c5..bc486302e 100644 --- a/H/fields.h +++ b/H/fields.h @@ -34,7 +34,7 @@ #define HENVYOP(N, NAME, op, NEXTNAME, PFAIL) DEF NAME Yap_heap_regs->NAME##_ #define HCPYOP(N, NAME, OP, FAILP) DEF NAME Yap_heap_regs->NAME##_ -#include "YapHeap.h" +#include "heap.h" #undef HM #undef HSPACE @@ -72,7 +72,7 @@ DEF GLOBAL_##NAME Yap_heap_regs->NAME##_ #define HCPYOP(N, NAME, OP, FAILP) DEF GLOBAL_##NAME Yap_heap_regs->NAME##_ -#include "YapHeap.h" +#include "heap.h" #undef LOC #undef LOCL diff --git a/H/locals.h b/H/locals.h index e42e9dcd2..7380c1c5d 100644 --- a/H/locals.h +++ b/H/locals.h @@ -3,7 +3,7 @@ // Macro support #ifndef LOCAL #include "Yap.h" -#include "YapHeap.h" +#include "heap.h" #define LOCAL(A, B) A B #define LOCAL_INIT(A, B, C) \ A B; \ diff --git a/include/YapDefs.h b/include/YapDefs.h index 840814886..f1c27bcd0 100755 --- a/include/YapDefs.h +++ b/include/YapDefs.h @@ -137,8 +137,8 @@ typedef enum { #include "YapInit.h" /* this should be opaque to the user */ -typedef struct goal_info { - unsigned long b_top, b_bottom, m, e, y, a; //> choice-point at entry +typedef struct { + unsigned long b, b0; //> choice-point at entry YAP_handle_t CurSlot; //> variables at entry YAP_handle_t EndSlot; //> variables at successful execution struct yami *p; //> Program Counter at entry diff --git a/pl/boot.yap b/pl/boot.yap index 377e5db00..941e1c8c7 100644 --- a/pl/boot.yap +++ b/pl/boot.yap @@ -267,7 +267,7 @@ initialize_prolog :- :- c_compile( 'protect.yap' ). :- ['absf.yap']. -%:- ..............................lp------------------------------------------------------------------. +%:- stop_low_level_trace. :- use_module('error.yap'). :- [ From dc5b90a643a38d7b0638dd86f6c678b33bdad199 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Thu, 25 Apr 2019 19:02:01 +0100 Subject: [PATCH 15/29] compilation fixes --- C/heapgc.c | 25 ++++++++++++++----------- C/utilpreds.c | 11 +++++------ 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/C/heapgc.c b/C/heapgc.c index badd63c7e..1c8aaf386 100644 --- a/C/heapgc.c +++ b/C/heapgc.c @@ -2090,12 +2090,12 @@ mark_choicepoints(register choiceptr gc_B, tr_fr_ptr saved_TR, bool very_verbose restart_cp: switch (opnum) { case _Nstop: - if (gc_B->cp_b != NULL) { - nargs = 0; - break; - } else { - /* this is the last choice point, the work is done ;-) */ - return; + if (gc_B->cp_env == LCL0) { + return; + } else { + // This must be a border choicepoint, just move up + gc_B = (choiceptr)(gc_B->cp_env[E_B]); + continue; } case _retry_c: case _retry_userc: @@ -3025,11 +3025,14 @@ sweep_choicepoints(choiceptr gc_B USES_REGS) sweep_environments(gc_B->cp_env, EnvSizeInCells, NULL PASS_REGS); - if (gc_B->cp_b != NULL) { - break; - } else - return; - case _trust_fail: + if (gc_B->cp_env == LCL0) { + return; + } else { + // This must be a border choicepoint, just move up + gc_B = (choiceptr)(gc_B->cp_env[E_B]); + continue; + } + case _trust_fail: break; case _or_else: case _or_last: diff --git a/C/utilpreds.c b/C/utilpreds.c index 2247f9344..153f8abbb 100644 --- a/C/utilpreds.c +++ b/C/utilpreds.c @@ -52,14 +52,13 @@ typedef struct non_single_struct_t { } #define def_aux_overflow() \ - aux_overflow:{ \ + while (to_visit_max-to_visit0 < 32) { \ size_t d1 = to_visit-to_visit0; \ - size_t d2 = to_visit_max-to_visit0; \ - to_visit0 = Realloc(to_visit0,(d2+128)*sizeof(struct non_single_struct_t)); \ + size_t d2 = to_visit_max-to_visit0; \ + size_t d3 = Yap_Min(d2+1024, d2 *2); \ + to_visit0 = Realloc(to_visit0,d3*sizeof(struct non_single_struct_t)); \ to_visit = to_visit0+d1; \ - to_visit_max = to_visit0+(d2+128); \ - pt0--; \ - goto restart; \ + to_visit_max = to_visit0+(d3); \ } #define def_global_overflow() \ From 984cf8a07c052ae84eb9c2749968399a62414ca4 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Thu, 25 Apr 2019 14:02:28 -0500 Subject: [PATCH 16/29] loaddb --- cmake/Sources.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/Sources.cmake b/cmake/Sources.cmake index 6bd9429d5..9e6e6e9fe 100644 --- a/cmake/Sources.cmake +++ b/cmake/Sources.cmake @@ -31,6 +31,7 @@ set (ENGINE_SOURCES C/corout.c C/cut_c.c C/dbase.c + C/dbload.c C/dlmalloc.c C/errors.c C/eval.c From 54a222e5df0f60ad2fb22c367f7e139376c2f6c3 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Sat, 27 Apr 2019 11:55:22 -0500 Subject: [PATCH 17/29] call fixes --- C/c_interface.c | 55 +++----- C/exec.c | 9 +- C/heapgc.c | 5 +- CXX/yapi.cpp | 63 ++++++++- H/Yap.h | 1 - include/YapDefs.h | 3 +- include/YapError.h | 3 +- packages/python/py2pl.c | 284 +++++++++++++++++++++----------------- packages/python/pybips.c | 8 +- packages/python/pypreds.c | 3 +- pl/undefined.yap | 2 +- 11 files changed, 251 insertions(+), 185 deletions(-) diff --git a/C/c_interface.c b/C/c_interface.c index a6e9d223a..9d4fac689 100755 --- a/C/c_interface.c +++ b/C/c_interface.c @@ -1,4 +1,4 @@ -/************************************************************************* * +/************************************************************************* * * YAP Prolog * * Yap Prolog was developed at NCCUP - Universidade do Porto * * * @@ -1749,7 +1749,7 @@ X_API bool YAP_EnterGoal(YAP_PredEntryPtr ape, CELL *ptr, YAP_dogoalinfo *dgi) { dgi->p = P; dgi->cp = CP; dgi->b0 = LCL0 - (CELL *)B; - dgi->CurSlot = LOCAL_CurSlot; + printf("%ld\n", dgi->CurSlot); // ensure our current ENV receives current P. Yap_PrepGoal(pe->ArityOfPE, nullptr, B PASS_REGS); @@ -1757,7 +1757,7 @@ X_API bool YAP_EnterGoal(YAP_PredEntryPtr ape, CELL *ptr, YAP_dogoalinfo *dgi) { // __android_log_print(ANDROID_LOG_INFO, "YAP ", "ap=%p %d %x %x args=%x,%x // slot=%d", pe, pe->CodeOfPred->opc, FAILCODE, Deref(ARG1), Deref(ARG2), // LOCAL_CurSlot); - dgi->b = LCL0 - (CELL *)B; + dgi->b_entry = LCL0 - (CELL *)B; dgi->h = HR - H0; dgi->tr = (CELL *)TR - LCL0; // fprintf(stderr,"PrepGoal: H=%d ENV=%p B=%d TR=%d P=%p CP=%p Slots=%d\n", @@ -1766,11 +1766,12 @@ X_API bool YAP_EnterGoal(YAP_PredEntryPtr ape, CELL *ptr, YAP_dogoalinfo *dgi) { // fprintf(stderr,"EnterGoal success=%d: H=%d ENV=%p B=%d TR=%d P=%p CP=%p // Slots=%d\n", out,HR-H0,LCL0-ENV,LCL0-(CELL*)B,(CELL*)TR-LCL0, P, CP, // LOCAL_CurSlot); - dgi->b = LCL0 - (CELL *)B; + dgi->b_exit = LCL0 - (CELL *)B; if (out) { dgi->EndSlot = LOCAL_CurSlot; Yap_StartSlots(); } else { + printf("%ld\n", dgi->CurSlot); LOCAL_CurSlot = dgi->CurSlot; // ignore any slots created within the called goal } @@ -1784,8 +1785,8 @@ X_API bool YAP_RetryGoal(YAP_dogoalinfo *dgi) { bool out; BACKUP_MACHINE_REGS(); - myB = (choiceptr)(LCL0 - dgi->b); - myB0 = (choiceptr)(LCL0 - dgi->b0); + myB = (choiceptr)(LCL0 - dgi->b_exit); + myB0 = (choiceptr)(LCL0 - dgi->b_entry); CP = myB->cp_cp; /* sanity check */ if (B >= myB0) { @@ -1804,8 +1805,9 @@ X_API bool YAP_RetryGoal(YAP_dogoalinfo *dgi) { out = Yap_exec_absmi(true, true ); if (out) { dgi->EndSlot = LOCAL_CurSlot; - dgi->b = LCL0 - (CELL *)B; + dgi->b_exit = LCL0 - (CELL *)B; } else { + printf("F %ld\n", dgi->CurSlot); LOCAL_CurSlot = dgi->CurSlot; // ignore any slots created within the called goal } @@ -1815,39 +1817,28 @@ X_API bool YAP_RetryGoal(YAP_dogoalinfo *dgi) { X_API bool YAP_LeaveGoal(bool successful, YAP_dogoalinfo *dgi) { CACHE_REGS - choiceptr myB, handler; // fprintf(stderr,"LeaveGoal success=%d: H=%d ENV=%p B=%ld myB=%ld TR=%d // P=%p CP=%p Slots=%d\n", // successful,HR-H0,LCL0-ENV,LCL0-(CELL*)B,dgi->b0,(CELL*)TR-LCL0, P, CP, // LOCAL_CurSlot); BACKUP_MACHINE_REGS(); - myB = (choiceptr)(LCL0 - dgi->b); - if (LOCAL_PrologMode & AsyncIntMode) { - Yap_signal(YAP_FAIL_SIGNAL); - } - handler = B; - while (handler && - LCL0 - LOCAL_CBorder > (CELL *)handler - //&& handler->cp_ap != NOCODE - && handler->cp_b != NULL && handler != myB) { - if (handler < myB) { - handler->cp_ap = TRUSTFAILCODE; - } - B = handler; - handler = handler->cp_b; if (successful) { + choiceptr nB = (choiceptr)(LCL0 - dgi->b_entry); + if (B <= nB) { + B = nB; + } Yap_TrimTrail(); - } else if (!(LOCAL_PrologMode & AsyncIntMode)) { - P = FAILCODE; - Yap_exec_absmi(true, YAP_EXEC_ABSMI); - } - } - if (LOCAL_PrologMode & AsyncIntMode) { + B = B->cp_b; + } else if (LOCAL_PrologMode & AsyncIntMode) { Yap_signal(YAP_FAIL_SIGNAL); } + B = (choiceptr)(LCL0 - dgi->b0); P = dgi->p; CP = dgi->cp; + LOCAL_CurSlot = + dgi->CurSlot; // ignore any slots created within the called goal + printf("L %ld\n", dgi->CurSlot); RECOVER_MACHINE_REGS(); // fprintf(stderr,"LeftGoal success=%d: H=%d ENV=%p B=%d TR=%d P=%p CP=%p // Slots=%d\n", successful,HR-H0,LCL0-ENV,LCL0-(CELL*)B,(CELL*)TR-LCL0, P, @@ -1942,7 +1933,7 @@ X_API CELL *YAP_HeapStoreOpaqueTerm(Term t) { X_API Int YAP_RunGoalOnce(Term t) { CACHE_REGS Term out; - yamop *old_CP = CP; + yamop *old_CP = CP, *old_P = P; Int oldPrologMode = LOCAL_PrologMode; yhandle_t CSlot; @@ -1989,10 +1980,10 @@ X_API Int YAP_RunGoalOnce(Term t) { ASP = B->cp_env; ENV = (CELL *)ASP[E_E]; B = (choiceptr)ASP[E_CB]; -#ifdef DEPTH_LIMITxs +#ifdef DEPTH_LIMIT DEPTH = ASP[E_DEPTH]; #endif - P = (yamop *)ASP[E_CP]; + P = old_P; CP = old_CP; LOCAL_AllowRestart = FALSE; RECOVER_MACHINE_REGS(); @@ -2078,7 +2069,7 @@ X_API void YAP_PruneGoal(YAP_dogoalinfo *gi) { CACHE_REGS BACKUP_B(); - choiceptr myB = (choiceptr)(LCL0 - gi->b); + choiceptr myB = (choiceptr)(LCL0 - gi->b_entry); while (B != myB) { /* make sure we prune C-choicepoints */ if (POP_CHOICE_POINT(B->cp_b)) { diff --git a/C/exec.c b/C/exec.c index f332fd307..f7f9e0cfb 100755 --- a/C/exec.c +++ b/C/exec.c @@ -804,11 +804,11 @@ static Int execute_in_mod(USES_REGS1) { /* '$execute'(Goal) */ static void prune_inner_computation(choiceptr parent) { /* code */ choiceptr cut_pt; - yamop *oP = P, *oCP = CP; - Int oENV = LCL0 - ENV; cut_pt = B; while (cut_pt && cut_pt->cp_b < parent) { + if (cut_pt->cp_ap == NOCODE) + break; cut_pt = cut_pt->cp_b; } if (!cut_pt) @@ -819,9 +819,6 @@ static void prune_inner_computation(choiceptr parent) { B = cut_pt; Yap_TrimTrail(); LOCAL_AllowRestart = FALSE; - P = oP; - CP = oCP; - ENV = LCL0 - oENV; B = parent; } @@ -1062,8 +1059,6 @@ static Int cleanup_on_exit(USES_REGS1) { complete_pt[0] = TermExit; } Yap_ignore(cleanup, false); - if (B0->cp_ap == NOCODE) - B0->cp_ap = TRUSTFAILCODE; if (Yap_RaiseException()) { return false; } diff --git a/C/heapgc.c b/C/heapgc.c index badd63c7e..d21aa90cf 100644 --- a/C/heapgc.c +++ b/C/heapgc.c @@ -1,4 +1,4 @@ -/************************************************************************** +/************************************************************************* * * * YAP Prolog * * * @@ -4191,7 +4191,7 @@ call_gc(UInt gc_lim, Int predarity, CELL *current_env, yamop *nextop USES_REGS) int gc_on = FALSE, gc_t = FALSE; if (Yap_GetValue(AtomGc) != TermNil) - gc_on = TRUE; + gc_on = false; if (IsIntegerTerm(Tgc_margin = Yap_GetValue(AtomGcMargin)) && gc_margin > 0) { gc_margin = (UInt)IntegerOfTerm(Tgc_margin); @@ -4343,3 +4343,4 @@ Yap_inc_mark_variable() CACHE_REGS LOCAL_total_marked++; } + diff --git a/CXX/yapi.cpp b/CXX/yapi.cpp index fe3a3789c..9d6cd3d14 100644 --- a/CXX/yapi.cpp +++ b/CXX/yapi.cpp @@ -411,6 +411,23 @@ std::vector YAPPairTerm::listToArray() { return o; } +std::vector YAPPairTerm::listToVector() { + Term *tailp; + Term t1 = gt(); + Int l = Yap_SkipList(&t1, &tailp); + if (l < 0) { + throw YAPError(SOURCE(), TYPE_ERROR_LIST, (t), nullptr); + } + std::vector o = *new std::vector(l); + int i = 0; + Term t = gt(); + while (t != TermNil) { + o[i++] = YAPTerm(HeadOfTerm(t)); + t = TailOfTerm(t); + } + return o; +} + YAP_tag_t YAPTerm::tag() { Term tt = gt(); if (IsVarTerm(tt)) { @@ -576,6 +593,8 @@ bool YAPEngine::call(YAPPredicate ap, YAPTerm ts[]) { // don't forget, on success these bindings will still be there); result = YAP_LeaveGoal(true, &q); + Int oenv = LCL0-ENV; + Int oB = LCL0-CellPtr(B); YAPCatchError(); Yap_CloseHandles(q.CurSlot); @@ -599,6 +618,8 @@ bool YAPEngine::mgoal(Term t, Term tmod, bool release) { q.CurSlot = Yap_StartSlots(); q.p = P; q.cp = CP; + Int oenv = LCL0-ENV; + Int oB = LCL0-CellPtr(B); Term omod = CurrentModule; PredEntry *ap = nullptr; if (IsStringTerm(tmod)) @@ -625,9 +646,10 @@ bool YAPEngine::mgoal(Term t, Term tmod, bool release) { //__android_log_print(ANDROID_LOG_INFO, "YAPDroid", "exec "); result = (bool)YAP_EnterGoal(ap, nullptr, &q); - // std::cerr << "mgoal " << YAPTerm(tmod).text() << ":" << YAPTerm(t).text() << "\n"; - + // std::cerr << "mgoal " << YAPTerm(tmod).text() << ":" << YAPTerm(t).text() << "\n YAP_LeaveGoal(result && !release, &q); + ENV = LCL0-oenv; + B = (choiceptr)(LCL0-oB); CurrentModule = LOCAL_SourceModule = omod; // PyEval_RestoreThread(_save); RECOVER_MACHINE_REGS(); @@ -652,7 +674,12 @@ Term YAPEngine::fun(Term t) { arity_t arity; Functor f; Atom name; + q.CurSlot = Yap_StartSlots(); + q.p = P; + q.cp = CP; + Int oenv = LCL0-ENV; + Int oB = LCL0-CellPtr(B); if (IsApplTerm(t)) { ts = RepAppl(t) + 1; f = (Functor)ts[-1]; @@ -684,9 +711,6 @@ Term YAPEngine::fun(Term t) { Term g = (Yap_MkApplTerm(f, arity, ts)); ap = rewriteUndefEngineQuery(ap, g, (ap->ModuleOfPred)); } - q.CurSlot = Yap_StartSlots(); - q.p = P; - q.cp = CP; // make sure this is safe // allow Prolog style exception handling //__android_log_print(ANDROID_LOG_INFO, "YAPDroid", "exec "); @@ -699,6 +723,8 @@ Term YAPEngine::fun(Term t) { YAPCatchError(); { YAP_LeaveGoal(result, &q); + ENV = LCL0-oenv; + B = (choiceptr)(LCL0-oB); // PyEval_RestoreThread(_save); RECOVER_MACHINE_REGS(); return ot; @@ -727,6 +753,27 @@ YAPQuery::YAPQuery(YAPFunctor f, YAPTerm mod, YAPTerm ts[]) RECOVER_MACHINE_REGS(); } +YAPQuery::YAPQuery(YAPFunctor f, YAPTerm mod, Term ts[]) + : YAPPredicate(f, mod) { + + /* ignore flags for now */ + BACKUP_MACHINE_REGS(); + Term goal; + + if (ts) { + size_t arity = f.arity(); + goal = Yap_MkApplTerm(Yap_MkFunctor(f.name().asAtom(),arity), arity, ts); + nts = RepAppl(goal) + 1; + for (arity_t i = 0; i < arity; i++) + XREGS[i + 1] = ts[i]; + } else { + goal = MkVarTerm(); + } + openQuery(); + names = YAPPairTerm(TermNil); + RECOVER_MACHINE_REGS(); +} + #if 0 YAPQuery::YAPQuery(YAPFunctor f, YAPTerm ts[]) : YAPPredicate(f) { /* ignore flags for now */ @@ -766,6 +813,9 @@ bool YAPQuery::next() { CACHE_REGS bool result = false; // std::cerr << "next " << YAPTerm(goal).text() << "\n"; + q_h.CurSlot = Yap_StartSlots(); + q_h.p = P; + q_h.cp = CP; sigjmp_buf buf, *oldp = LOCAL_RestartEnv; e = nullptr; @@ -827,7 +877,7 @@ bool YAPQuery::deterministic() { BACKUP_MACHINE_REGS(); if (!q_open || q_state == 0) return false; - choiceptr myB = (choiceptr)(LCL0 - q_h.b); + choiceptr myB = (choiceptr)(LCL0 - q_h.b_entry); return (B >= myB); RECOVER_MACHINE_REGS(); } @@ -1100,6 +1150,7 @@ void YAPEngine::reSet() { free(LOCAL_CommittedError); LOCAL_CommittedError = NULL; } + LOCAL_CurSlot = q.CurSlot; } Term YAPEngine::top_level(std::string s) { diff --git a/H/Yap.h b/H/Yap.h index e2764eb6f..412a394fc 100755 --- a/H/Yap.h +++ b/H/Yap.h @@ -91,7 +91,6 @@ typedef YAP_Term Term; #define CellSize sizeof(CELL) #define SmallSize sizeof(SMALLUNSGN) -typedef YAP_Int Int; typedef YAP_Float Float; typedef YAP_handle_t yhandle_t; diff --git a/include/YapDefs.h b/include/YapDefs.h index f1c27bcd0..0cc49c885 100755 --- a/include/YapDefs.h +++ b/include/YapDefs.h @@ -138,12 +138,13 @@ typedef enum { /* this should be opaque to the user */ typedef struct { - unsigned long b, b0; //> choice-point at entry + unsigned long b0, b_entry, b_exit; //> choice-point at entry YAP_handle_t CurSlot; //> variables at entry YAP_handle_t EndSlot; //> variables at successful execution struct yami *p; //> Program Counter at entry struct yami *cp; //> Continuation PC at entry int lvl; + long env; unsigned long tr, h; } YAP_dogoalinfo; diff --git a/include/YapError.h b/include/YapError.h index b5d4d3135..65981351c 100644 --- a/include/YapError.h +++ b/include/YapError.h @@ -73,7 +73,8 @@ Yap_Error__(false, __FILE__, __FUNCTION__, __LINE__, id, TermNil, __VA_ARGS__) { if ( (TF = Yap_ensure_atom__(__FILE__, __FUNCTION__, __LINE__, T0 ) == 0L ) return false; \ } -INLINE_ONLY Term Yap_ensure_atom__(const char *fu, const char *fi, int line, +//INLINE_ONLY + static Term Yap_ensure_atom__(const char *fu, const char *fi, int line, Term in) { Term t = Deref(in); // Term Context = Deref(ARG2); diff --git a/packages/python/py2pl.c b/packages/python/py2pl.c index da5a44476..1d24f893a 100644 --- a/packages/python/py2pl.c +++ b/packages/python/py2pl.c @@ -76,15 +76,15 @@ static Term python_to_term__(PyObject *pVal) { t[1] = MkFloatTerm(PyComplex_ImagAsDouble(pVal)); return Yap_MkApplTerm(FunctorI, 2, t); -} -else if (PyUnicode_Check(pVal)) { + } + else if (PyUnicode_Check(pVal)) { #if PY_MAJOR_VERSION < 3 - size_t sz = PyUnicode_GetSize(pVal) + 1; - wchar_t *s = malloc(sizeof(wchar_t) * sz); - sz = PyUnicode_AsWideChar((PyUnicodeObject *)pVal, a, sz - 1); - free(ptr); + size_t sz = PyUnicode_GetSize(pVal) + 1; + wchar_t *s = malloc(sizeof(wchar_t) * sz); + sz = PyUnicode_AsWideChar((PyUnicodeObject *)pVal, a, sz - 1); + free(ptr); #else - const char *s = PyUnicode_AsUTF8(pVal); + const char *s = PyUnicode_AsUTF8(pVal); #endif #if 0 if (false && Yap_AtomInUse(s)) @@ -92,72 +92,72 @@ else if (PyUnicode_Check(pVal)) { else #endif if (pyStringToString) - return MkStringTerm(s); + return MkStringTerm(s); else return MkAtomTerm(Yap_LookupAtom(s)); -} -else if (PyByteArray_Check(pVal)) { - return MkStringTerm(PyByteArray_AsString(pVal)); + } + else if (PyByteArray_Check(pVal)) { + return MkStringTerm(PyByteArray_AsString(pVal)); #if PY_MAJOR_VERSION < 3 -} -else if (PyString_Check(pVal)) { - return MkStringTerm(PyString_AsString(pVal)); + } + else if (PyString_Check(pVal)) { + return MkStringTerm(PyString_AsString(pVal)); #endif -} -else if (PyTuple_Check(pVal)) { - Py_ssize_t sz = PyTuple_Size(pVal); - const char *s; - s = Py_TYPE(pVal)->tp_name; - if (s == NULL) - s = "t"; - if (sz == 0) { + } + else if (PyTuple_Check(pVal)) { + Py_ssize_t sz = PyTuple_Size(pVal); + const char *s; + s = Py_TYPE(pVal)->tp_name; + if (s == NULL) + s = "t"; + if (sz == 0) { return MkAtomTerm(YAP_LookupAtom(Py_TYPE(pVal)->tp_name)); -} -else { - Functor f = Yap_MkFunctor(Yap_LookupAtom(s), sz); - Term t = Yap_MkNewApplTerm(f, sz); - long i; - CELL *ptr = RepAppl(t) + 1; - for (i = 0; i < sz; i++) { - PyObject *p = PyTuple_GetItem(pVal, i); - if (p == NULL) { - PyErr_Clear(); - return false; } - *ptr++ = python_to_term__(p); + else { + Functor f = Yap_MkFunctor(Yap_LookupAtom(s), sz); + Term t = Yap_MkNewApplTerm(f, sz); + long i; + CELL *ptr = RepAppl(t) + 1; + for (i = 0; i < sz; i++) { + PyObject *p = PyTuple_GetItem(pVal, i); + if (p == NULL) { + PyErr_Clear(); + return false; + } + *ptr++ = python_to_term__(p); + } + return t; + } + // PL_reset_term_refs(to); + // fputs(" ||*** ",stderr); Yap_DebugPlWrite(YAP_GetFromSlot(t)); fputs(" + // ||***\n",stderr); } - return t; -} -// PL_reset_term_refs(to); -// fputs(" ||*** ",stderr); Yap_DebugPlWrite(YAP_GetFromSlot(t)); fputs(" -// ||***\n",stderr); -} -else if (PyList_Check(pVal)) { - Py_ssize_t i, sz = PyList_GET_SIZE(pVal); - if (sz == 0) - return repr_term(pVal); - Term t = TermNil; - for (i = sz; i > 0; ) { - -- i; - PyObject *p = PyList_GetItem(pVal, i); - if (p == NULL) { - PyErr_Clear(); - return false; - } - if (!python_to_term__(p)) - return false; + else if (PyList_Check(pVal)) { + Py_ssize_t i, sz = PyList_GET_SIZE(pVal); + if (sz == 0) + return repr_term(pVal); + Term t = TermNil; + for (i = sz; i > 0; ) { + -- i; + PyObject *p = PyList_GetItem(pVal, i); + if (p == NULL) { + PyErr_Clear(); + return false; + } + if (!python_to_term__(p)) + return false; - t = MkPairTerm(python_to_term__(p), t); + t = MkPairTerm(python_to_term__(p), t); + } + return t; } - return t; -} -else if (PyDict_Check(pVal)) { - Py_ssize_t pos = 0, tot = PyDict_Size(pVal); - PyObject *key, *value; - Term f, *opt = &f, t, to; - if (tot == 0) - return MkAtomTerm( Yap_LookupAtom("{}")); - while (PyDict_Next(pVal, &pos, &key, &value)) { + else if (PyDict_Check(pVal)) { + Py_ssize_t pos = 0, tot = PyDict_Size(pVal); + PyObject *key, *value; + Term f, *opt = &f, t, to; + if (tot == 0) + return MkAtomTerm( Yap_LookupAtom("{}")); + while (PyDict_Next(pVal, &pos, &key, &value)) { Term t0[2]; t0[0] = python_to_term__(key); t0[1] = python_to_term__(value); @@ -169,9 +169,9 @@ else if (PyDict_Check(pVal)) { *opt = t; opt = pt+1; } else { - if (pos == 0) { - return repr_term(pVal); - } + if (pos == 0) { + return repr_term(pVal); + } *opt = to; break; @@ -179,7 +179,7 @@ else if (PyDict_Check(pVal)) { } return Yap_MkApplTerm(FunctorBraces, 1, &f); } - return repr_term(pVal); + return repr_term(pVal); } @@ -197,11 +197,13 @@ X_API YAP_Term pythonToYAP(PyObject *pVal) { /* fputs("***>>\n", stderr); */ if (pVal == NULL) Yap_ThrowError(SYSTEM_ERROR_INTERNAL, 0, NULL); + yhandle_t h0 = Yap_CurrentHandle(); Term t = python_to_term__(pVal); /* fputs("<< *** ", stderr); */ /* Yap_DebugPlWrite(t); */ /* fputs(" ***\n", stderr); */ // Py_DECREF(pVal); + Yap_CloseHandles(h0); return t; } @@ -225,13 +227,19 @@ PyObject *py_Local, *py_Global; *python_assign. */ bool python_assign(term_t t, PyObject *exp, PyObject *context) { - PyErr_Print(); + bool rc = true; + PyErr_Print(); + term_t inp = Yap_CurrentHandle(); + Yap_DebugPlWriteln(YAP_GetFromSlot(t)); context = find_obj(context, t, false); // Yap_DebugPlWriteln(yt); switch (PL_term_type(t)) { case PL_VARIABLE: { if (context == NULL) // prevent a.V= N*N[N-1] - return python_to_term(exp, t); + PL_reset_term_refs(inp); + + rc = python_to_term(exp, t); + break; } case PL_STRING: { @@ -240,24 +248,34 @@ bool python_assign(term_t t, PyObject *exp, PyObject *context) { PL_get_string_chars(t, &s,&l); if (!context) context = py_Main; - if (PyObject_SetAttrString(context, s, exp) == 0) - return true; - PyErr_Print(); - return false; + if (PyObject_SetAttrString(context, s, exp) == 0) { + PL_reset_term_refs(inp); + ; + rc = true; + } else { + PyErr_Print(); + PL_reset_term_refs(inp); + rc = false; + } + break; } case PL_ATOM: { char *s = NULL; PL_get_atom_chars(t, &s); if (!context) context = py_Main; - if (PyObject_SetAttrString(context, s, exp) == 0) - return true; - return false; + if (PyObject_SetAttrString(context, s, exp) == 0){ + rc = true; + } else { + rc = false; + } + break; } case PL_INTEGER: case PL_FLOAT: // domain or type erro? - return false; + rc = false; + break; default: { term_t tail = PL_new_term_ref(), arg = PL_new_term_ref(); size_t len, i; @@ -271,90 +289,98 @@ bool python_assign(term_t t, PyObject *exp, PyObject *context) { for (i = 0; i < len; i++) { PyObject *p; if (!PL_get_list(t, arg, t)) { - PL_reset_term_refs(tail); p = Py_None; - } - if ((p = PySequence_GetItem(exp, i)) == NULL) - p = Py_None; - if (!python_assign(arg, p, context)) { - PL_reset_term_refs(tail); + rc = false; + } else { + if ((p = PySequence_GetItem(exp, i)) == NULL) + p = Py_None; + rc = rc && python_assign(arg, p, context); } } + } else { + while(PL_is_pair(t)) { + context = find_obj(context, t, false); + } + rc = python_assign(t, exp, context); } + } else { functor_t fun; if (!PL_get_functor(t, &fun)) { - PL_reset_term_refs(tail); - return false; + rc = false; } if (fun == FUNCTOR_sqbrackets2) { // tail is the object o if (!PL_get_arg(2, t, tail)) { - PL_reset_term_refs(tail); - return false; - } - PyObject *o = term_to_python(tail, true, context, false); - // t now refers to the index - if (!PL_get_arg(1, t, t) || !PL_get_list(t, t, tail) || - !PL_get_nil(tail)) { - PL_reset_term_refs(tail); - return false; - } - PyObject *i = term_to_python(t, true, NULL, false); - // check numeric - if (PySequence_Check(o) && PyLong_Check(i)) { - long int j; - j = PyLong_AsLong(i); - return PySequence_SetItem(o, j, exp) == 0; - } + rc = false; + } else { + PyObject *o = term_to_python(tail, true, context, false); + // t now refers to the index + if (!PL_get_arg(1, t, t) || !PL_get_list(t, t, tail) || + !PL_get_nil(tail)) { + PL_reset_term_refs(i); + ; + rc = false; + } else { + PyObject *i = term_to_python(t, true, NULL, false); + // check numeric + if (PySequence_Check(o) && PyLong_Check(i)) { + long int j; + j = PyLong_AsLong(i); + rc = PySequence_SetItem(o, j, exp) == 0; + } #if PY_MAJOR_VERSION < 3 - if (PySequence_Check(o) && PyInt_Check(i)) { - long int j; - j = PyInt_AsLong(i); - return PySequence_SetItem(o, i, exp) == 0; - } + if (PySequence_Check(o) && PyInt_Check(i)) { + long int j; + j = PyInt_AsLong(i); + szzb rc = PySequence_SetItem(o, i, exp) == 0; + } else #endif - if (PyDict_Check(o)) { - if (PyDict_SetItem(o, i, exp) == 0) { - return true; - } - } - if (PyObject_SetAttr(o, i, exp) == 0) { - return true; - } + if (PyDict_Check(o)) { + if (PyDict_SetItem(o, i, exp) == 0) { + PL_reset_term_refs(inp); + ; + rc = true; + } + } + if (PyObject_SetAttr(o, i, exp) == 0) { + PL_reset_term_refs(inp); + ; + rc = true; + } + } + } } else { + atom_t s; int n, i; PL_get_name_arity(t, &s, &n); PyObject *o = term_to_python(t, true, context, true); - PyErr_Print(); + PyErr_Print(); if (PySequence_Check(o) && PySequence_Length(o) == n) { for (i = 1; i <= n; i++) { PyObject *p; if (!PL_get_arg(i, t, arg)) { - PL_reset_term_refs(tail); - o = false; + o = NULL; p = Py_None; } if ((p = PySequence_GetItem(exp, i - 1)) == NULL) p = Py_None; - else if (!python_assign(arg, p, NULL)) { - PL_reset_term_refs(tail); - o = NULL; - } else { - PyErr_Print(); - } + rc = python_assign(arg, p, NULL); + } - return true; } } } - PL_reset_term_refs(tail); } - PyErr_Print(); - return NULL; } + + PyErr_Print(); + PL_reset_term_refs(inp); + + + return rc; } diff --git a/packages/python/pybips.c b/packages/python/pybips.c index 18a26bea8..117877d30 100644 --- a/packages/python/pybips.c +++ b/packages/python/pybips.c @@ -112,12 +112,12 @@ find_obj(PyObject *ob, term_t l, bool eval) { YAP_Term hd, yt; py_Context = NULL; - yt = YAP_GetFromSlot(l); // Yap_DebugPlWriteln(yt); - while (YAP_IsPairTerm(yt)) { + if (l == 0) + return Py_None; + while (YAP_IsPairTerm((yt = YAP_GetFromSlot(l)))) { hd = YAP_HeadOfTerm(yt); - yt = YAP_TailOfTerm(yt); - YAP_PutInSlot(l, yt); + Yap_PutInHandle(l, YAP_TailOfTerm(yt)); ob = yap_to_python(hd, true, ob, false); if (!ob) { return Py_None; diff --git a/packages/python/pypreds.c b/packages/python/pypreds.c index 4c5cfc381..58ae72865 100644 --- a/packages/python/pypreds.c +++ b/packages/python/pypreds.c @@ -113,7 +113,6 @@ static foreign_t python_is(term_t tobj, term_t tf) { static foreign_t python_proc(term_t tobj) { PyObject *o; - term_t lim = python_acquire_GIL(); o = term_to_python(tobj, true, NULL, true); @@ -237,6 +236,7 @@ static foreign_t python_apply(term_t tin, term_t targs, term_t keywds, } static foreign_t assign_python(term_t exp, term_t name) { + printf("A %ld\n", LOCAL_CurSlot); term_t stackp = python_acquire_GIL(); PyObject *e = term_to_python(exp, true, NULL, true); @@ -245,6 +245,7 @@ static foreign_t assign_python(term_t exp, term_t name) { pyErrorAndReturn(false); } bool b = python_assign(name, e, NULL); + printf("B %ld\n", LOCAL_CurSlot); python_release_GIL(stackp); pyErrorAndReturn(b); } diff --git a/pl/undefined.yap b/pl/undefined.yap index ff751dc69..193b3a613 100644 --- a/pl/undefined.yap +++ b/pl/undefined.yap @@ -133,7 +133,7 @@ undefined_query(G0, M0, Cut) :- % we found an import, and call again % we have user code in the unknown_predicate % we fail, output a message, and just generate an exception. -'$undefp'([M0|G0],ok) :- +'$undefp'([M0|G0],_) :- '$search_undef'(M0:G0, M:G), '$trace'(M:G). From 7c16af4edfe39e48dabd84e09c14c2184cff8d85 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Wed, 1 May 2019 01:34:58 +0100 Subject: [PATCH 18/29] -Interface issues --- C/c_interface.c | 33 +++++++++-- C/globals.c | 83 ++++++++++++++-------------- C/grow.c | 113 +++++++++++++++++--------------------- C/index.c | 2 +- CXX/yapi.cpp | 19 ++++--- CXX/yapq.hh | 8 +-- cmake/Config.cmake | 1 + config.h.cmake | 5 ++ include/YapDefs.h | 2 +- os/sysbits.c | 14 +++++ os/writeterm.c | 1 + packages/python/pl2pl.c | 11 ++-- packages/python/py2pl.c | 3 - packages/python/py4yap.h | 21 ++++--- packages/python/pypreds.c | 53 +++++++++--------- 15 files changed, 201 insertions(+), 168 deletions(-) diff --git a/C/c_interface.c b/C/c_interface.c index 9d4fac689..bd0496267 100755 --- a/C/c_interface.c +++ b/C/c_interface.c @@ -1142,6 +1142,8 @@ X_API Int YAP_Execute(PredEntry *pe, CPredicate exec_code) { // if (pe->PredFlags & CArgsPredFlag) { // CurrentModule = pe->ModuleOfPred; //} + int lvl = push_text_stack(); + yhandle_t hdl = Yap_CurrentHandle(); if (pe->PredFlags & SWIEnvPredFlag) { CPredicateV codev = (CPredicateV)exec_code; struct foreign_context ctx; @@ -1161,12 +1163,15 @@ X_API Int YAP_Execute(PredEntry *pe, CPredicate exec_code) { // check for junk: open frames, etc */ if (ret) complete_exit(((choiceptr)(LCL0 - OASP)), FALSE, FALSE PASS_REGS); - else + else { complete_fail(((choiceptr)(LCL0 - OASP)), FALSE PASS_REGS); + } // CurrentModule = omod; if (!ret) { Yap_RaiseException(); } + Yap_RecoverHandles(0, hdl); + pop_text_stack( lvl ); return ret; } @@ -1739,17 +1744,18 @@ X_API bool YAP_EnterGoal(YAP_PredEntryPtr ape, CELL *ptr, YAP_dogoalinfo *dgi) { CACHE_REGS PredEntry *pe = ape; bool out; - // fprintf(stderr,"EnterGoal: H=%d ENV=%p B=%d TR=%d P=%p CP=%p + // fprintf(stderr,"1EnterGoal: H=%d ENV=%p B=%d TR=%d P=%p CP=%p // Slots=%d\n",HR-H0,LCL0-ENV,LCL0-(CELL*)B,(CELL*)TR-LCL0, P, CP, // LOCAL_CurSlot); BACKUP_MACHINE_REGS(); + dgi->lvl = push_text_stack(); LOCAL_ActiveError->errorNo = YAP_NO_ERROR; LOCAL_PrologMode = UserMode; dgi->p = P; dgi->cp = CP; dgi->b0 = LCL0 - (CELL *)B; - printf("%ld\n", dgi->CurSlot); + dgi->env0 = LCL0 - ENV; // ensure our current ENV receives current P. Yap_PrepGoal(pe->ArityOfPE, nullptr, B PASS_REGS); @@ -1771,10 +1777,10 @@ X_API bool YAP_EnterGoal(YAP_PredEntryPtr ape, CELL *ptr, YAP_dogoalinfo *dgi) { dgi->EndSlot = LOCAL_CurSlot; Yap_StartSlots(); } else { - printf("%ld\n", dgi->CurSlot); LOCAL_CurSlot = dgi->CurSlot; // ignore any slots created within the called goal } + pop_text_stack(dgi->lvl); RECOVER_MACHINE_REGS(); return out; } @@ -1785,6 +1791,7 @@ X_API bool YAP_RetryGoal(YAP_dogoalinfo *dgi) { bool out; BACKUP_MACHINE_REGS(); + dgi->lvl = push_text_stack(); myB = (choiceptr)(LCL0 - dgi->b_exit); myB0 = (choiceptr)(LCL0 - dgi->b_entry); CP = myB->cp_cp; @@ -1811,6 +1818,7 @@ X_API bool YAP_RetryGoal(YAP_dogoalinfo *dgi) { LOCAL_CurSlot = dgi->CurSlot; // ignore any slots created within the called goal } + pop_text_stack(dgi->lvl); RECOVER_MACHINE_REGS(); return out; } @@ -1823,6 +1831,8 @@ X_API bool YAP_LeaveGoal(bool successful, YAP_dogoalinfo *dgi) { // successful,HR-H0,LCL0-ENV,LCL0-(CELL*)B,dgi->b0,(CELL*)TR-LCL0, P, CP, // LOCAL_CurSlot); BACKUP_MACHINE_REGS(); + + dgi->lvl = push_text_stack(); if (successful) { choiceptr nB = (choiceptr)(LCL0 - dgi->b_entry); if (B <= nB) { @@ -1834,13 +1844,17 @@ X_API bool YAP_LeaveGoal(bool successful, YAP_dogoalinfo *dgi) { Yap_signal(YAP_FAIL_SIGNAL); } B = (choiceptr)(LCL0 - dgi->b0); +#ifdef DEPTH_LIMIT + DEPTH = B->cp_depth; +#endif P = dgi->p; CP = dgi->cp; + YENV = ENV = LCL0-dgi->env0; LOCAL_CurSlot = dgi->CurSlot; // ignore any slots created within the called goal - printf("L %ld\n", dgi->CurSlot); + pop_text_stack(dgi->lvl); RECOVER_MACHINE_REGS(); - // fprintf(stderr,"LeftGoal success=%d: H=%d ENV=%p B=%d TR=%d P=%p CP=%p + // fprintf(stderr," LeftGoal success=%d: H=%d ENV=%p B=%d TR=%d P=%p CP=%p // Slots=%d\n", successful,HR-H0,LCL0-ENV,LCL0-(CELL*)B,(CELL*)TR-LCL0, P, // CP, LOCAL_CurSlot); return TRUE; @@ -1852,6 +1866,8 @@ X_API Int YAP_RunGoal(Term t) { yhandle_t cslot = LOCAL_CurSlot; BACKUP_MACHINE_REGS(); +int lvl = push_text_stack(); + LOCAL_AllowRestart = FALSE; LOCAL_PrologMode = UserMode; out = Yap_RunTopGoal(t, true); @@ -1860,6 +1876,7 @@ X_API Int YAP_RunGoal(Term t) { // We'll pass it through RECOVER_MACHINE_REGS(); LOCAL_CurSlot = cslot; + pop_text_stack(lvl); return out; } @@ -1938,6 +1955,7 @@ X_API Int YAP_RunGoalOnce(Term t) { yhandle_t CSlot; BACKUP_MACHINE_REGS(); + int lvl = push_text_stack(); CSlot = Yap_StartSlots(); LOCAL_PrologMode = UserMode; // Yap_heap_regs->yap_do_low_level_trace=true; @@ -1946,6 +1964,7 @@ X_API Int YAP_RunGoalOnce(Term t) { // Yap_CloseSlots(CSlot); if (!(oldPrologMode & UserCCallMode)) { /* called from top-level */ + pop_text_stack( lvl); LOCAL_AllowRestart = FALSE; RECOVER_MACHINE_REGS(); return out; @@ -1987,6 +2006,7 @@ X_API Int YAP_RunGoalOnce(Term t) { CP = old_CP; LOCAL_AllowRestart = FALSE; RECOVER_MACHINE_REGS(); + pop_text_stack( lvl); return out; } @@ -2262,6 +2282,7 @@ X_API char *YAP_WriteBuffer(Term t, char *buf, size_t sze, int flags) { } else { RECOVER_MACHINE_REGS(); if (buf == out.val.c) { + pop_text_stack(l); return buf; } else { if ( strlen(out.val.c ) < sze) { diff --git a/C/globals.c b/C/globals.c index 77e0d4868..cac4e43be 100644 --- a/C/globals.c +++ b/C/globals.c @@ -78,7 +78,7 @@ assert/1 or recorda/3. + The value lives on the Prolog (global) stack. This implies that lookup time is independent from the size of the term. This is particulary interesting for large data structures -such as parsed XML documents or the CHR global constraint +qqqsuch as parsed XML documents or the CHR global constraint store. They support both global assignment using nb_setval/2 and @@ -191,13 +191,14 @@ static Term NewArena(UInt size, int wid, UInt arity, CELL *where) { UInt new_size; WORKER_REGS(wid) - if (where == NULL || where == HR) { + // make sure we have enough room while (HR + size > ASP - 1024) { if (!Yap_gcl(size * sizeof(CELL), arity, ENV, P)) { Yap_Error(RESOURCE_ERROR_STACK, TermNil, LOCAL_ErrorMessage); return TermNil; } } + if (where == NULL || where == HR) { t = CreateNewArena(HR, size); HR += size; } else { @@ -241,8 +242,9 @@ static void adjust_cps(UInt size USES_REGS) { } } -static int GrowArena(Term arena, CELL *pt, size_t old_size, size_t size, +static Term GrowArena(Term arena, CELL *pt, size_t old_size, size_t size, UInt arity USES_REGS) { + size_t sz; LOCAL_ArenaOverflows++; if (size == 0) { if (old_size < 128 * 1024) { @@ -254,56 +256,49 @@ static int GrowArena(Term arena, CELL *pt, size_t old_size, size_t size, if (size < 4096) { size = 4096; } - if (pt == HR) { - if (HR + size > ASP - 1024) { + while (HR + size > ASP - 1024) { XREGS[arity + 1] = arena; if (!Yap_gcl(size * sizeof(CELL), arity + 1, ENV, gc_P(P, CP))) { Yap_Error(RESOURCE_ERROR_STACK, TermNil, LOCAL_ErrorMessage); - return FALSE; + return false; } arena = XREGS[arity + 1]; - /* we don't know if the GC added junk on top of the global */ - pt = ArenaLimit(arena); - return GrowArena(arena, pt, old_size, size, arity PASS_REGS); - } adjust_cps(size PASS_REGS); - HR += size; - } else { - XREGS[arity + 1] = arena; - /* try to recover some room */ - Yap_gcl(size * sizeof(CELL), arity + 1, ENV, gc_P(P, CP)); - arena = XREGS[arity + 1]; - pt = ArenaLimit(arena); - if ((size = Yap_InsertInGlobal(pt, size * sizeof(CELL))) == 0) { - return FALSE; + pt = ArenaLimit(arena)+1; + + if (pt == HR) { + sz = old_size + size; + HR += size; + HR[ - 1] = EndSpecials; + } else { + if ((sz = Yap_InsertInGlobal(pt, sz * sizeof(CELL))) == 0) { + return FALSE; + } + pt[sz-1] = EndSpecials; } - size = size / sizeof(CELL); arena = XREGS[arity + 1]; + MP_INT *dst = (MP_INT *)(RepAppl(arena) + 2); + dst->_mp_alloc+= size/sizeof(CELL); + return sz; } - CreateNewArena(ArenaPt(arena), size + old_size); - return TRUE; } CELL *Yap_GetFromArena(Term *arenap, UInt cells, UInt arity) { CACHE_REGS -restart : { Term arena = *arenap; CELL *max = ArenaLimit(arena); CELL *base = ArenaPt(arena); CELL *newH; UInt old_sz = ArenaSz(arena), new_size; - + while(true) { if (IN_BETWEEN(base, HR, max)) { base = HR; HR += cells; return base; } - if (base + cells > max - 1024) { - if (!GrowArena(arena, max, old_sz, old_sz + sizeof(CELL) * 1024, - arity PASS_REGS)) - return NULL; - goto restart; + if (base + cells > ASP - 1024) { + continue; } newH = base + cells; @@ -474,7 +469,9 @@ loop: HR += ap2[1] + 3; break; default: { - /* big int */ + + + /* big int */ UInt sz = (sizeof(MP_INT) + 3 * CellSize + ((MP_INT *)(ap2 + 2))->_mp_alloc * sizeof(mp_limb_t)) / CellSize, @@ -482,7 +479,7 @@ loop: if (HR > ASP - (MIN_ARENA_SIZE + sz)) { goto overflow; - } + } *ptf++ = AbsAppl(HR); HR[0] = (CELL)f; for (i = 1; i < sz; i++) { @@ -494,6 +491,7 @@ loop: continue; } *ptf = AbsAppl(HR); + ptf++; /* store the terms to visit */ #ifdef RATIONAL_TREES @@ -797,7 +795,7 @@ error_handler: case -1: if (arena == LOCAL_GlobalArena) LOCAL_GlobalArenaOverflows++; - if (!GrowArena(arena, old_top, old_size, min_grow, arity + 3 PASS_REGS)) { + if ((arena=GrowArena(arena, old_top, old_size, min_grow, arity + 3 PASS_REGS))==0) { Yap_Error(RESOURCE_ERROR_STACK, TermNil, LOCAL_ErrorMessage); return 0L; } @@ -848,8 +846,8 @@ restart: HB = oldHB; if (arena == LOCAL_GlobalArena) LOCAL_GlobalArenaOverflows++; - if (!GrowArena(arena, old_top, old_size, Nar * sizeof(CELL), - arity + 2 PASS_REGS)) { + if ((arena=GrowArena(arena, old_top, old_size, Nar * sizeof(CELL), + arity + 2 PASS_REGS))==0) { Yap_Error(RESOURCE_ERROR_STACK, TermNil, "while creating large global term"); return 0L; @@ -1549,8 +1547,8 @@ static Int nb_queue(UInt arena_sz USES_REGS) { queue = Yap_MkApplTerm(FunctorNBQueue, QUEUE_FUNCTOR_ARITY, ar); if (!Yap_unify(queue, ARG1)) return FALSE; - if (arena_sz < 4 * 1024) - arena_sz = 4 * 1024; + if (arena_sz < 32 * 1024) + arena_sz = 32 * 1024; queue_arena = NewArena(arena_sz, worker_id, 1, NULL); if (queue_arena == 0L) { return FALSE; @@ -1694,8 +1692,8 @@ static Int p_nb_queue_enqueue(USES_REGS1) { } ARG3 = to; /* fprintf(stderr,"growing %ld cells\n",(unsigned long int)gsiz);*/ - if (!GrowArena(arena, ArenaLimit(arena), old_sz, gsiz, 3 PASS_REGS)) { - Yap_Error(RESOURCE_ERROR_STACK, arena, LOCAL_ErrorMessage); + if ((arena=GrowArena(arena, ArenaLimit(arena), old_sz, gsiz, 3 PASS_REGS))==0) { + Yap_Error(RESOURCE_ERROR_STACK, arena, LOCAL_ErrorMessage); return 0L; } to = ARG3; @@ -2025,7 +2023,7 @@ restart: gsiz = 1024; } ARG3 = to; - if (!GrowArena(arena, ArenaLimit(arena), old_sz, gsiz, 3 PASS_REGS)) { + if ((arena=GrowArena(arena, ArenaLimit(arena), old_sz, gsiz, 3 PASS_REGS))==0) { Yap_Error(RESOURCE_ERROR_STACK, arena, LOCAL_ErrorMessage); return 0L; } @@ -2341,7 +2339,7 @@ static Term DelBeamMin(CELL *pt, CELL *pt2, UInt sz) { static Int p_nb_beam_add_to_beam(USES_REGS1) { CELL *qd = GetHeap(ARG1, "add_to_beam"), *oldH, *oldHB, *pt; UInt hsize, hmsize, old_sz; - Term arena, to, key; + Term arena, to, qsize, key; UInt mingrow; if (!qd) @@ -2377,9 +2375,9 @@ static Int p_nb_beam_add_to_beam(USES_REGS1) { oldHB = HB; HR = HB = ArenaPt(arena); old_sz = ArenaSz(arena); + qsize = IntegerOfTerm(qd[QUEUE_SIZE]); while (old_sz < MIN_ARENA_SIZE) { - UInt gsiz = hsize * 2; - + UInt gsiz = HR - RepPair(qd[QUEUE_HEAD]); HR = oldH; HB = oldHB; if (gsiz > 1024 * 1024) { @@ -2388,6 +2386,7 @@ static Int p_nb_beam_add_to_beam(USES_REGS1) { gsiz = 1024; } ARG3 = to; + /* fprintf(stderr,"growing %ld cells\n",(unsigned long int)gsiz);*/ if (!GrowArena(arena, ArenaLimit(arena), old_sz, gsiz, 3 PASS_REGS)) { Yap_Error(RESOURCE_ERROR_STACK, arena, LOCAL_ErrorMessage); return 0L; diff --git a/C/grow.c b/C/grow.c index e80ee26f1..c41eb58d9 100755 --- a/C/grow.c +++ b/C/grow.c @@ -324,15 +324,15 @@ MoveGlobalWithHole( USES_REGS1 ) } static void -MoveHalfGlobal(CELL *OldPt USES_REGS) +MoveHalfGlobal(CELL *OldPt, size_t request USES_REGS) { /* * cpcellsd(To,From,NOfCells) - copy the cells downwards - in * absmi.asm */ UInt diff = LOCAL_OldH-OldPt; - CELL *NewPt = (CELL *)((char*)OldPt+LOCAL_GDiff); CELL *IntPt = (CELL *)((char*)OldPt+LOCAL_GDiff0); + CELL *NewPt = IntPt+request/sizeof(CELL); cpcellsd(NewPt, IntPt, diff); } @@ -393,7 +393,7 @@ AdjustTrail(bool adjusting_heap, bool thread_copying USES_REGS) register CELL reg = TrailTerm(ptt-1); #ifdef FROZEN_STACKS register CELL reg2 = TrailVal(ptt-1); -#endif + #endif ptt--; if (IsVarTerm(reg)) { @@ -436,6 +436,8 @@ fixPointerCells(CELL *pt, CELL *pt_bot, bool thread_copying USES_REGS) { while (pt > pt_bot) { CELL reg = *--pt; + // if (pt-pt_bot> 4300 && pt-pt_bot < 4500) + // printf("%d %d %lx\n", pt-pt_bot, pt-LOCAL_GSplit, reg); if (IsVarTerm(reg)) { if (IsOldLocal(reg)) *pt = LocalAdjust(reg); @@ -450,6 +452,8 @@ fixPointerCells(CELL *pt, CELL *pt_bot, bool thread_copying USES_REGS) } else if (IsPairTerm(reg)) { *pt = AdjustPair(reg PASS_REGS); } + // if (pt-pt_bot> 4300 && pt-pt_bot < 4500) + // printf("%lx\n", *pt); } } @@ -889,12 +893,14 @@ static_growglobal(size_t request, CELL **ptr, CELL *hsplit USES_REGS) char *omax = (char *)H0; ADDR old_GlobalBase = LOCAL_GlobalBase; UInt minimal_request = 0L; - Int size = request; + Int size = request/sizeof(CELL); char vb_msg1 = '\0', *vb_msg2; bool do_grow = true; - bool insert_in_delays = false; + + printf("request=%ld at %p, shift %p, %ld <-> %ld\n",request, hsplit, ptr,hsplit-H0,HR-hsplit); + /* - request is the amount of memory we requested, in bytes; + request is the amount of memory we requesd, in bytes; base_move is the shift in global stacks we had to do size is how much space we allocate: it's negative if we just expand the delay stack. @@ -902,55 +908,44 @@ static_growglobal(size_t request, CELL **ptr, CELL *hsplit USES_REGS) */ if (hsplit) { - /* just a little bit of sanity checking */ - if (hsplit < H0 && hsplit > (CELL *)LOCAL_GlobalBase) { - insert_in_delays = TRUE; - /* expanding attributed variables */ - if (omax - size > LOCAL_GlobalBase+4096*sizeof(CELL)) { - /* we can just ask for more room */ - size = 0; - do_grow = FALSE; - } - } else if (hsplit < (CELL*)omax || + if (hsplit < H0 || hsplit > HR) - return FALSE; - else if (hsplit == (CELL *)omax) + return false; + if (hsplit == H0) hsplit = NULL; - if (size < 0 || - (Unsigned(HR)+size < Unsigned(ASP)-StackGap( PASS_REGS1 ) && - hsplit > H0)) { - /* don't need to expand stacks */ - insert_in_delays = FALSE; - do_grow = FALSE; - } - } else { - if (Unsigned(HR)+size < Unsigned(ASP)-CreepFlag) { - /* we can just ask for more room */ - do_grow = FALSE; + if (hsplit == HR && Unsigned(HR)+request < Unsigned(ASP)-StackGap( PASS_REGS1 )) { + return request; } } + if (size < 0 || + (Unsigned(HR)+request < Unsigned(ASP-StackGap( PASS_REGS1 )))) { + do_grow = false; + } if (do_grow) { - if (size < YAP_ALLOC_SIZE) - size = YAP_ALLOC_SIZE; - size = AdjustPageSize(size); + if (request < YAP_ALLOC_SIZE) + request = YAP_ALLOC_SIZE; + request = AdjustPageSize(request); } + + printf("grow=%d\n", do_grow); /* adjust to a multiple of 256) */ LOCAL_ErrorMessage = NULL; LOCAL_PrologMode |= GrowStackMode; start_growth_time = Yap_cputime(); + if (do_grow) { if (!GLOBAL_AllowGlobalExpansion) { LOCAL_ErrorMessage = "Global Stack crashed against Local Stack"; LeaveGrowMode(GrowStackMode); return 0; } - if (!GLOBAL_AllowGlobalExpansion || !Yap_ExtendWorkSpace(size)) { + if (!GLOBAL_AllowGlobalExpansion || !Yap_ExtendWorkSpace(request)) { /* always fails when using malloc */ LOCAL_ErrorMessage = NULL; - size += AdjustPageSize(((CELL)LOCAL_TrailTop-(CELL)LOCAL_GlobalBase)+MinHeapGap); - minimal_request = size; - size = Yap_ExtendWorkSpaceThroughHole(size); - if (size < 0) { + request += AdjustPageSize(((CELL)LOCAL_TrailTop-(CELL)LOCAL_GlobalBase)+MinHeapGap); + minimal_request = request; + request = Yap_ExtendWorkSpaceThroughHole(request); + if (request < 0) { LOCAL_ErrorMessage = "Global Stack crashed against Local Stack"; LeaveGrowMode(GrowStackMode); return 0; @@ -958,15 +953,11 @@ static_growglobal(size_t request, CELL **ptr, CELL *hsplit USES_REGS) } } gc_verbose = Yap_is_gc_verbose(); - LOCAL_delay_overflows++; if (gc_verbose) { if (hsplit) { if (hsplit > H0) { vb_msg1 = 'H'; vb_msg2 = "Global Variable Space"; - } else { - vb_msg1 = 'D'; - vb_msg2 = "Global Variable Delay Space"; } } else { vb_msg1 = 'D'; @@ -976,8 +967,9 @@ static_growglobal(size_t request, CELL **ptr, CELL *hsplit USES_REGS) fprintf(stderr, "%% Worker Id %d:\n", worker_id); #endif fprintf(stderr, "%% %cO %s Overflow %d\n", vb_msg1, vb_msg2, LOCAL_delay_overflows); - fprintf(stderr, "%% %cO growing the stacks " UInt_FORMAT " bytes\n", vb_msg1, size); + fprintf(stderr, "%% %cO growing the stacks " UInt_FORMAT " bytes\n", vb_msg1, request); } + printf("grow=%d %p\n", do_grow, ASP); ASP -= 256; YAPEnterCriticalSection(); /* we always shift the local and the stack by the same amount */ @@ -985,42 +977,40 @@ static_growglobal(size_t request, CELL **ptr, CELL *hsplit USES_REGS) /* we got over a hole */ if (minimal_request) { /* we went over a hole */ - LOCAL_BaseDiff = size+((CELL)LOCAL_TrailTop-(CELL)LOCAL_GlobalBase)-minimal_request; - LOCAL_LDiff = LOCAL_TrDiff = size; + LOCAL_BaseDiff = request+((CELL)LOCAL_TrailTop-(CELL)LOCAL_GlobalBase)-minimal_request; + LOCAL_LDiff = LOCAL_TrDiff = request; } else { /* we may still have an overflow */ LOCAL_BaseDiff = LOCAL_GlobalBase - old_GlobalBase; /* if we grow, we need to move the stacks */ - LOCAL_LDiff = LOCAL_TrDiff = LOCAL_BaseDiff+size; + LOCAL_LDiff = LOCAL_TrDiff = LOCAL_BaseDiff+request; } } else { /* stay still */ LOCAL_LDiff = LOCAL_TrDiff = 0; LOCAL_BaseDiff = 0; } + printf("grow=%d\n", LOCAL_LDiff); /* now, remember we have delay -- global with a hole in delay or a hole in global */ if (!hsplit) { if (!do_grow) { - LOCAL_DelayDiff = LOCAL_GDiff = LOCAL_GDiff0 = size; + LOCAL_GDiff = LOCAL_GDiff0 = request; request = 0L; } else { - /* expand delay stack */ - LOCAL_DelayDiff = LOCAL_GDiff = LOCAL_GDiff0 = LOCAL_LDiff; - } - } else if (insert_in_delays) { /* we want to expand a hole for the delay stack */ - LOCAL_DelayDiff = size-request; - LOCAL_GDiff = LOCAL_GDiff0 = size; + LOCAL_GDiff = LOCAL_GDiff0 = LOCAL_LDiff; + } } else { /* we want to expand a hole for the delay stack */ - LOCAL_GDiff0 = LOCAL_DelayDiff = LOCAL_BaseDiff; + LOCAL_GDiff0 = LOCAL_BaseDiff; LOCAL_GDiff = LOCAL_BaseDiff+request; } LOCAL_GSplit = hsplit; LOCAL_XDiff = LOCAL_HDiff = 0; LOCAL_GlobalBase = old_GlobalBase; - SetHeapRegs(FALSE PASS_REGS); + fprintf(stderr,"off %d 5d %d\n", LOCAL_GDiff0, LOCAL_GDiff, LOCAL_LDiff); + SetHeapRegs(FALSE PASS_REGS); if (do_grow) { MoveLocalAndTrail( PASS_REGS1 ); if (hsplit) { @@ -1042,17 +1032,13 @@ static_growglobal(size_t request, CELL **ptr, CELL *hsplit USES_REGS) *ptr = PtoLocAdjust(*ptr); } if (hsplit) { - if (insert_in_delays) { - /* we have things not quite where we want to have them */ - cpcellsd((CELL *)(omax+LOCAL_DelayDiff), (CELL *)(omax+LOCAL_GDiff0), (ADDR)hsplit-omax); - } else { - MoveHalfGlobal(hsplit PASS_REGS); - } + MoveHalfGlobal(hsplit, request PASS_REGS); + printf("done\n"); } YAPLeaveCriticalSection(); ASP += 256; if (minimal_request) { - Yap_AllocHole(minimal_request, size); + Yap_AllocHole(minimal_request, request); } growth_time = Yap_cputime()-start_growth_time; LOCAL_total_delay_overflow_time += growth_time; @@ -1063,8 +1049,9 @@ static_growglobal(size_t request, CELL **ptr, CELL *hsplit USES_REGS) LeaveGrowMode(GrowStackMode); if (hsplit) { return request; - } else + } else { return LOCAL_GDiff-LOCAL_BaseDiff; + } } static void @@ -1548,6 +1535,7 @@ UInt Yap_InsertInGlobal(CELL *where, size_t howmuch) { CACHE_REGS + printf("where=%p, hm=%d\n",where,howmuch); if ((howmuch = static_growglobal(howmuch, NULL, where PASS_REGS)) == 0) return 0; #ifdef TABLING @@ -1576,6 +1564,7 @@ Yap_growstack(size_t size) int res; LOCAL_PrologMode |= GrowStackMode; + printf("extra %dBs\n",size); res=growstack(size PASS_REGS); LeaveGrowMode(GrowStackMode); return res; diff --git a/C/index.c b/C/index.c index 03e9d41b0..23dd4da49 100755 --- a/C/index.c +++ b/C/index.c @@ -2039,7 +2039,7 @@ static UInt suspend_indexing(ClauseDef *min, ClauseDef *max, PredEntry *ap, /* give it some slack */ tels = cls + 4; } else { - tels = cls; + tels = cls+1; } sz = (UInt)NEXTOP((yamop *)NULL, sssllp) + tels * sizeof(yamop *); if ((ncode = (yamop *)Yap_AllocCodeSpace(sz)) == NULL) { diff --git a/CXX/yapi.cpp b/CXX/yapi.cpp index 9d6cd3d14..1056965dd 100644 --- a/CXX/yapi.cpp +++ b/CXX/yapi.cpp @@ -586,20 +586,18 @@ bool YAPEngine::call(YAPPredicate ap, YAPTerm ts[]) { q.p = P; q.cp = CP; + q.b0 = LCL0-CellPtr(B); + q.env0 = LCL0-ENV; for (arity_t i = 0; i < arity; i++) XREGS[i + 1] = ts[i].term(); // allow Prolog style exceotion handling // don't forget, on success these bindings will still be there); - result = YAP_LeaveGoal(true, &q); + result = YAP_EnterGoal(ap.ap, nullptr, &q); + YAP_LeaveGoal(result, &q); - Int oenv = LCL0-ENV; - Int oB = LCL0-CellPtr(B); YAPCatchError(); - Yap_CloseHandles(q.CurSlot); - pop_text_stack(q.lvl + 1); - RECOVER_MACHINE_REGS(); return result; } @@ -613,6 +611,7 @@ bool YAPEngine::mgoal(Term t, Term tmod, bool release) { // _save = PyEval_SaveThread(); #endif CACHE_REGS + YAP_dogoalinfo q; BACKUP_MACHINE_REGS(); Term *ts = nullptr; q.CurSlot = Yap_StartSlots(); @@ -662,13 +661,14 @@ bool YAPEngine::mgoal(Term t, Term tmod, bool release) { void YAPEngine::release() { BACKUP_MACHINE_REGS(); - YAP_LeaveGoal(FALSE, &q); + // YAP_LeaveGoal(FALSE, &q); RECOVER_MACHINE_REGS(); } Term YAPEngine::fun(Term t) { CACHE_REGS BACKUP_MACHINE_REGS(); + YAP_dogoalinfo q; Term tmod = Yap_CurrentModule(), *ts = nullptr; PredEntry *ap; arity_t arity; @@ -1143,14 +1143,15 @@ std::stringstream s; void YAPEngine::reSet() { /* ignore flags for now */ if (B && B->cp_b && B->cp_ap != NOCODE) - YAP_LeaveGoal(false, &q); + // YAP_LeaveGoal(false, &q); LOCAL_ActiveError->errorNo = YAP_NO_ERROR; if (LOCAL_CommittedError) { LOCAL_CommittedError->errorNo = YAP_NO_ERROR; free(LOCAL_CommittedError); LOCAL_CommittedError = NULL; } - LOCAL_CurSlot = q.CurSlot; + pop_text_stack(0); + LOCAL_CurSlot = 0; } Term YAPEngine::top_level(std::string s) { diff --git a/CXX/yapq.hh b/CXX/yapq.hh index 9a13b7a38..9b1c1aafc 100644 --- a/CXX/yapq.hh +++ b/CXX/yapq.hh @@ -39,7 +39,6 @@ class X_API YAPQuery : public YAPPredicate { bool q_open; int q_state; yhandle_t q_handles; - struct yami *q_p, *q_cp; int q_flags; YAP_dogoalinfo q_h; YAPPairTerm names; @@ -54,10 +53,10 @@ class X_API YAPQuery : public YAPPredicate { q_state = 0; q_flags = true; // PL_Q_PASS_EXCEPTION; - q_p = P; - q_cp = CP; + q_h.p = P; + q_h.cp = CP; // make sure this is safe - q_handles = LOCAL_CurSlot; + q_h.CurSlot = LOCAL_CurSlot; }; void openQuery(); @@ -321,7 +320,6 @@ private: YAPCallback *_callback; YAPError yerror; void doInit(YAP_file_type_t BootMode, YAPEngineArgs *cargs); - YAP_dogoalinfo q; YAPError e; PredEntry *rewriteUndefEngineQuery(PredEntry *ap, Term &t, Term tmod); diff --git a/cmake/Config.cmake b/cmake/Config.cmake index 094d3ce42..2564ec571 100644 --- a/cmake/Config.cmake +++ b/cmake/Config.cmake @@ -297,6 +297,7 @@ check_function_exists(mkstemp HAVE_MKSTEMP) check_function_exists(mktemp HAVE_MKTEMP) check_function_exists(nanosleep HAVE_NANOSLEEP) check_function_exists(mktime HAVE_MKTIME) +check_function_exists(mtrace HAVE_MTRACE) check_function_exists(opendir HAVE_OPENDIR) if (NOT APPLE) check_function_exists(open_memstream HAVE_OPEN_MEMSTREAM) diff --git a/config.h.cmake b/config.h.cmake index bc2ab1242..822ad3116 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -942,6 +942,11 @@ function. */ #cmakedefine HAVE_MPI_H ${HAVE_MPI_H} #endif +/* Define to 1 if you have the glibc extension. */ +#ifndef HAVE_MPI_H +#cmakedefine HAVE_MTRACE ${HAVE_TRACE} +#endif + /* Older versions of MPZ didn't have XOR */ #ifndef HAVE_MPZ_XOR #cmakedefine HAVE_MPZ_XOR ${HAVE_MPZ_XOR} diff --git a/include/YapDefs.h b/include/YapDefs.h index 0cc49c885..aa3c49001 100755 --- a/include/YapDefs.h +++ b/include/YapDefs.h @@ -144,7 +144,7 @@ typedef struct { struct yami *p; //> Program Counter at entry struct yami *cp; //> Continuation PC at entry int lvl; - long env; + long env0; unsigned long tr, h; } YAP_dogoalinfo; diff --git a/os/sysbits.c b/os/sysbits.c index 966ee2eaf..97d103822 100644 --- a/os/sysbits.c +++ b/os/sysbits.c @@ -1933,6 +1933,19 @@ static Int p_sleep(USES_REGS1) { return FALSE: #endif } + + +static Int + p_mtrace() + { +#ifdef HAVE_MTRACE + Term t = Deref(ARG1); + if (t == TermTrue) mtrace(); + else if (t == TermFalse) return muntrace(); + else return false; +#endif + return true; + } void Yap_InitSysPreds(void) { Yap_InitCPred("log_event", 1, p_log_event, SafePredFlag | SyncPredFlag); @@ -1972,5 +1985,6 @@ void Yap_InitSysPreds(void) { Yap_InitCPred("rmdir", 2, p_rmdir, SyncPredFlag); Yap_InitCPred("sleep", 1, p_sleep, SyncPredFlag); Yap_InitCPred("make_directory", 1, make_directory, SyncPredFlag); + Yap_InitCPred("mtrace", 1, p_mtrace, SyncPredFlag); } diff --git a/os/writeterm.c b/os/writeterm.c index ce96bf572..ecaa14503 100644 --- a/os/writeterm.c +++ b/os/writeterm.c @@ -729,6 +729,7 @@ char *Yap_TermToBuffer(Term t, int flags) { t = Deref(t); GLOBAL_Stream[sno].encoding = LOCAL_encoding; GLOBAL_Stream[sno].status |= CloseOnException_Stream_f; + GLOBAL_Stream[sno].status &= ~FreeOnClose_Stream_f; Yap_plwrite(t, GLOBAL_Stream + sno, 0, flags, GLOBAL_MaxPriority); char *new = Yap_MemExportStreamPtr(sno); diff --git a/packages/python/pl2pl.c b/packages/python/pl2pl.c index b9661f772..b982bb652 100644 --- a/packages/python/pl2pl.c +++ b/packages/python/pl2pl.c @@ -114,7 +114,8 @@ static foreign_t array_to_python_view(term_t addr, term_t type, term_t szt, static foreign_t prolog_list_to_python_list(term_t plist, term_t pyt, term_t tlen) { size_t sz, i; - PyErr_Clear(); + +PyErr_Clear(); PyObject *pyl = term_to_python(pyt, true, NULL, true); term_t targ = PL_new_term_ref(); @@ -135,10 +136,10 @@ static foreign_t prolog_list_to_python_list(term_t plist, term_t pyt, term_t tle PyList_SET_ITEM(pyl, i, t); } if (PL_is_variable(tlen)) { - PL_unify_int64(tlen, sz); -} else { -python_assign(tlen, PyLong_FromUnsignedLong(sz), NULL); -} + PL_unify_int64(tlen, sz); + } else { + python_assign(tlen, PyLong_FromUnsignedLong(sz), NULL); + } pyErrorAndReturn( true); } diff --git a/packages/python/py2pl.c b/packages/python/py2pl.c index 1d24f893a..27e89e81c 100644 --- a/packages/python/py2pl.c +++ b/packages/python/py2pl.c @@ -230,7 +230,6 @@ bool python_assign(term_t t, PyObject *exp, PyObject *context) { bool rc = true; PyErr_Print(); term_t inp = Yap_CurrentHandle(); - Yap_DebugPlWriteln(YAP_GetFromSlot(t)); context = find_obj(context, t, false); // Yap_DebugPlWriteln(yt); switch (PL_term_type(t)) { @@ -320,8 +319,6 @@ bool python_assign(term_t t, PyObject *exp, PyObject *context) { // t now refers to the index if (!PL_get_arg(1, t, t) || !PL_get_list(t, t, tail) || !PL_get_nil(tail)) { - PL_reset_term_refs(i); - ; rc = false; } else { PyObject *i = term_to_python(t, true, NULL, false); diff --git a/packages/python/py4yap.h b/packages/python/py4yap.h index bae0be539..b2fc28a8d 100644 --- a/packages/python/py4yap.h +++ b/packages/python/py4yap.h @@ -23,10 +23,14 @@ #undef _XOPEN_SOURCE // python does its own thing #endif + +#undef _POSIX_C_SOURCE + #include #include + #include #ifdef HAVE_STAT #undef HAVE_STATa @@ -95,7 +99,7 @@ extern PyObject *py_Sys; extern X_API bool python_in_python; extern bool pyStringToString; -extern bool python_release_GIL(term_t gstate); +extern bool python_release_GIL(term_t gstate); extern term_t python_acquire_GIL(void); static inline Py_ssize_t get_p_int(PyObject *o, Py_ssize_t def) { @@ -201,22 +205,21 @@ extern PyObject *YEC(PyObject *c,PyObject *a ,PyObject *d , int line, const char extern void YEM(const char *ex, int line, const char *file, const char *code); extern void pyErrorHandler__(int line, const char *file, const char *code); -#define pyErrorHandler() \ - { \ - if (PyErr_Occurred()) { \ +#define PyStart() PyErr_Clear() + + +#define pyErrorHandler() if (PyErr_Occurred()) { \ pyErrorHandler__(__LINE__, __FILE__, __FUNCTION__); \ } \ - } + #define pyErrorAndReturn(x) \ - { \ if (PyErr_Occurred()) { \ pyErrorHandler__(__LINE__, __FILE__, __FUNCTION__); \ } \ - return (x); \ - } + return (x) + // #define pyErrorAndReturn( x, y ) return x - extern PyObject *compound_to_pyeval(term_t t, PyObject *context, bool cvt); extern PyObject *compound_to_pytree(term_t t, PyObject *context, bool cvt); diff --git a/packages/python/pypreds.c b/packages/python/pypreds.c index 58ae72865..e4353430d 100644 --- a/packages/python/pypreds.c +++ b/packages/python/pypreds.c @@ -20,6 +20,7 @@ void pyErrorHandler__(int line, const char *file, const char *code) { static foreign_t python_len(term_t tobj, term_t tf) { Py_ssize_t len; PyObject *o; + PyStart(); o = term_to_python(tobj, true, NULL, true); if (o == NULL) { @@ -32,13 +33,14 @@ static foreign_t python_len(term_t tobj, term_t tf) { static foreign_t python_represent( term_t name, term_t tobj) { term_t stackp = python_acquire_GIL(); PyObject *e; + PyStart(); e = term_to_python(tobj, false, NULL, false); if (e == NULL) { python_release_GIL(stackp); pyErrorAndReturn(false); } - bool b = python_assign(name, e, NULL); + foreign_t b = python_assign(name, e, NULL); python_release_GIL(stackp); pyErrorAndReturn(b); } @@ -53,6 +55,7 @@ static foreign_t python_clear_errors(void) { static foreign_t python_dir(term_t tobj, term_t tf) { PyObject *dir; PyObject *o; + PyStart(); o = term_to_python(tobj, true, NULL, true); if (o == NULL) { @@ -70,6 +73,7 @@ static foreign_t python_index(term_t tobj, term_t tindex, term_t val) { PyObject *i; PyObject *o; PyObject *f; + PyStart(); o = term_to_python(tobj, true, NULL, true); if (o == NULL) { @@ -96,6 +100,7 @@ static foreign_t python_index(term_t tobj, term_t tindex, term_t val) { static foreign_t python_is(term_t tobj, term_t tf) { PyObject *o; + PyStart(); term_t lim = python_acquire_GIL(); @@ -112,12 +117,13 @@ static foreign_t python_is(term_t tobj, term_t tf) { } static foreign_t python_proc(term_t tobj) { + PyStart(); PyObject *o; term_t lim = python_acquire_GIL(); o = term_to_python(tobj, true, NULL, true); python_release_GIL(lim); - bool rc = o != NULL; + foreign_t rc = o != NULL; pyErrorAndReturn(rc); } @@ -133,9 +139,7 @@ static foreign_t python_slice(term_t parent, term_t indx, term_t tobj) { p = term_to_python(parent, true, NULL, true); // Exp if (!pI || !p) { - { - pyErrorAndReturn(false); - } + pyErrorAndReturn(false); } else if ((pF = PySequence_GetSlice(p, 0, 0)) == NULL) { PyErr_Print(); { pyErrorAndReturn(false); } @@ -152,6 +156,7 @@ static foreign_t python_slice(term_t parent, term_t indx, term_t tobj) { static foreign_t python_apply(term_t tin, term_t targs, term_t keywds, term_t tf) { + PyStart(); PyObject *pF; PyObject *pArgs, *pKeywords; PyObject *pValue; @@ -161,7 +166,6 @@ static foreign_t python_apply(term_t tin, term_t targs, term_t keywds, term_t targ = PL_new_term_ref(); pF = term_to_python(tin, true, NULL, true); - PyErr_Clear(); if (pF == NULL) { { pyErrorAndReturn(false); @@ -236,7 +240,7 @@ static foreign_t python_apply(term_t tin, term_t targs, term_t keywds, } static foreign_t assign_python(term_t exp, term_t name) { - printf("A %ld\n", LOCAL_CurSlot); + PyStart(); term_t stackp = python_acquire_GIL(); PyObject *e = term_to_python(exp, true, NULL, true); @@ -244,8 +248,7 @@ static foreign_t assign_python(term_t exp, term_t name) { python_release_GIL(stackp); pyErrorAndReturn(false); } - bool b = python_assign(name, e, NULL); - printf("B %ld\n", LOCAL_CurSlot); + foreign_t b = python_assign(name, e, NULL); python_release_GIL(stackp); pyErrorAndReturn(b); } @@ -270,7 +273,7 @@ static foreign_t python_string_to(term_t f) { } static foreign_t python_builtin_eval(term_t caller, term_t dict, term_t out) { - PyErr_Clear(); + PyStart(); PyObject *pI, *pArgs, *pOut; PyObject *env; atom_t name; @@ -332,7 +335,7 @@ static foreign_t python_builtin_eval(term_t caller, term_t dict, term_t out) { } static foreign_t python_access(term_t obj, term_t f, term_t out) { - PyErr_Clear(); + PyStart(); PyObject *o = term_to_python(obj, true, NULL, true), *pValue, *pArgs, *pF; atom_t name; char *s = NULL; @@ -401,7 +404,7 @@ static foreign_t python_field(term_t parent, term_t att, term_t tobj) { atom_t name; char *s; int arity; - + PyStart(); if (!PL_get_name_arity(att, &name, &arity)) { { pyErrorAndReturn(false); @@ -449,14 +452,14 @@ static foreign_t python_field(term_t parent, term_t att, term_t tobj) { static foreign_t python_main_module(term_t mod) { { foreign_t rc; - PyErr_Clear(); + PyStart(); rc = address_to_term(py_Main, mod); pyErrorAndReturn(rc); } } static foreign_t python_function(term_t tobj) { - PyErr_Clear(); + PyStart(); PyObject *obj = term_to_python(tobj, true, NULL, true); foreign_t rc = PyFunction_Check(obj); @@ -466,7 +469,7 @@ static foreign_t python_function(term_t tobj) { foreign_t python_builtin(term_t out) { { foreign_t rc; - PyErr_Clear(); + PyStart(); rc = address_to_term(py_Builtin, out); pyErrorAndReturn(rc); } @@ -477,7 +480,7 @@ static foreign_t python_run_file(term_t file) { size_t len; char si[256]; s = si; - PyErr_Clear(); + PyStart(); if (PL_get_nchars(file, &len, &s, CVT_ALL | CVT_EXCEPTION)) { #if PY_MAJOR_VERSION < 3 PyObject *PyFileObject = PyFile_FromString(si, "r"); @@ -500,11 +503,11 @@ extern PyThreadState *YAP_save; static foreign_t python_run_command(term_t cmd) { char *s; - bool rc = false; + foreign_t rc = false; size_t len; char si[256]; - PyErr_Clear(); + PyStart(); s = si; if (PL_get_nchars(cmd, &len, &s, CVT_ALL | CVT_EXCEPTION)) { PyRun_SimpleString(s); @@ -520,7 +523,7 @@ static foreign_t python_run_script(term_t cmd, term_t fun) { PyObject *pArgs = NULL, *pValue; char *s; - PyErr_Clear(); + PyStart(); s = si; if (PL_get_nchars(cmd, &len, &s, CVT_ALL | CVT_EXCEPTION) && (s = sf) != NULL && @@ -572,7 +575,7 @@ static foreign_t python_run_script(term_t cmd, term_t fun) { static foreign_t python_export(term_t t, term_t pl) { foreign_t rc = false; - PyErr_Clear(); + PyStart(); if (PL_is_functor(t, FUNCTOR_pointer1)) { void *ptr; term_t targ = PL_new_term_ref(); @@ -601,7 +604,8 @@ static foreign_t python_export(term_t t, term_t pl) { */ static int python_import(term_t mname, term_t mod) { PyObject *pName; - bool do_as = false; + foreign_t do_as = false; + PyStart(); char s0[MAXPATHLEN], *s = s0; s[0] = '\0'; @@ -674,7 +678,7 @@ static int python_import(term_t mname, term_t mod) { static foreign_t python_to_rhs(term_t inp, term_t t) { PyObject *pVal; - PyErr_Clear(); + PyStart(); pVal = term_to_python(inp, true, NULL, true); if (pVal == NULL) pyErrorAndReturn(false); @@ -682,7 +686,7 @@ static foreign_t python_to_rhs(term_t inp, term_t t) { } // static PyThreadState *_saveP = NULL; -static bool _threaded = true; +static foreign_t _threaded = true; /* static YAP_Int @@ -708,7 +712,7 @@ PyThreadState *tstate; static YAP_Int p_python_threaded(void) { - PyErr_Clear(); + PyStart(); // PyEval_ReleaseThread(tstate); // _threaded = true; // _locked = 0; @@ -731,7 +735,6 @@ term_t python_acquire_GIL(void) { PL_put_integer(curSlot, gstatei++); return curSlot; } - bool python_release_GIL(term_t curBlock) { int gstateix; gstatei--; From c91faf8bc3f1090310884c841c1eb8dfa8d6d8dd Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Thu, 2 May 2019 20:51:46 +0100 Subject: [PATCH 19/29] fix tracing of functor/ arg fix leaks in Malloc handle overfows in globals. --- .gitignore | 1 + C/exec.c | 3 +- C/globals.c | 222 ++++++++++++++++++++----------------------- C/grow.c | 4 +- C/prim_absmi_insts.h | 130 ++++++++++++++----------- C/scanner.c | 91 ++++++++++++------ H/YapText.h | 12 +-- H/Yapproto.h | 2 +- pl/absf.yap | 3 +- 9 files changed, 248 insertions(+), 220 deletions(-) diff --git a/.gitignore b/.gitignore index faccf25e8..dbae7786b 100644 --- a/.gitignore +++ b/.gitignore @@ -215,3 +215,4 @@ cmake/docs/Doxyfile *.stackdump *.gz +.Rproj.user diff --git a/C/exec.c b/C/exec.c index f7f9e0cfb..de50c122e 100755 --- a/C/exec.c +++ b/C/exec.c @@ -1612,7 +1612,6 @@ static bool exec_absmi(bool top, yap_reset_t reset_mode USES_REGS) { CalculateStackGap(PASS_REGS1); LOCAL_CBorder = OldBorder; LOCAL_RestartEnv = sighold; - pop_text_stack(i + 1); return out; } @@ -2267,7 +2266,7 @@ void Yap_InitYaamRegs(int myworker_id, bool full_reset) { REMOTE_AttsMutableList(myworker_id) = Yap_NewTimedVar(h0var); #endif size_t defsz = 128*1024; - Yap_AllocateDefaultArena(defsz, myworker_id); + Yap_AllocateDefaultArena(defsz, myworker_id, NULL); } else { HR = Yap_ArenaLimit(REMOTE_GlobalArena(myworker_id)); } diff --git a/C/globals.c b/C/globals.c index cac4e43be..27c5cccfc 100644 --- a/C/globals.c +++ b/C/globals.c @@ -139,6 +139,26 @@ threads that are created after the registration. #define HEAP_ARENA 2 #define HEAP_START 3 +/// A cell_space is a short code region, where we want bindings to proceed locally. +/// It is used in copy_term,,,,,,,,,,,,,,,,,,,,,,, +/// +typedef struct cell_space { + struct cell_space *parent; //` + CELL *oASP, *oH, *oHB; +} cell_space_t; + +INLINE_ONLY void enter_cell_space(cell_space_t *cs) { + cs->oH = HR; + cs->oHB = HB; + cs->oASP = ASP; +} + +INLINE_ONLY void exit_cell_space(cell_space_t *cs) { + HR = cs->oH; + HB = cs->oHB; + ASP = cs->oASP; +} + #define MIN_ARENA_SIZE (1048L) #define MAX_ARENA_SIZE (2048 * 16) @@ -186,34 +206,37 @@ static Term CreateNewArena(CELL *ptr, UInt size) { return t; } -static Term NewArena(UInt size, int wid, UInt arity, CELL *where) { +static Term NewArena(UInt size, int wid, UInt arity, CELL *where, struct cell_space *cellSpace) { Term t; UInt new_size; WORKER_REGS(wid) - +exit_cell_space(cellSpace); // make sure we have enough room - while (HR + size > ASP - 1024) { + while (HR + size > ASP - MIN_ARENA_SIZE) { if (!Yap_gcl(size * sizeof(CELL), arity, ENV, P)) { - Yap_Error(RESOURCE_ERROR_STACK, TermNil, LOCAL_ErrorMessage); + Yap_ThrowError(RESOURCE_ERROR_STACK, TermNil, LOCAL_ErrorMessage); return TermNil; } } if (where == NULL || where == HR) { t = CreateNewArena(HR, size); HR += size; + new_size = size; } else { if ((new_size = Yap_InsertInGlobal(where, size * sizeof(CELL))) == 0) { - Yap_Error(RESOURCE_ERROR_STACK, TermNil, + Yap_ThrowError(RESOURCE_ERROR_STACK, TermNil, "No Stack Space for Non-Backtrackable terms"); return TermNil; } size = new_size / sizeof(CELL); t = CreateNewArena(where, size); } + enter_cell_space(cellSpace); return t; } static Int p_allocate_arena(USES_REGS1) { + cell_space_t cspace; Term t = Deref(ARG1); if (IsVarTerm(t)) { Yap_Error(INSTANTIATION_ERROR, t, "allocate_arena"); @@ -222,15 +245,21 @@ static Int p_allocate_arena(USES_REGS1) { Yap_Error(TYPE_ERROR_INTEGER, t, "allocate_arena"); return FALSE; } - return Yap_unify(ARG2, NewArena(IntegerOfTerm(t), worker_id, 1, NULL)); + enter_cell_space(&cspace); + return Yap_unify(ARG2, NewArena(IntegerOfTerm(t), worker_id, 1, NULL, &cspace)); } static Int p_default_arena_size(USES_REGS1) { return Yap_unify(ARG1, MkIntegerTerm(ArenaSz(LOCAL_GlobalArena))); } -void Yap_AllocateDefaultArena(size_t gsize, int wid) { - REMOTE_GlobalArena(wid) = NewArena(gsize, wid, 2, NULL); +void Yap_AllocateDefaultArena(size_t gsize, int wid, void *cs) { + cell_space_t ics; + if (cs == NULL) { + enter_cell_space(&ics); + cs = &ics; + } + REMOTE_GlobalArena(wid) = NewArena(gsize, wid, 2, NULL, cs); } static void adjust_cps(UInt size USES_REGS) { @@ -243,7 +272,7 @@ static void adjust_cps(UInt size USES_REGS) { } static Term GrowArena(Term arena, CELL *pt, size_t old_size, size_t size, - UInt arity USES_REGS) { + UInt arity, cell_space_t *cspace USES_REGS) { size_t sz; LOCAL_ArenaOverflows++; if (size == 0) { @@ -253,35 +282,35 @@ static Term GrowArena(Term arena, CELL *pt, size_t old_size, size_t size, size = old_size + 128 * 1024; } } - if (size < 4096) { - size = 4096; + if (size < 4*MIN_ARENA_SIZE) { + size = 4*MIN_ARENA_SIZE; } - while (HR + size > ASP - 1024) { - + exit_cell_space(cspace); + while (HR + size > ASP - MIN_ARENA_SIZE) { XREGS[arity + 1] = arena; if (!Yap_gcl(size * sizeof(CELL), arity + 1, ENV, gc_P(P, CP))) { - Yap_Error(RESOURCE_ERROR_STACK, TermNil, LOCAL_ErrorMessage); - return false; + Yap_Error(RESOURCE_ERROR_STACK, TermNil, LOCAL_ErrorMessage); + return false; } arena = XREGS[arity + 1]; - adjust_cps(size PASS_REGS); + adjust_cps(size PASS_REGS); + } pt = ArenaLimit(arena)+1; - + sz = old_size + size; if (pt == HR) { - sz = old_size + size; - HR += size; + HR += size+1; HR[ - 1] = EndSpecials; } else { - if ((sz = Yap_InsertInGlobal(pt, sz * sizeof(CELL))) == 0) { + if ((sz = Yap_InsertInGlobal(pt, size * sizeof(CELL))) == 0) { return FALSE; } - pt[sz-1] = EndSpecials; + pt[size-1] = EndSpecials; } arena = XREGS[arity + 1]; MP_INT *dst = (MP_INT *)(RepAppl(arena) + 2); - dst->_mp_alloc+= size/sizeof(CELL); + dst->_mp_alloc+= size; + arena = XREGS[arity + 1]; return sz; - } } CELL *Yap_GetFromArena(Term *arenap, UInt cells, UInt arity) { @@ -308,17 +337,15 @@ CELL *Yap_GetFromArena(Term *arenap, UInt cells, UInt arity) { } } -static void CloseArena(CELL *oldH, CELL *oldHB, CELL *oldASP, Term *oldArenaP, +static void CloseArena(cell_space_t *region, Term *oldArenaP, UInt old_size USES_REGS) { UInt new_size; - if (HR == oldH) + if (HR == region->oH) return; new_size = old_size - (HR - RepAppl(*oldArenaP)); *oldArenaP = CreateNewArena(HR, new_size); - HR = oldH; - HB = oldHB; - ASP = oldASP; + exit_cell_space( region ); } static inline void clean_dirty_tr(tr_fr_ptr TR0 USES_REGS) { @@ -641,9 +668,8 @@ static Term CopyTermToArena(Term t, Term arena, bool share, bool copy_att_vars, UInt arity, Term *newarena, size_t min_grow USES_REGS) { size_t old_size = ArenaSz(arena); - CELL *oldH = HR; - CELL *oldHB = HB; - CELL *oldASP = ASP; + cell_space_t cspace; + enter_cell_space( & cspace); int res = 0; Term tn; @@ -662,12 +688,12 @@ restart: if ((res = copy_complex_term(Hi - 2, Hi - 1, share, copy_att_vars, Hi, Hi PASS_REGS)) < 0) goto error_handler; - CloseArena(oldH, oldHB, oldASP, newarena, old_size PASS_REGS); + CloseArena(&cspace, newarena, old_size PASS_REGS); return Hi[0]; } #endif if (share && VarOfTerm(t) > ArenaPt(arena)) { - CloseArena(oldH, oldHB, oldASP, newarena, old_size PASS_REGS); + CloseArena(&cspace, newarena, old_size PASS_REGS); return t; } tn = MkVarTerm(); @@ -675,7 +701,7 @@ restart: res = -1; goto error_handler; } - CloseArena(oldH, oldHB, oldASP, newarena, old_size PASS_REGS); + CloseArena(&cspace, newarena, old_size PASS_REGS); return tn; } else if (IsAtomOrIntTerm(t)) { return t; @@ -697,7 +723,7 @@ restart: Hi PASS_REGS)) < 0) { goto error_handler; } - CloseArena(oldH, oldHB, oldASP, newarena, old_size PASS_REGS); + CloseArena(&cspace, newarena, old_size PASS_REGS); return tf; } else { Functor f; @@ -718,7 +744,7 @@ restart: if (IsExtensionFunctor(f)) { switch ((CELL)f) { case (CELL) FunctorDBRef: - CloseArena(oldH, oldHB, oldASP, newarena, old_size PASS_REGS); + CloseArena(&cspace, newarena, old_size PASS_REGS); return t; case (CELL) FunctorLongInt: if (HR > ASP - (MIN_ARENA_SIZE + 3)) { @@ -777,25 +803,23 @@ restart: goto error_handler; } } - CloseArena(oldH, oldHB, oldASP, newarena, old_size PASS_REGS); + CloseArena(&cspace, newarena, old_size PASS_REGS); return tf; } error_handler: HR = HB; - CloseArena(oldH, oldHB, oldASP, newarena, old_size PASS_REGS); + CloseArena(&cspace, newarena, old_size PASS_REGS); XREGS[arity + 1] = t; XREGS[arity + 2] = arena; XREGS[arity + 3] = (CELL)newarena; { CELL *old_top = ArenaLimit(*newarena); - ASP = oldASP; - HR = oldH; - HB = oldHB; + exit_cell_space(&cspace); switch (res) { case -1: if (arena == LOCAL_GlobalArena) LOCAL_GlobalArenaOverflows++; - if ((arena=GrowArena(arena, old_top, old_size, min_grow, arity + 3 PASS_REGS))==0) { + if ((arena=GrowArena(arena, old_top, old_size, min_grow, arity + 3, &cspace PASS_REGS))==0) { Yap_Error(RESOURCE_ERROR_STACK, TermNil, LOCAL_ErrorMessage); return 0L; } @@ -805,9 +829,7 @@ error_handler: } } - oldH = HR; - oldHB = HB; - oldASP = ASP; + enter_cell_space(&cspace); newarena = (CELL *)XREGS[arity + 3]; arena = Deref(XREGS[arity + 2]); t = XREGS[arity + 1]; @@ -817,10 +839,9 @@ error_handler: static Term CreateTermInArena(Term arena, Atom Na, UInt Nar, UInt arity, Term *newarena, Term init USES_REGS) { + cell_space_t cells; UInt old_size = ArenaSz(arena); - CELL *oldH = HR; - CELL *oldHB = HB; - CELL *oldASP = ASP; + enter_cell_space(&cells); Term tf; CELL *HB0; Functor f = Yap_MkFunctor(Na, Nar); @@ -836,26 +857,20 @@ restart: if (HR > ASP - MIN_ARENA_SIZE) { /* overflow */ HR = HB; - CloseArena(oldH, oldHB, oldASP, newarena, old_size PASS_REGS); + CloseArena(&cells, newarena, old_size PASS_REGS); XREGS[arity + 1] = arena; XREGS[arity + 2] = (CELL)newarena; { CELL *old_top = ArenaLimit(*newarena); - ASP = oldASP; - HR = oldH; - HB = oldHB; if (arena == LOCAL_GlobalArena) LOCAL_GlobalArenaOverflows++; if ((arena=GrowArena(arena, old_top, old_size, Nar * sizeof(CELL), - arity + 2 PASS_REGS))==0) { + arity + 2, &cells PASS_REGS))==0) { Yap_Error(RESOURCE_ERROR_STACK, TermNil, "while creating large global term"); return 0L; } } - oldH = HR; - oldHB = HB; - oldASP = ASP; newarena = (CELL *)XREGS[arity + 2]; arena = Deref(XREGS[arity + 1]); old_size = ArenaSz(arena); @@ -870,7 +885,7 @@ restart: HB0[i] = init; } } - CloseArena(oldH, oldHB, oldASP, newarena, old_size PASS_REGS); + CloseArena(&cells, newarena, old_size PASS_REGS); return tf; } @@ -1532,9 +1547,10 @@ static Int p_nb_create2(USES_REGS1) { static Int nb_queue(UInt arena_sz USES_REGS) { + cell_space_t cspace; Term queue_arena, queue, ar[QUEUE_FUNCTOR_ARITY], *nar; Term t = Deref(ARG1); - +enter_cell_space(&cspace); LOCAL_DepthArenas++; if (!IsVarTerm(t)) { if (!IsApplTerm(t)) { @@ -1549,7 +1565,7 @@ static Int nb_queue(UInt arena_sz USES_REGS) { return FALSE; if (arena_sz < 32 * 1024) arena_sz = 32 * 1024; - queue_arena = NewArena(arena_sz, worker_id, 1, NULL); + queue_arena = NewArena(arena_sz, worker_id, 1, NULL, &cspace); if (queue_arena == 0L) { return FALSE; } @@ -1654,7 +1670,7 @@ static Int p_nb_queue_close(USES_REGS1) { } static Int p_nb_queue_enqueue(USES_REGS1) { - CELL *qd = GetQueue(ARG1, "enqueue"), *oldH, *oldHB; + CELL *qd = GetQueue(ARG1, "enqueue"); UInt old_sz; Term arena, qsize, to; UInt min_size; @@ -1673,37 +1689,15 @@ static Int p_nb_queue_enqueue(USES_REGS1) { min_size PASS_REGS); if (to == 0L) return FALSE; + cell_space_t cspace; qd = GetQueue(ARG1, "enqueue"); arena = GetQueueArena(qd, "enqueue"); /* garbage collection ? */ - oldH = HR; - oldHB = HB; + enter_cell_space(&cspace); HR = HB = ArenaPt(arena); old_sz = ArenaSz(arena); qsize = IntegerOfTerm(qd[QUEUE_SIZE]); - while (old_sz < MIN_ARENA_SIZE) { - UInt gsiz = HR - RepPair(qd[QUEUE_HEAD]); - HR = oldH; - HB = oldHB; - if (gsiz > 1024 * 1024) { - gsiz = 1024 * 1024; - } else if (gsiz < 1024) { - gsiz = 1024; - } - ARG3 = to; - /* fprintf(stderr,"growing %ld cells\n",(unsigned long int)gsiz);*/ - if ((arena=GrowArena(arena, ArenaLimit(arena), old_sz, gsiz, 3 PASS_REGS))==0) { - Yap_Error(RESOURCE_ERROR_STACK, arena, LOCAL_ErrorMessage); - return 0L; - } - to = ARG3; - qd = RepAppl(Deref(ARG1)) + 1; - arena = GetQueueArena(qd, "enqueue"); - oldH = HR; - oldHB = HB; - HR = HB = ArenaPt(arena); - old_sz = ArenaSz(arena); - } + qd[QUEUE_SIZE] = Global_MkIntegerTerm(qsize + 1); if (qsize == 0) { qd[QUEUE_HEAD] = AbsPair(HR); @@ -1714,7 +1708,7 @@ static Int p_nb_queue_enqueue(USES_REGS1) { RESET_VARIABLE(HR); qd[QUEUE_TAIL] = (CELL)HR; HR++; - CloseArena(oldH, oldHB, ASP, qd + QUEUE_ARENA, old_sz PASS_REGS); + CloseArena(&cspace, qd + QUEUE_ARENA, old_sz PASS_REGS); return TRUE; } @@ -1722,7 +1716,7 @@ static Int p_nb_queue_dequeue(USES_REGS1) { CELL *qd = GetQueue(ARG1, "dequeue"); UInt old_sz, qsz; Term arena, out; - CELL *oldH, *oldHB; + cell_space_t cspace; if (!qd) return FALSE; @@ -1736,10 +1730,9 @@ static Int p_nb_queue_dequeue(USES_REGS1) { out = HeadOfTerm(qd[QUEUE_HEAD]); qd[QUEUE_HEAD] = TailOfTerm(qd[QUEUE_HEAD]); /* garbage collection ? */ - oldH = HR; - oldHB = HB; + enter_cell_space(&cspace); qd[QUEUE_SIZE] = Global_MkIntegerTerm(qsz - 1); - CloseArena(oldH, oldHB, ASP, &arena, old_sz PASS_REGS); + CloseArena(&cspace, &arena, old_sz PASS_REGS); return Yap_unify(out, ARG2); } @@ -1836,6 +1829,7 @@ static Term MkZeroApplTerm(Functor f, UInt sz USES_REGS) { static Int p_nb_heap(USES_REGS1) { Term heap_arena, heap, *ar, *nar; UInt hsize; + cell_space_t cspace; Term tsize = Deref(ARG1); UInt arena_sz = (ASP-HR) / 16; @@ -1866,7 +1860,7 @@ static Int p_nb_heap(USES_REGS1) { ar[HEAP_MAX] = tsize; if (arena_sz < 1024) arena_sz = 1024; - heap_arena = NewArena(arena_sz, worker_id, 1, NULL); + heap_arena = NewArena(arena_sz, worker_id, 1, NULL, &cspace); if (heap_arena == 0L) { return FALSE; } @@ -1944,10 +1938,11 @@ static void DelHeapRoot(CELL *pt, UInt sz) { } static Int p_nb_heap_add_to_heap(USES_REGS1) { - CELL *qd = GetHeap(ARG1, "add_to_heap"), *oldH, *oldHB, *pt; + CELL *qd = GetHeap(ARG1, "add_to_heap"), *pt; UInt hsize, hmsize, old_sz; Term arena, to, key; UInt mingrow; + cell_space_t cspace; if (!qd) return FALSE; @@ -1969,7 +1964,8 @@ restart: "No Stack Space for Non-Backtrackable terms"); return FALSE; } - extra_size = extra_size / (2 * sizeof(CELL)); + enter_cell_space(&cspace); + extra_size = extra_size / (2 * sizeof(CELL)); qd = GetHeap(ARG1, "add_to_heap"); hmsize += extra_size; if (!qd) @@ -1984,11 +1980,9 @@ restart: } arena = qd[HEAP_ARENA]; old_sz = ArenaSz(arena); - oldH = HR; - oldHB = HB; HR = HB = ArenaPt(arena); qd[HEAP_MAX] = Global_MkIntegerTerm(hmsize); - CloseArena(oldH, oldHB, ASP, qd + HEAP_ARENA, old_sz PASS_REGS); + CloseArena(&cspace, qd + HEAP_ARENA, old_sz PASS_REGS); goto restart; } arena = qd[HEAP_ARENA]; @@ -2008,30 +2002,25 @@ restart: qd = GetHeap(ARG1, "add_to_heap"); arena = qd[HEAP_ARENA]; /* garbage collection ? */ - oldH = HR; - oldHB = HB; + enter_cell_space(&cspace); HR = HB = ArenaPt(arena); old_sz = ArenaSz(arena); while (old_sz < MIN_ARENA_SIZE) { UInt gsiz = hsize * 2; - HR = oldH; - HB = oldHB; if (gsiz > 1024 * 1024) { gsiz = 1024 * 1024; } else if (gsiz < 1024) { gsiz = 1024; } ARG3 = to; - if ((arena=GrowArena(arena, ArenaLimit(arena), old_sz, gsiz, 3 PASS_REGS))==0) { + if ((arena=GrowArena(arena, ArenaLimit(arena), old_sz, gsiz, 3, &cspace PASS_REGS))==0) { Yap_Error(RESOURCE_ERROR_STACK, arena, LOCAL_ErrorMessage); return 0L; } to = ARG3; qd = RepAppl(Deref(ARG1)) + 1; arena = qd[HEAP_ARENA]; - oldH = HR; - oldHB = HB; HR = HB = ArenaPt(arena); old_sz = ArenaSz(arena); } @@ -2040,7 +2029,7 @@ restart: pt[2 * hsize + 1] = to; PushHeap(pt, hsize); qd[HEAP_SIZE] = Global_MkIntegerTerm(hsize + 1); - CloseArena(oldH, oldHB, ASP, qd + HEAP_ARENA, old_sz PASS_REGS); + CloseArena(&cspace, qd + HEAP_ARENA, old_sz PASS_REGS); return TRUE; } @@ -2098,6 +2087,7 @@ static Int p_nb_heap_size(USES_REGS1) { } static Int p_nb_beam(USES_REGS1) { + cell_space_t cspace; Term beam_arena, beam, *ar, *nar; UInt hsize; Term tsize = Deref(ARG1); @@ -2128,7 +2118,7 @@ static Int p_nb_beam(USES_REGS1) { ar[HEAP_MAX] = tsize; if (arena_sz < 1024) arena_sz = 1024; - beam_arena = NewArena(arena_sz, worker_id, 1, NULL); + beam_arena = NewArena(arena_sz, worker_id, 1, NULL, &cspace); if (beam_arena == 0L) { return FALSE; } @@ -2337,10 +2327,11 @@ static Term DelBeamMin(CELL *pt, CELL *pt2, UInt sz) { } static Int p_nb_beam_add_to_beam(USES_REGS1) { - CELL *qd = GetHeap(ARG1, "add_to_beam"), *oldH, *oldHB, *pt; + CELL *qd = GetHeap(ARG1, "add_to_beam"), *pt; UInt hsize, hmsize, old_sz; Term arena, to, qsize, key; UInt mingrow; +cell_space_t cspace; if (!qd) return FALSE; @@ -2371,15 +2362,12 @@ static Int p_nb_beam_add_to_beam(USES_REGS1) { qd = GetHeap(ARG1, "add_to_beam"); arena = qd[HEAP_ARENA]; /* garbage collection ? */ - oldH = HR; - oldHB = HB; + enter_cell_space(&cspace); HR = HB = ArenaPt(arena); old_sz = ArenaSz(arena); qsize = IntegerOfTerm(qd[QUEUE_SIZE]); while (old_sz < MIN_ARENA_SIZE) { UInt gsiz = HR - RepPair(qd[QUEUE_HEAD]); - HR = oldH; - HB = oldHB; if (gsiz > 1024 * 1024) { gsiz = 1024 * 1024; } else if (gsiz < 1024) { @@ -2387,22 +2375,19 @@ static Int p_nb_beam_add_to_beam(USES_REGS1) { } ARG3 = to; /* fprintf(stderr,"growing %ld cells\n",(unsigned long int)gsiz);*/ - if (!GrowArena(arena, ArenaLimit(arena), old_sz, gsiz, 3 PASS_REGS)) { + if (!GrowArena(arena, ArenaLimit(arena), old_sz, gsiz, 3, &cspace PASS_REGS)) { Yap_Error(RESOURCE_ERROR_STACK, arena, LOCAL_ErrorMessage); return 0L; } to = ARG3; qd = RepAppl(Deref(ARG1)) + 1; arena = qd[HEAP_ARENA]; - oldH = HR; - oldHB = HB; - HR = HB = ArenaPt(arena); old_sz = ArenaSz(arena); } pt = qd + HEAP_START; PushBeam(pt, pt + 2 * hmsize, hsize, key, to); qd[HEAP_SIZE] = Global_MkIntegerTerm(hsize + 1); - CloseArena(oldH, oldHB, ASP, qd + HEAP_ARENA, old_sz PASS_REGS); + CloseArena(&cspace, qd + HEAP_ARENA, old_sz PASS_REGS); return TRUE; } @@ -2410,8 +2395,8 @@ static Int p_nb_beam_del(USES_REGS1) { CELL *qd = GetHeap(ARG1, "debeam"); UInt old_sz, qsz; Term arena; - CELL *oldH, *oldHB; Term tk, tv; + cell_space_t cspace; if (!qd) return FALSE; @@ -2423,10 +2408,9 @@ static Int p_nb_beam_del(USES_REGS1) { return FALSE; old_sz = ArenaSz(arena); /* garbage collection ? */ - oldH = HR; - oldHB = HB; + enter_cell_space(&cspace); qd[HEAP_SIZE] = Global_MkIntegerTerm(qsz - 1); - CloseArena(oldH, oldHB, ASP, &arena, old_sz PASS_REGS); + CloseArena(&cspace, &arena, old_sz PASS_REGS); tk = qd[HEAP_START]; tv = DelBeamMin(qd + HEAP_START, qd + (HEAP_START + 2 * IntegerOfTerm(qd[HEAP_MAX])), qsz); diff --git a/C/grow.c b/C/grow.c index c41eb58d9..d70562173 100755 --- a/C/grow.c +++ b/C/grow.c @@ -990,7 +990,6 @@ static_growglobal(size_t request, CELL **ptr, CELL *hsplit USES_REGS) LOCAL_LDiff = LOCAL_TrDiff = 0; LOCAL_BaseDiff = 0; } - printf("grow=%d\n", LOCAL_LDiff); /* now, remember we have delay -- global with a hole in delay or a hole in global */ if (!hsplit) { @@ -1009,7 +1008,6 @@ static_growglobal(size_t request, CELL **ptr, CELL *hsplit USES_REGS) LOCAL_GSplit = hsplit; LOCAL_XDiff = LOCAL_HDiff = 0; LOCAL_GlobalBase = old_GlobalBase; - fprintf(stderr,"off %d 5d %d\n", LOCAL_GDiff0, LOCAL_GDiff, LOCAL_LDiff); SetHeapRegs(FALSE PASS_REGS); if (do_grow) { MoveLocalAndTrail( PASS_REGS1 ); @@ -1490,7 +1488,7 @@ Yap_growheap(bool fix_code, size_t in_size, void *cip) int Yap_growheap_in_parser(tr_fr_ptr *old_trp, TokEntry **tksp, VarEntry **vep) { - CACHE_REGS + CACHE_REGS int res; res=do_growheap(FALSE, 0L, NULL, old_trp, tksp, vep PASS_REGS); diff --git a/C/prim_absmi_insts.h b/C/prim_absmi_insts.h index fc10ba1a4..d1ac34027 100644 --- a/C/prim_absmi_insts.h +++ b/C/prim_absmi_insts.h @@ -1949,11 +1949,12 @@ Op(p_arg_vv, xxx); #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { - HR[0] = XREG(PREG->y_u.xxx.x1); - HR[1] = XREG(PREG->y_u.xxx.x2); - RESET_VARIABLE(HR + 2); + Term ts[3]; + ts[0] = XREG(PREG->y_u.xxx.x1); + ts[1] = XREG(PREG->y_u.xxx.x2); + RESET_VARIABLE(ts + 2); low_level_trace(enter_pred, - RepPredProp(Yap_GetPredPropByFunc(FunctorArg, 0)), HR); + RepPredProp(Yap_GetPredPropByFunc(FunctorArg, 0)), ts); } #endif /* LOW_LEVEL_TRACE */ BEGD(d0); @@ -2045,12 +2046,13 @@ Yap_AsmError( DOMAIN_ERROR_NOT_LESS_THAN_ZERO ); #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { CELL *Ho = HR; + Term ts[3]; Term t = MkIntegerTerm(PREG->y_u.xxn.c); - HR[0] = t; - HR[1] = XREG(PREG->y_u.xxn.xi); - RESET_VARIABLE(HR + 2); + ts[0] = t; + ts[1] = XREG(PREG->y_u.xxn.xi); + RESET_VARIABLE(ts + 2); low_level_trace(enter_pred, - RepPredProp(Yap_GetPredPropByFunc(FunctorArg, 0)), HR); + RepPredProp(Yap_GetPredPropByFunc(FunctorArg, 0)), ts); HR = Ho; } #endif /* LOW_LEVEL_TRACE */ @@ -2118,12 +2120,13 @@ Yap_AsmError( DOMAIN_ERROR_NOT_LESS_THAN_ZERO ); Op(p_arg_y_vv, yxx); #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { - HR[0] = XREG(PREG->y_u.yxx.x1); - HR[1] = XREG(PREG->y_u.yxx.x2); - HR[2] = YREG[PREG->y_u.yxx.y]; - RESET_VARIABLE(HR + 2); + Term ts[3]; + ts[0] = XREG(PREG->y_u.yxx.x1); + ts[1] = XREG(PREG->y_u.yxx.x2); + ts[2] = YREG[PREG->y_u.yxx.y]; + RESET_VARIABLE(ts + 2); low_level_trace(enter_pred, - RepPredProp(Yap_GetPredPropByFunc(FunctorArg, 0)), HR); + RepPredProp(Yap_GetPredPropByFunc(FunctorArg, 0)), ts); } #endif /* LOW_LEVEL_TRACE */ BEGD(d0); @@ -2216,13 +2219,14 @@ Yap_AsmError( DOMAIN_ERROR_NOT_LESS_THAN_ZERO ); #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { CELL *Ho = HR; + Term ts[3]; Term t = MkIntegerTerm(PREG->y_u.yxn.c); - HR[0] = t; - HR[1] = XREG(PREG->y_u.yxn.xi); - HR[2] = YREG[PREG->y_u.yxn.y]; - RESET_VARIABLE(HR + 2); + ts[0] = t; + ts[1] = XREG(PREG->y_u.yxn.xi); + ts[2] = YREG[PREG->y_u.yxn.y]; + RESET_VARIABLE(ts + 2); low_level_trace(enter_pred, - RepPredProp(Yap_GetPredPropByFunc(FunctorArg, 0)), HR); + RepPredProp(Yap_GetPredPropByFunc(FunctorArg, 0)), ts); HR = Ho; } #endif /* LOW_LEVEL_TRACE */ @@ -2295,12 +2299,13 @@ Yap_AsmError( DOMAIN_ERROR_NOT_LESS_THAN_ZERO ); restart_func2s: #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { - RESET_VARIABLE(HR); - HR[1] = XREG(PREG->y_u.xxx.x1); - HR[2] = XREG(PREG->y_u.xxx.x2); + Term ts[3]; + RESET_VARIABLE(ts); + ts[1] = XREG(PREG->y_u.xxx.x1); + ts[2] = XREG(PREG->y_u.xxx.x2); low_level_trace(enter_pred, RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor, 0)), - HR); + ts); } #endif /* LOW_LEVEL_TRACE */ /* We have to build the structure */ @@ -2412,12 +2417,13 @@ Yap_AsmError( DOMAIN_ERROR_NOT_LESS_THAN_ZERO ); restart_func2s_cv: #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { - RESET_VARIABLE(HR); - HR[1] = PREG->y_u.xxc.c; - HR[2] = XREG(PREG->y_u.xxc.xi); + Term ts[3]; + RESET_VARIABLE(ts); + ts[1] = PREG->y_u.xxc.c; + ts[2] = XREG(PREG->y_u.xxc.xi); low_level_trace(enter_pred, RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor, 0)), - HR); + ts); } #endif /* LOW_LEVEL_TRACE */ BEGD(d0); @@ -2517,15 +2523,16 @@ Yap_AsmError( DOMAIN_ERROR_NOT_LESS_THAN_ZERO ); #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { Term ti; + Term ts[3]; CELL *hi = HR; ti = MkIntegerTerm(PREG->y_u.xxn.c); - RESET_VARIABLE(HR); - HR[1] = XREG(PREG->y_u.xxn.xi); - HR[2] = ti; + RESET_VARIABLE(ts); + ts[1] = XREG(PREG->y_u.xxn.xi); + ts[2] = ti; low_level_trace(enter_pred, RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor, 0)), - HR); + ts); HR = hi; } #endif /* LOW_LEVEL_TRACE */ @@ -2611,12 +2618,13 @@ Yap_AsmError( DOMAIN_ERROR_NOT_LESS_THAN_ZERO ); restart_func2s_y: #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { - RESET_VARIABLE(HR); - HR[1] = XREG(PREG->y_u.yxx.x1); - HR[2] = XREG(PREG->y_u.yxx.x2); + Term ts[3]; + RESET_VARIABLE(ts); + ts[1] = XREG(PREG->y_u.yxx.x1); + ts[2] = XREG(PREG->y_u.yxx.x2); low_level_trace(enter_pred, RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor, 0)), - HR); + ts); } #endif /* LOW_LEVEL_TRACE */ /* We have to build the structure */ @@ -2735,12 +2743,13 @@ Yap_AsmError( DOMAIN_ERROR_NOT_LESS_THAN_ZERO ); restart_func2s_y_cv: #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { - RESET_VARIABLE(HR); - HR[1] = PREG->y_u.yxc.c; - HR[2] = XREG(PREG->y_u.yxc.xi); + Term ts[3]; + RESET_VARIABLE(ts); + ts[1] = PREG->y_u.yxc.c; + ts[2] = XREG(PREG->y_u.yxc.xi); low_level_trace(enter_pred, RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor, 0)), - HR); + ts); } #endif /* LOW_LEVEL_TRACE */ /* We have to build the structure */ @@ -2847,14 +2856,15 @@ Yap_AsmError( DOMAIN_ERROR_NOT_LESS_THAN_ZERO ); if (Yap_do_low_level_trace) { Term ti; CELL *hi = HR; + Term ts[3]; ti = MkIntegerTerm((Int)(PREG->y_u.yxn.c)); - RESET_VARIABLE(HR); - HR[1] = XREG(PREG->y_u.yxn.xi); - HR[2] = ti; + RESET_VARIABLE(ts); + ts[1] = XREG(PREG->y_u.yxn.xi); + ts[2] = ti; low_level_trace(enter_pred, RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor, 0)), - HR); + ts); HR = hi; } #endif /* LOW_LEVEL_TRACE */ @@ -2952,12 +2962,13 @@ Yap_AsmError( DOMAIN_ERROR_NOT_LESS_THAN_ZERO ); Op(p_func2f_xx, xxx); #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { - HR[0] = XREG(PREG->y_u.xxx.x); - RESET_VARIABLE(HR + 1); - RESET_VARIABLE(HR + 2); + Term ts[3]; + ts[0] = XREG(PREG->y_u.xxx.x); + RESET_VARIABLE(ts + 1); + RESET_VARIABLE(ts + 2); low_level_trace(enter_pred, RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor, 0)), - HR); + ts); } #endif /* LOW_LEVEL_TRACE */ BEGD(d0); @@ -3000,12 +3011,13 @@ Yap_AsmError( DOMAIN_ERROR_NOT_LESS_THAN_ZERO ); Op(p_func2f_xy, xxy); #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { - HR[0] = XREG(PREG->y_u.xxy.x); - RESET_VARIABLE(HR + 1); - RESET_VARIABLE(HR + 2); + Term ts[3]; + ts[0] = XREG(PREG->y_u.xxy.x); + RESET_VARIABLE(ts + 1); + RESET_VARIABLE(ts + 2); low_level_trace(enter_pred, RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor, 0)), - HR); + ts); } #endif /* LOW_LEVEL_TRACE */ BEGD(d0); @@ -3051,12 +3063,13 @@ Yap_AsmError( DOMAIN_ERROR_NOT_LESS_THAN_ZERO ); Op(p_func2f_yx, yxx); #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { - HR[0] = XREG(PREG->y_u.yxx.x2); - RESET_VARIABLE(HR + 1); - RESET_VARIABLE(HR + 2); + Term ts[3]; + ts[0] = XREG(PREG->y_u.yxx.x2); + RESET_VARIABLE(ts + 1); + RESET_VARIABLE(ts + 2); low_level_trace(enter_pred, RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor, 0)), - HR); + ts); } #endif /* LOW_LEVEL_TRACE */ BEGD(d0); @@ -3102,12 +3115,13 @@ Yap_AsmError( DOMAIN_ERROR_NOT_LESS_THAN_ZERO ); Op(p_func2f_yy, yyx); #ifdef LOW_LEVEL_TRACER if (Yap_do_low_level_trace) { - HR[0] = XREG(PREG->y_u.yyx.x); - RESET_VARIABLE(HR + 1); - RESET_VARIABLE(HR + 2); + Term ts[3]; + ts[0] = XREG(PREG->y_u.yyx.x); + RESET_VARIABLE(ts + 1); + RESET_VARIABLE(ts + 2); low_level_trace(enter_pred, RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor, 0)), - HR); + ts); } #endif /* LOW_LEVEL_TRACE */ BEGD(d0); diff --git a/C/scanner.c b/C/scanner.c index 960c41cfd..cdb06f1bb 100755 --- a/C/scanner.c +++ b/C/scanner.c @@ -1319,6 +1319,7 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, TokEntry *t, *l, *p; enum TokenKinds kind; int solo_flag = TRUE; + int lvl = push_text_stack(); int32_t ch, och = ' '; struct qq_struct_t *cur_qq = NULL; int sign = 1; @@ -1348,6 +1349,7 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, t = (TokEntry *)AllocScannerMemory(sizeof(TokEntry)); t->TokNext = NULL; if (t == NULL) { + pop_text_stack(lvl); return TrailSpaceError(p, l); } if (!l) @@ -1418,7 +1420,8 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, imgsz = Yap_Min(imgsz * 2, imgsz + MBYTE); TokImage = Realloc(p0, imgsz); if (TokImage == NULL) { - return CodeSpaceError(t, p, l); + pop_text_stack(lvl); + return CodeSpaceError(t, p, l); } charp =(unsigned char *) TokImage + (charp - p0); } @@ -1427,7 +1430,8 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, while (ch == '\'' && isvar && trueGlobalPrologFlag(VARIABLE_NAMES_MAY_END_WITH_QUOTES_FLAG)) { if (charp == (unsigned char *)AuxSp - 1024) { - return CodeSpaceError(t, p, l); + pop_text_stack(lvl); + return CodeSpaceError(t, p, l); } add_ch_to_buff(ch); ch = getchr(st); @@ -1438,7 +1442,8 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, /* don't do this in iso */ ae = Yap_LookupAtom(TokImage); if (ae == NIL) { - return CodeSpaceError(t, p, l); + pop_text_stack(lvl); + return CodeSpaceError(t, p, l); } t->TokInfo = MkAtomTerm(ae); if (ch == '(') @@ -1470,7 +1475,8 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, t->TokInfo = TermError; } /* serious error now */ - return l; + pop_text_stack(lvl); + return l; } ch = cha; if (cherr) { @@ -1480,7 +1486,8 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, t->TokLine = GetCurInpLine(st); e = (TokEntry *)AllocScannerMemory(sizeof(TokEntry)); if (e == NULL) { - return TrailSpaceError(p, l); + pop_text_stack(lvl); + return TrailSpaceError(p, l); } else { e->TokNext = NULL; @@ -1506,7 +1513,8 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, t->TokLine = GetCurInpLine(st); e2 = (TokEntry *)AllocScannerMemory(sizeof(TokEntry)); if (e2 == NULL) { - return TrailSpaceError(p, l); + pop_text_stack(lvl); + return TrailSpaceError(p, l); } else { e2->TokNext = NULL; } @@ -1540,7 +1548,8 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, t->TokPos = GetCurInpPos(st); e2 = (TokEntry *)AllocScannerMemory(sizeof(TokEntry)); if (e2 == NULL) { - return TrailSpaceError(p, l); + pop_text_stack(lvl); + return TrailSpaceError(p, l); } else { e2->TokNext = NULL; } @@ -1570,7 +1579,8 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, size_t sz = charp-(unsigned char *)TokImage; TokImage = Realloc(TokImage, (imgsz = Yap_Min(imgsz * 2, imgsz + MBYTE))); if (TokImage == NULL) { - return CodeSpaceError(t, p, l); + pop_text_stack(lvl); + return CodeSpaceError(t, p, l); } charp = (unsigned char *)TokImage+sz; break; @@ -1609,20 +1619,23 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, t->TokInfo = Yap_CharsToTDQ((char *)TokImage, CurrentModule, LOCAL_encoding PASS_REGS); if (!(t->TokInfo)) { - return CodeSpaceError(t, p, l); + pop_text_stack(lvl); + return CodeSpaceError(t, p, l); } t->Tok = Ord(kind = String_tok); } else if (quote == '`') { t->TokInfo = Yap_CharsToTBQ((char *)TokImage, CurrentModule, LOCAL_encoding PASS_REGS); if (!(t->TokInfo)) { - return CodeSpaceError(t, p, l); + pop_text_stack(lvl); + return CodeSpaceError(t, p, l); } t->Tok = Ord(kind = String_tok); } else { t->TokInfo = MkAtomTerm(Yap_LookupAtom(TokImage)); if (!(t->TokInfo)) { - return CodeSpaceError(t, p, l); + pop_text_stack(lvl); + return CodeSpaceError(t, p, l); } t->Tok = Ord(kind = Name_tok); if (ch == '(') @@ -1642,7 +1655,8 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, t->TokInfo = TermNewLine; } t->TokInfo = TermEof; - return l; + pop_text_stack(lvl); + return l; } else ch = getchr(st); break; @@ -1656,9 +1670,11 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, // consume... if (pch == '%') { t->TokInfo = TermNewLine; - return l; + pop_text_stack(lvl); + return l; } - return l; + pop_text_stack(lvl); + return l; } if (ch == '`') goto quoted_string; @@ -1669,7 +1685,8 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, t->Tok = Ord(kind = eot_tok); if (ch == '%') { t->TokInfo = TermNewLine; - return l; + pop_text_stack(lvl); + return l; } if (chtype(ch) == EF) { mark_eof(st); @@ -1677,7 +1694,8 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, } else { t->TokInfo = TermNewLine; } - return l; + pop_text_stack(lvl); + return l; } } if (och == '/' && ch == '*') { @@ -1726,7 +1744,8 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, t->Tok = Ord(kind = eot_tok); if (ch == '%') { t->TokInfo = TermNewLine; - return l; + pop_text_stack(lvl); + return l; } if (chtype(ch) == EF) { mark_eof(st); @@ -1734,7 +1753,8 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, } else { t->TokInfo = TermNl; } - return l; + pop_text_stack(lvl); + return l; } else { Atom ae; charp = (unsigned char *)TokImage; @@ -1744,8 +1764,10 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, size_t sz = charp - (unsigned char *)TokImage; imgsz = Yap_Min(imgsz * 2, imgsz + MBYTE); TokImage = Realloc(TokImage, imgsz); - if (!TokImage) - return CodeSpaceError(t, p, l); + if (!TokImage) { + pop_text_stack(lvl); + return CodeSpaceError(t, p, l); + } charp = (unsigned char *)TokImage+sz; } add_ch_to_buff(ch); @@ -1753,11 +1775,13 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, add_ch_to_buff('\0'); ae = Yap_LookupAtom(TokImage); if (ae == NIL) { - return CodeSpaceError(t, p, l); + pop_text_stack(lvl); + return CodeSpaceError(t, p, l); } t->TokInfo = MkAtomTerm(ae); if (t->TokInfo == (CELL)NIL) { - return CodeSpaceError(t, p, l); + pop_text_stack(lvl); + return CodeSpaceError(t, p, l); } t->Tok = Ord(kind = Name_tok); if (ch == '(') @@ -1820,15 +1844,16 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, LOCAL_ErrorMessage = "not enough heap space to read in quasi quote"; t->Tok = Ord(kind = eot_tok); t->TokInfo = TermOutOfHeapError; - return l; + pop_text_stack(lvl); + return l; } if (cur_qq) { LOCAL_ErrorMessage = "quasi quote in quasi quote"; Yap_ReleasePreAllocCodeSpace((CODEADDR)TokImage); t->Tok = Ord(kind = eot_tok); t->TokInfo = TermOutOfHeapError; - Free(qq); - return l; + pop_text_stack(lvl); + return l; } else { cur_qq = qq; } @@ -1865,7 +1890,8 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, cur_qq = NULL; t->Tok = Ord(kind = eot_tok); t->TokInfo = TermError; - return l; + pop_text_stack(lvl); + return l; } cur_qq = NULL; t->TokInfo = (CELL)qq; @@ -1910,7 +1936,8 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, LOCAL_ErrorMessage = "not enough heap space to read in quasi quote"; t->Tok = Ord(kind = eot_tok); t->TokInfo = TermOutOfHeapError; - return l; + pop_text_stack(lvl); + return l; } strncpy((char *)mp, (const char *)TokImage, len + 1); qq->text = (unsigned char *)mp; @@ -1923,7 +1950,8 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, qq->end.linepos = st->linepos - 1; qq->end.charno = st->charcount - 1; if (!(t->TokInfo)) { - return CodeSpaceError(t, p, l); + pop_text_stack(lvl); + return CodeSpaceError(t, p, l); } Yap_ReleasePreAllocCodeSpace((CODEADDR)TokImage); solo_flag = FALSE; @@ -1936,7 +1964,8 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, mark_eof(st); t->Tok = Ord(kind = eot_tok); t->TokInfo = TermEof; - return l; + pop_text_stack(lvl); + return l; default: { kind = Error_tok; @@ -1951,7 +1980,8 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, /* insert an error token to inform the system of what happened */ TokEntry *e = (TokEntry *)AllocScannerMemory(sizeof(TokEntry)); if (e == NULL) { - return TrailSpaceError(p, l); + pop_text_stack(lvl); + return TrailSpaceError(p, l); } p->TokNext = e; e->Tok = Error_tok; @@ -1963,6 +1993,7 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, p = e; } } while (kind != eot_tok); + pop_text_stack(lvl); return (l); } diff --git a/H/YapText.h b/H/YapText.h index 822bd8bec..0adabe59b 100644 --- a/H/YapText.h +++ b/H/YapText.h @@ -47,20 +47,20 @@ extern const void *MallocExportAsRO(const void *blk); extern int AllocLevel(void); #define push_text_stack() \ - (/* fprintf(stderr, " + *** %d %s:%s:%d\n", AllocLevel(),*/ \ - /* __FILE__, __FUNCTION__, __LINE__), */ \ + ( fprintf(stderr, " + *** %d %s:%s:%d\n", AllocLevel(), \ + __FILE__, __FUNCTION__, __LINE__), \ push_text_stack__(PASS_REGS1)) extern int push_text_stack__(USES_REGS1); #define pop_text_stack(lvl) \ - (/* fprintf(stderr, " - *** %d %s:%s:%d\n", AllocLevel(), __FILE__,*/ \ - /* __FUNCTION__, __LINE__), */ \ + ( fprintf(stderr, " - *** %d %s:%s:%d\n", AllocLevel(), __FILE__, \ + __FUNCTION__, __LINE__), \ pop_text_stack__(lvl)) extern int pop_text_stack__(int lvl USES_REGS); #define pop_output_text_stack(lvl,p) \ - (/*fprintf(stderr, "-- *** %d %s:%s:%d\n", AllocLevel(), __FILE__,*/ \ - /* __FUNCTION__, __LINE__),*/ \ + (fprintf(stderr, "-- *** %d %s:%s:%d\n", AllocLevel(), __FILE__, \ + __FUNCTION__, __LINE__), \ pop_output_text_stack__(lvl,p)) extern void *pop_output_text_stack__(int lvl, const void *ox USES_REGS); diff --git a/H/Yapproto.h b/H/Yapproto.h index 5e1999050..44eca3def 100755 --- a/H/Yapproto.h +++ b/H/Yapproto.h @@ -247,7 +247,7 @@ extern Term Yap_SaveTerm(Term); extern Term Yap_SetGlobalVal(Atom, Term); extern Term Yap_GetGlobal(Atom); extern Int Yap_DeleteGlobal(Atom); -extern void Yap_AllocateDefaultArena(size_t gsize, int wid); +extern void Yap_AllocateDefaultArena(size_t gsize, int wid, void *cs); extern CELL *Yap_ArenaLimit(Term arena); /* grow.c */ diff --git a/pl/absf.yap b/pl/absf.yap index f9c809da6..57674d888 100755 --- a/pl/absf.yap +++ b/pl/absf.yap @@ -334,7 +334,7 @@ prolog_file_name(File, PrologFileName) :- system:true_file_name(File, PrologFileName). prolog_file_name(File, PrologFileName) :- '$do_error'(type_error(atom,File), prolog_file_name(File, PrologFileName)). - +:- start_low_level_trace. /** @pred path(-Directories:list) is det,deprecated @@ -344,6 +344,7 @@ prolog_file_name(File, PrologFileName) :- */ path(Path) :- findall(X,'$in_path'(X),Path). +:- stop_low_level_trace. '$in_path'(X) :- recorded('$path',Path,_), From 86d6751c98cca2eb0067c8f04503a68deb937d9b Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Thu, 2 May 2019 20:54:22 +0100 Subject: [PATCH 20/29] glucose-4 --- packages/bee/glucose-4/LICENCE | 47 ++++++++++++++++++++++++++++++++++ packages/bee/glucose-4/README | 24 +++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 packages/bee/glucose-4/LICENCE create mode 100644 packages/bee/glucose-4/README diff --git a/packages/bee/glucose-4/LICENCE b/packages/bee/glucose-4/LICENCE new file mode 100644 index 000000000..6fa3b63ae --- /dev/null +++ b/packages/bee/glucose-4/LICENCE @@ -0,0 +1,47 @@ + Glucose -- Copyright (c) 2009-2014, Gilles Audemard, Laurent Simon + CRIL - Univ. Artois, France + LRI - Univ. Paris Sud, France (2009-2013) + Labri - Univ. Bordeaux, France + + Syrup (Glucose Parallel) -- Copyright (c) 2013-2014, Gilles Audemard, Laurent Simon + CRIL - Univ. Artois, France + Labri - Univ. Bordeaux, France + +Glucose sources are based on MiniSat (see below MiniSat copyrights). Permissions and copyrights of +Glucose (sources until 2013, Glucose 3.0, single core) are exactly the same as Minisat on which it +is based on. (see below). + +Glucose-Syrup sources are based on another copyright. Permissions and copyrights for the parallel +version of Glucose-Syrup (the "Software") are granted, free of charge, to deal with the Software +without restriction, including the rights to use, copy, modify, merge, publish, distribute, +sublicence, and/or sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +- The above and below copyrights notices and this permission notice shall be included in all +copies or substantial portions of the Software; +- The parallel version of Glucose (all files modified since Glucose 3.0 releases, 2013) cannot +be used in any competitive event (sat competitions/evaluations) without the express permission of +the authors (Gilles Audemard / Laurent Simon). This is also the case for any competitive event +using Glucose Parallel as an embedded SAT engine (single core or not). + + +--------------- Original Minisat Copyrights + +Copyright (c) 2003-2006, Niklas Een, Niklas Sorensson +Copyright (c) 2007-2010, Niklas Sorensson + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and +associated documentation files (the "Software"), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, +sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT +NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT +OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/packages/bee/glucose-4/README b/packages/bee/glucose-4/README new file mode 100644 index 000000000..19cd95f42 --- /dev/null +++ b/packages/bee/glucose-4/README @@ -0,0 +1,24 @@ +Directory overview: +================== + +mtl/ Minisat Template Library +core/ A core version of the solver glucose (no main here) +simp/ An extended solver with simplification capabilities +parallel/ A multicore version of glucose +README +LICENSE +Changelog + +To build (release version: without assertions, statically linked, etc): +====================================================================== +Like minisat.... + +cd { simp | parallel } +make rs + +Usage: +====== + +in simp directory: ./glucose --help + +in parallel directory: ./glucose-syrup --help \ No newline at end of file From 91a79d778b44f65e331a982c1314f0d5383622f3 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Fri, 3 May 2019 01:03:22 +0100 Subject: [PATCH 21/29] fix global overfloow. --- C/globals.c | 4 ++-- H/YapText.h | 19 ++++++++++++++----- pl/absf.yap | 4 ++-- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/C/globals.c b/C/globals.c index 27c5cccfc..7d8ca0126 100644 --- a/C/globals.c +++ b/C/globals.c @@ -1550,7 +1550,6 @@ static Int nb_queue(UInt arena_sz USES_REGS) { cell_space_t cspace; Term queue_arena, queue, ar[QUEUE_FUNCTOR_ARITY], *nar; Term t = Deref(ARG1); -enter_cell_space(&cspace); LOCAL_DepthArenas++; if (!IsVarTerm(t)) { if (!IsApplTerm(t)) { @@ -1565,13 +1564,14 @@ enter_cell_space(&cspace); return FALSE; if (arena_sz < 32 * 1024) arena_sz = 32 * 1024; + enter_cell_space(&cspace); queue_arena = NewArena(arena_sz, worker_id, 1, NULL, &cspace); if (queue_arena == 0L) { return FALSE; } nar = RepAppl(Deref(ARG1)) + 1; nar[QUEUE_ARENA] = queue_arena; - return TRUE; + return true; } static Int p_nb_queue(USES_REGS1) { diff --git a/H/YapText.h b/H/YapText.h index 0adabe59b..dbf972f9f 100644 --- a/H/YapText.h +++ b/H/YapText.h @@ -46,22 +46,31 @@ extern const void *MallocExportAsRO(const void *blk); /* Character types for tokenizer and write.c */ extern int AllocLevel(void); +#if 0 #define push_text_stack() \ ( fprintf(stderr, " + *** %d %s:%s:%d\n", AllocLevel(), \ __FILE__, __FUNCTION__, __LINE__), \ push_text_stack__(PASS_REGS1)) -extern int push_text_stack__(USES_REGS1); -#define pop_text_stack(lvl) \ + #define pop_text_stack(lvl) \ ( fprintf(stderr, " - *** %d %s:%s:%d\n", AllocLevel(), __FILE__, \ __FUNCTION__, __LINE__), \ - pop_text_stack__(lvl)) -extern int pop_text_stack__(int lvl USES_REGS); + pop_text_stack__(lvl PASS_REGS)) -#define pop_output_text_stack(lvl,p) \ + #define pop_output_text_stack(lvl,p) \ (fprintf(stderr, "-- *** %d %s:%s:%d\n", AllocLevel(), __FILE__, \ __FUNCTION__, __LINE__), \ pop_output_text_stack__(lvl,p)) +#else +#define push_text_stack() push_text_stack__(PASS_REGS1) +#define pop_text_stack(lvl) pop_text_stack__(lvl PASS_REGS) +#define pop_output_text_stack(lvl,p) pop_output_text_stack__(lvl,p PASS_REGS) +#endif + +extern int push_text_stack__(USES_REGS1); +extern int pop_text_stack__(int lvl USES_REGS); + + extern void *pop_output_text_stack__(int lvl, const void *ox USES_REGS); /****************** character definition table **************************/ diff --git a/pl/absf.yap b/pl/absf.yap index 57674d888..e35ffb55b 100755 --- a/pl/absf.yap +++ b/pl/absf.yap @@ -334,7 +334,7 @@ prolog_file_name(File, PrologFileName) :- system:true_file_name(File, PrologFileName). prolog_file_name(File, PrologFileName) :- '$do_error'(type_error(atom,File), prolog_file_name(File, PrologFileName)). -:- start_low_level_trace. + /** @pred path(-Directories:list) is det,deprecated @@ -344,7 +344,7 @@ prolog_file_name(File, PrologFileName) :- */ path(Path) :- findall(X,'$in_path'(X),Path). -:- stop_low_level_trace. + '$in_path'(X) :- recorded('$path',Path,_), From 874f6214772c7b6afd02210e55abed839bb8ca07 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Fri, 3 May 2019 12:40:47 +0100 Subject: [PATCH 22/29] ovfl --- C/globals.c | 16 +++--- C/grow.c | 6 --- C/terms.c | 141 ++++++++++++++++++++++++++++++++++++-------------- C/text.c | 3 +- C/utilpreds.c | 17 +++--- 5 files changed, 123 insertions(+), 60 deletions(-) diff --git a/C/globals.c b/C/globals.c index 7d8ca0126..637066b64 100644 --- a/C/globals.c +++ b/C/globals.c @@ -285,7 +285,6 @@ static Term GrowArena(Term arena, CELL *pt, size_t old_size, size_t size, if (size < 4*MIN_ARENA_SIZE) { size = 4*MIN_ARENA_SIZE; } - exit_cell_space(cspace); while (HR + size > ASP - MIN_ARENA_SIZE) { XREGS[arity + 1] = arena; if (!Yap_gcl(size * sizeof(CELL), arity + 1, ENV, gc_P(P, CP))) { @@ -295,10 +294,10 @@ static Term GrowArena(Term arena, CELL *pt, size_t old_size, size_t size, arena = XREGS[arity + 1]; adjust_cps(size PASS_REGS); } - pt = ArenaLimit(arena)+1; + pt = ArenaLimit(arena); sz = old_size + size; if (pt == HR) { - HR += size+1; + HR += size; HR[ - 1] = EndSpecials; } else { if ((sz = Yap_InsertInGlobal(pt, size * sizeof(CELL))) == 0) { @@ -669,12 +668,13 @@ static Term CopyTermToArena(Term t, Term arena, bool share, bool copy_att_vars, size_t min_grow USES_REGS) { size_t old_size = ArenaSz(arena); cell_space_t cspace; - enter_cell_space( & cspace); int res = 0; Term tn; + int restarts = 0; restart: t = Deref(t); + enter_cell_space( & cspace); if (IsVarTerm(t)) { ASP = ArenaLimit(arena); HR = HB = ArenaPt(arena); @@ -819,6 +819,8 @@ error_handler: case -1: if (arena == LOCAL_GlobalArena) LOCAL_GlobalArenaOverflows++; + restarts++; + min_grow += (restarts < 16 ? 16*1024*restarts*restarts : 128*1024*1024); if ((arena=GrowArena(arena, old_top, old_size, min_grow, arity + 3, &cspace PASS_REGS))==0) { Yap_Error(RESOURCE_ERROR_STACK, TermNil, LOCAL_ErrorMessage); return 0L; @@ -1678,8 +1680,10 @@ static Int p_nb_queue_enqueue(USES_REGS1) { if (!qd) return FALSE; arena = GetQueueArena(qd, "enqueue"); - if (arena == 0L) - return FALSE; + if (arena == 0L) { + return FALSE; + } + if (IsPairTerm(qd[QUEUE_HEAD])) { min_size = ArenaPt(arena) - RepPair(qd[QUEUE_HEAD]); } else { diff --git a/C/grow.c b/C/grow.c index d70562173..431af42c8 100755 --- a/C/grow.c +++ b/C/grow.c @@ -896,9 +896,6 @@ static_growglobal(size_t request, CELL **ptr, CELL *hsplit USES_REGS) Int size = request/sizeof(CELL); char vb_msg1 = '\0', *vb_msg2; bool do_grow = true; - - printf("request=%ld at %p, shift %p, %ld <-> %ld\n",request, hsplit, ptr,hsplit-H0,HR-hsplit); - /* request is the amount of memory we requesd, in bytes; base_move is the shift in global stacks we had to do @@ -911,8 +908,6 @@ static_growglobal(size_t request, CELL **ptr, CELL *hsplit USES_REGS) if (hsplit < H0 || hsplit > HR) return false; - if (hsplit == H0) - hsplit = NULL; if (hsplit == HR && Unsigned(HR)+request < Unsigned(ASP)-StackGap( PASS_REGS1 )) { return request; } @@ -1533,7 +1528,6 @@ UInt Yap_InsertInGlobal(CELL *where, size_t howmuch) { CACHE_REGS - printf("where=%p, hm=%d\n",where,howmuch); if ((howmuch = static_growglobal(howmuch, NULL, where PASS_REGS)) == 0) return 0; #ifdef TABLING diff --git a/C/terms.c b/C/terms.c index 4927b0df0..3839b6d6a 100644 --- a/C/terms.c +++ b/C/terms.c @@ -82,25 +82,20 @@ typedef struct non_single_struct_t { #define WALK_COMPLEX_TERM__(LIST0, STRUCT0, PRIMI0) \ \ - int lvl = push_text_stack();\ - CELL *pt0, *pt0_end; \ - size_t auxsz = 1024 * sizeof(struct non_single_struct_t);\ - struct non_single_struct_t *to_visit0=NULL, *to_visit,* to_visit_max;\ - CELL *InitialH = HR;\ - tr_fr_ptr TR0 = TR;\ - if (TR > (tr_fr_ptr)LOCAL_TrailTop - 256) { \ + reset:\ + lvl = push_text_stack();\ + to_visit0 = Malloc(auxsz); \ +pt0 = pt0_; pt0_end = pt0_end_; \ +to_visit = to_visit0, \ + to_visit_max = to_visit + auxsz/sizeof(struct non_single_struct_t);\ + \ + if (TR > (tr_fr_ptr)LOCAL_TrailTop - 256) { \ /* Trail overflow */\ goto trail_overflow;\ }\ if (HR + 1024 > ASP) { \ goto global_overflow;\ }\ - reset:\ - to_visit0 = Realloc(to_visit0,auxsz); \ -pt0 = pt0_; pt0_end = pt0_end_; \ -to_visit = to_visit0, \ - to_visit_max = to_visit + auxsz/sizeof(struct non_single_struct_t);\ - \ while (to_visit >= to_visit0) { \ CELL d0; \ CELL *ptd0; \ @@ -193,7 +188,8 @@ aux_overflow : { \ } \ clean_tr(TR0 PASS_REGS); \ auxsz += auxsz;\ - goto reset; } + pop_text_stack(lvl); \ + goto reset; } #define def_trail_overflow() \ trail_overflow: { \ @@ -221,6 +217,7 @@ global_overflow : { \ *ptd0 = to_visit->d0; \ } \ clean_tr(TR0 PASS_REGS); \ + pop_text_stack(lvl); \ HR = InitialH; \ LOCAL_Error_TYPE = RESOURCE_ERROR_STACK; \ size_t expand = 0L; \ @@ -228,7 +225,7 @@ global_overflow : { \ Yap_ThrowError(RESOURCE_ERROR_STACK, TermNil, sizeof(CELL)*(HR-H0)); \ return false;\ }\ - goto reset;\ + goto reset;\ } #define CYC_LIST \ @@ -261,6 +258,13 @@ if (IS_VISIT_MARKER) { \ @brief routine to locate all variables in a term, and its applications */ static Term cyclic_complex_term(CELL *pt0_, CELL *pt0_end_ USES_REGS) { + CELL *pt0, *pt0_end; + int lvl; + size_t auxsz = 1024 * sizeof(struct non_single_struct_t); + struct non_single_struct_t *to_visit0, *to_visit,* to_visit_max; + CELL *InitialH = HR; + tr_fr_ptr TR0 = TR; + WALK_COMPLEX_TERM__(CYC_LIST, CYC_APPL, {}); /* leave an empty slot to fill in later */ END_WALK(); @@ -308,21 +312,22 @@ static Term BREAK_LOOP(CELL d0,struct non_single_struct_t *to_visit ) { static int cycles_in_complex_term( CELL *pt0_, CELL *pt0_end_ USES_REGS) { CELL *pt0, *pt0_end; - int lvl = push_text_stack(); size_t auxsz = 1024 * sizeof(struct non_single_struct_t); - struct non_single_struct_t *to_visit0=NULL, *to_visit, *to_visit_max; + struct non_single_struct_t *to_visit0, *to_visit, *to_visit_max; + int lvl; + + reset: + lvl = push_text_stack(); + pt0 = pt0_, pt0_end = pt0_end_; + to_visit0 = Malloc(auxsz); + to_visit= to_visit0; + to_visit_max = to_visit0 + auxsz/sizeof(struct non_single_struct_t); CELL *InitialH = HR; tr_fr_ptr TR0 = TR; if (TR > (tr_fr_ptr)LOCAL_TrailTop - 256) { \ /* Trail overflow */\ goto trail_overflow;\ }\ - - reset: - pt0 = pt0_, pt0_end = pt0_end_; - to_visit0 = Realloc(to_visit0,auxsz); - to_visit= to_visit0; - to_visit_max = to_visit0 + auxsz/sizeof(struct non_single_struct_t); auxsz *= 2; int rc = 0; CELL *ptf; @@ -467,6 +472,12 @@ static Int cycles_in_term(USES_REGS1) /* cyclic_term(+T) */ @brief routine to locate all variables in a term, and its applications */ static bool ground_complex_term(CELL * pt0_, CELL * pt0_end_ USES_REGS) { + CELL *pt0, *pt0_end; + int lvl; + size_t auxsz = 1024 * sizeof(struct non_single_struct_t); + struct non_single_struct_t *to_visit0, *to_visit,* to_visit_max; + CELL *InitialH = HR; + tr_fr_ptr TR0 = TR; WALK_COMPLEX_TERM(); /* leave an empty slot to fill in later */ @@ -515,6 +526,12 @@ static Int ground(USES_REGS1) /* ground(+T) */ static Int var_in_complex_term(CELL *pt0_, CELL *pt0_end_ , Term v USES_REGS) { + CELL *pt0, *pt0_end; + int lvl; + size_t auxsz = 1024 * sizeof(struct non_single_struct_t); + struct non_single_struct_t *to_visit0, *to_visit,* to_visit_max; + CELL *InitialH = HR; + tr_fr_ptr TR0 = TR; WALK_COMPLEX_TERM(); @@ -596,7 +613,14 @@ static Term vars_in_complex_term(CELL *pt0_, CELL *pt0_end_ , } CELL output = AbsPair(HR); - WALK_COMPLEX_TERM(); + CELL *pt0, *pt0_end; + int lvl; + size_t auxsz = 1024 * sizeof(struct non_single_struct_t); + struct non_single_struct_t *to_visit0, *to_visit,* to_visit_max; + CELL *InitialH = HR; + tr_fr_ptr TR0 = TR; + + WALK_COMPLEX_TERM(); /* do or pt2 are unbound */ if (HR + 1024 > ASP) { @@ -756,6 +780,12 @@ typedef struct att_rec { static Term attvars_in_complex_term( CELL *pt0_, CELL *pt0_end_ , Term inp USES_REGS) { + CELL *pt0, *pt0_end; + int lvl; + size_t auxsz = 1024 * sizeof(struct non_single_struct_t); + struct non_single_struct_t *to_visit0, *to_visit,* to_visit_max; + CELL *InitialH = HR; + tr_fr_ptr TR0 = TR; CELL output = inp; WALK_COMPLEX_TERM(); if (IsAttVar(ptd0)) { @@ -821,27 +851,36 @@ static Int term_attvars(USES_REGS1) /* variables in term t */ */ static Term new_vars_in_complex_term( CELL *pt0_, CELL *pt0_end_ , Term inp USES_REGS) { + CELL *pt0, *pt0_end; + int lvl; + size_t auxsz = 1024 * sizeof(struct non_single_struct_t); + struct non_single_struct_t *to_visit0, *to_visit,* to_visit_max; + CELL *InitialH = HR; + tr_fr_ptr TR0 = TR; Int n=0; CELL output = TermNil; - { - int lvl = push_text_stack(); + Term inp0 = inp; + while (!IsVarTerm(inp) && IsPairTerm(inp)) { Term t = HeadOfTerm(inp); if (IsVarTerm(t)) { n++; - TrailTerm(TR++) = t; - *VarOfTerm(t) = TermFoundVar; - if ((tr_fr_ptr)LOCAL_TrailTop - TR < 1024) { - - if (!Yap_growtrail(n * sizeof(tr_fr_ptr *), true)) { - goto trail_overflow; - } - } - } - inp = TailOfTerm(inp); - } - pop_text_stack(lvl); - } + TrailTerm(TR++) = t; + *VarOfTerm(t) = TermFoundVar; + if ((tr_fr_ptr)LOCAL_TrailTop - TR < 1024) { + size_t expand = (tr_fr_ptr)LOCAL_TrailTop - TR; + clean_tr(TR0 PASS_REGS); + *HR++ = inp0; + /* Trail overflow */ + if (!Yap_growtrail(expand, false)) { + Yap_ThrowError(RESOURCE_ERROR_TRAIL, TermNil, expand); + } + inp = *--HR; + continue; + } + inp = TailOfTerm(inp); + } + } WALK_COMPLEX_TERM(); output = MkPairTerm((CELL)ptd0, output); TrailTerm(TR++) = *ptd0; @@ -904,6 +943,12 @@ static Term vars_within_complex_term( CELL *pt0_, CELL *pt0_end_, Term inp USES_REGS) { Int n=0; CELL output = AbsPair(HR); + CELL *pt0, *pt0_end; + int lvl; + size_t auxsz = 1024 * sizeof(struct non_single_struct_t); + struct non_single_struct_t *to_visit0, *to_visit,* to_visit_max; + CELL *InitialH = HR; + tr_fr_ptr TR0 = TR; while (!IsVarTerm(inp) && IsPairTerm(inp)) { Term t = HeadOfTerm(inp); @@ -1012,6 +1057,12 @@ return Yap_unify(ARG2, t) && Yap_unify(ARG3, out); static Term non_singletons_in_complex_term(CELL * pt0_, CELL * pt0_end_ USES_REGS) { + CELL *pt0, *pt0_end; + int lvl; + size_t auxsz = 1024 * sizeof(struct non_single_struct_t); + struct non_single_struct_t *to_visit0, *to_visit,* to_visit_max; + CELL *InitialH = HR; + tr_fr_ptr TR0 = TR; WALK_COMPLEX_TERM__({}, {}, FOUND_VAR_AGAIN()); /* do or pt2 are unbound */ @@ -1080,6 +1131,12 @@ if (singles) { \ static Int numbervars_in_complex_term(CELL * pt0_, CELL * pt0_end_, Int numbv, int singles USES_REGS) { + CELL *pt0, *pt0_end; + int lvl; + size_t auxsz = 1024 * sizeof(struct non_single_struct_t); + struct non_single_struct_t *to_visit0, *to_visit,* to_visit_max; + CELL *InitialH = HR; + tr_fr_ptr TR0 = TR; WALK_COMPLEX_TERM__({}, {}, {}); @@ -1162,6 +1219,12 @@ if (FunctorOfTerm(d0) == FunctorDollarVar) { \ static int max_numbered_var(CELL * pt0_, CELL * pt0_end_, Int * maxp USES_REGS) { + CELL *pt0, *pt0_end; + int lvl; + size_t auxsz = 1024 * sizeof(struct non_single_struct_t); + struct non_single_struct_t *to_visit0, *to_visit,* to_visit_max; + CELL *InitialH = HR; + tr_fr_ptr TR0 = TR; WALK_COMPLEX_TERM__({}, MAX_NUMBERED, {}); END_WALK(); diff --git a/C/text.c b/C/text.c index f7effd524..737ae5a88 100644 --- a/C/text.c +++ b/C/text.c @@ -195,7 +195,8 @@ void *Realloc(void *pt, size_t sz USES_REGS) { if (!pt) return Malloc(sz PASS_REGS); old--; - sz = ALIGN_BY_TYPE(sz + sizeof(struct mblock), Yap_Max(CELLSIZE,sizeof(struct mblock))); + sz = ALIGN_BY_TYPE(sz, Yap_Max(CELLSIZE,sizeof(struct mblock))); + sz += 2*sizeof(struct mblock); o = realloc(old, sz); if (o->next) { o->next->prev = o; diff --git a/C/utilpreds.c b/C/utilpreds.c index 153f8abbb..1c6b52e15 100644 --- a/C/utilpreds.c +++ b/C/utilpreds.c @@ -151,7 +151,8 @@ clean_complex_tr(tr_fr_ptr TR0 USES_REGS) { #define expand_stack(S0,SP,SF,TYPE) \ { size_t sz = SF-S0, used = SP-S0; \ - S0 = Realloc(S0, (1024+sz)*sizeof(TYPE) PASS_REGS); \ + sz += 1024;\ + S0 = Realloc(S0, sz*sizeof(TYPE) PASS_REGS); \ SP = S0+used; SF = S0+sz; } #define MIN_ARENA_SIZE (1048L) @@ -206,6 +207,8 @@ int Yap_copy_complex_term(register CELL *pt0, register CELL *pt0_end, to_visit++; // move to new list d0 = *headp; + if ((ADDR)TR > LOCAL_TrailTop - MIN_ARENA_SIZE) + goto trail_overflow; TrailedMaBind(headp, AbsPair(HR)); pt0 = headp; pt0_end = headp + 1; @@ -305,6 +308,8 @@ int Yap_copy_complex_term(register CELL *pt0, register CELL *pt0_end, if (++to_visit >= to_visit_max-32) { expand_stack(to_visit0, to_visit, to_visit_max, struct cp_frame); } + if ((ADDR)TR > LOCAL_TrailTop - MIN_ARENA_SIZE) + goto trail_overflow; TrailedMaBind(headp,AbsAppl(HR)); ptf = HR; *ptf++ = (CELL)f; @@ -344,18 +349,14 @@ int Yap_copy_complex_term(register CELL *pt0, register CELL *pt0_end, } to_visit = bp; new = *ptf; - if (TR > (tr_fr_ptr)LOCAL_TrailTop - 256) { - /* Trail overflow */ - if (!Yap_growtrail((TR - TR0) * sizeof(tr_fr_ptr *), TRUE)) { - goto trail_overflow; - } - } + if ((ADDR)TR > LOCAL_TrailTop - MIN_ARENA_SIZE) + goto trail_overflow; TrailedMaBind(ptd0, new); ptf++; } else { /* first time we met this term */ RESET_VARIABLE(ptf); - if ((ADDR)TR > LOCAL_TrailTop - MIN_ARENA_SIZE) + if ((ADDR)TR > LOCAL_TrailTop - MIN_ARENA_SIZE) goto trail_overflow; TrailedMaBind(ptd0, (CELL)ptf); ptf++; From 008c091e3cfc8470a3eb0ff36841c7a7a5cfdc15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Fri, 3 May 2019 19:08:47 +0100 Subject: [PATCH 23/29] yap4r --- packages/real/build.yap4r | 14 ++++++++++++++ packages/real/yap4r/R/zzz.R | 1 + packages/real/yap4r/src/RcppExports.cpp | 4 ++-- packages/real/yap4r/src/symbols.rds | Bin 0 -> 7537 bytes packages/real/yap4r/src/yap4r.cpp | 24 +++++++----------------- 5 files changed, 24 insertions(+), 19 deletions(-) create mode 100755 packages/real/build.yap4r create mode 100644 packages/real/yap4r/src/symbols.rds diff --git a/packages/real/build.yap4r b/packages/real/build.yap4r new file mode 100755 index 000000000..4f99c14d3 --- /dev/null +++ b/packages/real/build.yap4r @@ -0,0 +1,14 @@ +rm -f */*/*.o */*/*.so yap4r/src/RCppExports.Cpp +R CMD REMOVE yap4r +R --no-save << EOF +library(Rcpp) +compileAttributes("yap4r") +compileAttributes("yap4r") +EOF +R CMD INSTALL yap4r +R CMD check yap4r +R --no-save << eof +library(yap4r) +y <- new(yap4r) +y$q("is",[3,6]) +eof diff --git a/packages/real/yap4r/R/zzz.R b/packages/real/yap4r/R/zzz.R index 803a717a4..a39cdd146 100644 --- a/packages/real/yap4r/R/zzz.R +++ b/packages/real/yap4r/R/zzz.R @@ -8,5 +8,6 @@ ## For R 2.15.1 and later this also works. Note that calling loadModule() triggers ## a load action, so this does not have to be placed in .onLoad() or evalqOnLoad(). + loadModule("yap4r", TRUE) diff --git a/packages/real/yap4r/src/RcppExports.cpp b/packages/real/yap4r/src/RcppExports.cpp index 02ffefcff..7ca50efcd 100644 --- a/packages/real/yap4r/src/RcppExports.cpp +++ b/packages/real/yap4r/src/RcppExports.cpp @@ -6,10 +6,10 @@ using namespace Rcpp; -RcppExport SEXP _rcpp_module_boot_mod_yap4r(); +RcppExport SEXP _rcpp_module_boot_yap4r(); static const R_CallMethodDef CallEntries[] = { - {"_rcpp_module_boot_mod_yap4r", (DL_FUNC) &_rcpp_module_boot_mod_yap4r, 0}, + {"_rcpp_module_boot_yap4r", (DL_FUNC) &_rcpp_module_boot_yap4r, 0}, {NULL, NULL, 0} }; diff --git a/packages/real/yap4r/src/symbols.rds b/packages/real/yap4r/src/symbols.rds new file mode 100644 index 0000000000000000000000000000000000000000..5587e3cefe0003de18acf38602ce7656e2b672ab GIT binary patch literal 7537 zcmV-%9ggB3iwFP!000001MNM@lH|s9&EYcQCXG1UNl~IKN+c~&m8d-^TWWS=W|}=q zxzJN2hYF=pKvp-@RX`Cy^>i~Fb~qgJ$-dbKU;G7jIKr0CzWCzr@DKRntL#iHi3E@j z1=P~rGpdQ`Dd6SXGV|rjmmBi)=eD-Cu53N|^pjgxo@9^LgZHf~*S5Bvcz^4ut!L@` zTf3iqeRJte-yocvyX3#XWr3{V|&h+M9>%d z*s?7jpXt+v8^K=cW0xFSo=@DqGxIH*cu~srKAw4G_srHOmZ6Rb}eBXX(*(UB2Z#Iclc^5yp+vpq9DXR57-zEBFI2-NV z9@bQ~;hourdJ-Z25JqgBdefP2tG#_=9AUo)V|Sbr;*Q47L)D6q-+_^LYg~aMEK~|h z;aE_vQQ2IhO1VZ=a*aym8kNd5O6B^k7^~BFLabaNgD9vN19zwpL&OcSs|w$RG@Bqgd97gkvgV{3f^-( ztWk(*x%9mryx*G=d*YaJp?q1D`_%DN&2Nn8?;b)JPllea`vm(cB%)nGM0YyWjpLDS zjd{DOMD86q4=1{PmbCavZFz&jQ#1}c#>_GrJbQ=BYN zzm!hiQJ@r|ZR`dq-7tSNU7E87>z~w~ydV%(6Tfq?BXt;R4Qoy@7D{7%hhptPzFVD( zgc77T6QrzG#TWvQXBY<8?Z?4eNvjZ4)ym{Yj+DudHa9;Kj0}&1xjZBo0+078#^5fh zVQie9>O<=UDfHR1urby>5Bq0RLgSi|BW7+;rUc|j8SMviwU=NBJXjqLD%Rn9Ap1EsF>JLi8KB6y9Dl{#&(;wIF#_?WR)>PiZYD2Q>h`bve8Xz!d`UH!8v}nLe$K9NyGdgI{aTfnPFz)&%Sx zf+L_j7KYEWXP}%xc)J>00rJV=fL{U7`Oy5xqZY zS`+&7;#M$Yzx8Q=m`3>qMX~h>@#u3jv%mE_rb>Vt;ylF=;%7FNjh>%A(Z@5M;8|aj zkeDqEJR950)otII+~s4Q=h$n{b;izNtmMviKjyKsyW8hr{`gM3x**JO5GorJ*L7Sz zBF$s9Z#(wkuV<5~dTNlVZ#j01jB?0)`c$dyu_t#n^@*7yd^<-{w@ou1mໝ)=rcXssgSRZoe^AtLEhWa?s zl=8i!9}|Ihl<)#gusqMQ54YXJMB^Y!DUF|_Kx;e@jF0A_=Ms;&C*Mt?4 z<5R$AmVdNoo8&Y~d9{!G(W27M4U3ik*Thv%lhW*yF`)&TV)r})PeXFyue0yL~HiO%;q^6Vaq-uuH}0Il4W~76~c{-LcF^(4!9Zsw1&vUOKJHH3L5M7 zA{9gielALSLYuz=s_Yo*PDI`$q=1S_W`z+Jsyo zzv;SUd_3ZB`;_@mfH9Y+7>NoDHnY>TjN55S^UMn5H`%hIc0k+pO|0II=Wniti;*`) zq=C9~aIY^QJ(nYU=HQE-dhbS@en8x`PksKrrqb4QZ}QmWBdFU`V_0oh2nT6 z^d$zO&G=3*C8g5BI*Z9!%HDn38pV)n0ff!ElaW3f^O6tY-c6SoHq$K5TL`~R+guiU z+i{L(Q`R%Y&7MK;98-H0jQRxzWTdxr??@EJUBL|~U0CC&Bi9FF@&-WI{dTm@H-!0mDz40a3*Fj|09@ro)wqy=Gt{ zDnc}q)P>M!#6L@_No!!WJ=IfWqy*hstSCf+);K~Q{(~^Pr{|^J9J!<=pxW66=y(-NYhWL|5(K7P|bFytmY#AUqbwYEG#5KQ*cVeuL?v^+!aarWq}lHMKZpCWGpHm zTO0S707M)3_H;UCLDLReh;N&+5JI?jI9nRPF*vGO-i|YwvH&o(Un7Op@X4vqlV8s! zH!Y9GZ#?~tY3g=wl%Q3q}hOdb*Y9@MadFZFx7wj_#+nccm~oRul*qqJ*Ov zj`DUErE7U?PU4Uxy1bml5qx|;4Hcv*`81a6$UeX{nLM6WM5m<7Q(GTfqj~ufW1rbBFY3uHxm){2{MW&V-24yk&`-SM#CRr>mG>$(l#P536p{@Hf zm#F;(JyjBT7swF`b`Byci&SSnX*D_p(D285N4Cgs3%BTeWgjxoSh@=<@Yv zl_OkTMSfULpirY_DNtn!rE2-bl}*D%p>u`^hYO9*G8XaW$_3<%=a(xNk+(Br?)u=^_)B^cuxn4@(vPfUEca^{P;zF{)6QNi^IRFzzxKv&K6354h4`UHU`U7tu% z&h?2DOSU)6eeALES+xg7}s**Fv zzrH|a@>c%07pM*BqW|Iol@glQg{pxrhZ>0^_?rt<1L{gPhwXlU4%_`pf)&n-vyBU= zMhEtxEqW?j@xYDGd%n9z2l-NS`dl|}v*S8gX|go}Q+G{lk}>fKTj>s$^BJ+Kp7ajr z|KX8{g*x^~?a$dyM14(dn>MNRuMMw zlDq==>B1+{@r;1a<|%`XBkb5$P@2(NET_|DbV`lOp%EVSpr&Jwmuwk7l?tk}re}s* zH^NXdtVOQhOh(okS!BFU4_(yg^6RGQX7gPcQO9s5QzkXF)R03H`Z{?!nv4-*}aStKv77$E4AL__x*lwC2g3Q^r z6x)liv+lW8NY-U-H>lcdn|-&CPC7d+MJ&xRDa&MjU!jP6%OcMz?T^HQNzm(pi^lPM zc6MN0pMxH_Ga4F5LIQIR>9X@G{e7(y=jyFQ7VSf+@r;N|XrvbWK z9Hr5ZlX0+sE+5=1+q^5wTe9UR(?<SiTgF*Xg5^q8RZ%S=54}gmbNt&H1nJry?@bxL(5ta35d_2Pa- zaKg;-0bp@sg-xun!Wq*CU^Z5@*nuDk;4zf!yn3~hC)sJAvWHC~x&}yBaK0ov5tF4= z*p!MD3(f7(%Av1rsRUL@x?1u+gbpm2fTcWV&7=#_%{_dR4NP+kR=INW!F(y{^7~JS zplJQ%lDdXJgz^Hfr@$oOl1d#SnZK%H0;KC$SWzHZbJtdW15iqqSJr3)DVqt-qDW?fvnZGI)4>10 zQD{K~rjngSNezn6aZ+Kvg36^(kOv;gY06sI=ndWTS)f-}h11T-CP>L=mTPWs*85ZT zeGzbLY=W*#U29_b)(OG7$L8k_a?4Wd{q%D!kKQ$oh;fYBH#f#4@_V_w7&$tnmE?uZ z7hr7B7LUU+9A-|7vpI{Fow{1#IzA zHbw9TN8?A(Swq=3h6M(pE#}*J|*Os?=o{ay!q9PxMvHUJCqK}TJpVy&DaKR zaLH}fFIi)|ESKVKG;X6zFri4I~~ zi$;g+koQEEmN_n(O%qRwX3|oJL^Elr^P#T@X}P1JuZoE$;g?C0Y`iX{c4+i?#2(bi zWGJD|pDE3xW{#7-CZtMEl8U0ctaL5*{U&)WGw*pK)N+Ty|Ae*Yx-m=FGEZsPq5-@t zCN+(*=Re2gEfIU2xiII0E2Gs`$DTuG)u|O`4NK zhqi&FW?HG_mg%rh;?S`j1<`nf_Nu|hzx`ft%riuyHX45{=i3o=G+mZxnMpuULZT-d zm+lvS2A~;y1|ZeM_jB8K8V`>ItNm_*lin+lM*CiZmRX}umxe zP#xdF4=t0}!DnpJoCLg%>4a#iA=IblG#^qgL&V+DZwBx#Woy~A*YNjx`zLID%i$B8 z&juJ{kM~~8GMVpnb^DO;{and0hgb9ILXB;%+}K>X@n~GRF$&?)T2bs%+1e1>rit3L z%}@>4N9f|V^J$Qxp4{zXd}z;tu!Tl1Hgh>+Ok19-2g^s;_gDym{(`Z*LE(ryM@lY%#&BF35J{Vd}!Om(vV`l#ePXKw%XsAyhng15K{ z{&vL~(){{FpE6aftXj-K+SpPhnNTUlHfBibT-{YHuA8h@zL)ilOLcU3<2q<<{P64rX>vS=I5^lUWoS-_}>+oi;h;HFQCQ7$cvqXoY>?3eNG zv-(NmAQk}~-~&1UqSn~k*XlUARV-raAGyv$TC8TUE)&cAX^_lK4V#3$MHL#lr;L6Xd#{D9%G`|_e;2jj{jZ(0)U>xyjXSc?nuJ27s= zFZkegmf`mUq(+S7%zW&Oa5y{2ZSo zUFCI;*Vw%Q;^byB^GD(0xBGGl@kjQO)?YlO&%sNf04oX zglPo)CIcqZlgXrBa&rS;;ZMG;CTy*d;7PvE6%!m35-j$$qjJg!U(AUK{#;6MUSHOj ze-CKY%R*lhk%TdYEIEH2hgj#*5Hy+G;ds)MjcU@WIimceq2vzJ%&fJr%avnfCalE^ zE@PCID2|muR^mIQE*%l{%Ir6hU@Uw;>xY%^G!d*p*ng8z?UkY%Ptte7UXSjC73agF zq(!cay$0N)@-%}F#TQGU&;SprK^|0tJg5eGP)+VZpJPd3@d^G@%lK60KQ)>E)TI7X zE9pP;cys(GOt8HFEZ{BopLv3d@Sm%>ocJ{nN$x+jV*ja?^q*Q;|EZPspW0mism=GF zS{47PmGYn3T>rW3eb65Y80Gz^R>ps7kpEo89n?P$FczLQ6}{~M@SOw5cMc%mIRJg< z0FFKfl1OtP^OS>}r+hDW5jR^e0dC>0dTaLwd3=QN$pj?$o_K@z9KW5%o8z}(g5~{o z0dKkA&J$dO-(Jm?>aU4Na=$$&_S=J!etS^XZx2fQ?ZI5XJt+3u0+RwKyX=+ouOt|G zZ}@SLxX>Ds=nMzTJHsD`x7=3>SKkY1=1dhu$aAl|FL{T3dbj!9>+VZ(P47N`13xIf zis?;;P%JYrhUCz)F{Lt&xEBo)*u`>qW|PyYc=6=7!bD=5 zDVmo<@QBT2W`#$B4rgprhCX!MScB`S1mmlj;L5Z#D3bZD<94$Yqy^ZASs zR80IfAroUV72l?D_<5DSO`MZh-DgsFJzkBr@x=219<3U7J>E3d=^5%j#)Q{7HM0pz zXLu3piThO^1`9n@60v#MJe=FZXSs(1IEg>ZF7%;5vGaT=D8oyu#wF2t^RRi?JZv5| z51WVl!@=4fmQ?IKd(Tyca|H}nuIiG?pJ$YNo)71s#>JLu0nTFM<$@9Psu*6jhsCPk zk|=-q9~LXI0;)&4QdZ?NFLoZ_l5{Qw4+m=(u~qW-S}pVMg5hQL-u!NU*KXfPK^NT~ zHt-GnGQclufAOfp&#PQF^|yg<;2Zb`zJYJx8~6skfp6d&_y)d#Z{X(+Z?74D1AnaH z^`RV&3^^Q{$JTW@yamYZ0Q}o6K+jP%IF#Ruhi_d{y)FvARq=OSaxW_XtIp57^o#nv zY~}T+!+&4P^`h0N$(w@3iZ3`{~H-q*Dj_p{@?t1E5b6(z7ksrvbpbT{+y4>r*!YIOhZP z7jpTv2C9Y+!h!N@$m?Nc{44WW)b5~iU5y>rI_D&(0pYKRf93js+682nE7Frdd{$#; zjoO;^ubXStzd4lq)m7<_TIj}YYb-zZ`T^YctnxM;WY&C z0pQ4#`yU8iYeVA>0KTGnM@=AKEufsM!cDo~MvC08DoCzp9cW(=92~E;0Xu~30V@9n zRFCp{>6mgoAvhF2poZK&A$YA>(O)$IKMcVQpqy6(SK5F*1O2{21?f|hms<;Jzax2jsdoXtYRdZ&)B*HSS0bmVXZ%r7V{IlKw< zFG>T59|+*zfPNg+fN}%iwH8ngO~5}?#IGB2d>PrxF8+bWYfzjC=sASO=|F!0vca%=w*&Zv5l~M}U|p~c#3c>D z&Y+`2xnbpnrt$p?x6;&=Z7LTz7%; zg`o8es9vCW4e~$0ybmazv3YiK`mRs2i0KkQM1U-bBI z&Umo1=zIYDyYDMjWq1z!%w-iR$UpaeeP2Cjwp#F5jcCl*#`C${unE HT>bz6tz^7K literal 0 HcmV?d00001 diff --git a/packages/real/yap4r/src/yap4r.cpp b/packages/real/yap4r/src/yap4r.cpp index e0f3ed133..ca0264ce3 100644 --- a/packages/real/yap4r/src/yap4r.cpp +++ b/packages/real/yap4r/src/yap4r.cpp @@ -12,7 +12,7 @@ using namespace Rcpp; -class yap4r { +class yap4r { YAPEngine *yap; YAPQuery *q; @@ -38,27 +38,15 @@ yap4r::yap4r() { yap = new YAPEngine(yargs); }; -bool yap4r::query(std::string p_name, GenericVector sexps, - std::string p_module) { +bool yap4r::query(std::string query) { if (q) { q->close(); q = nullptr; } yhandle_t t; arity_t arity; - if (sexps.isNULL()) { - YAPTerm qt = YAPAtomTerm(p_name.c_str()); q = new YAPQuery(qt); t = qt.handle(); - } else { - arity = sexps.length(); - std::vector args = std::vector(); - yhandle_t sls = Yap_NewHandles(sexps.length()); - for (int i = 0; i < sexps.length(); i++) { - if (!sexp_to_pl(sls + i, sexps[i])) - return false; - args.push_back(YAPTerm(Yap_GetFromSlot(sls + i))); - } YAPFunctor f = YAPFunctor(p_name.c_str(), arity); YAPAtomTerm mod = YAPAtomTerm(p_module.c_str()); t = YAPApplTerm(p_name.c_str(), args.data()).handle(); @@ -76,6 +64,7 @@ bool yap4r::query(std::string p_name, GenericVector sexps, return rc; } + bool yap4r::run(SEXP l) { yhandle_t yh = Yap_InitHandle(MkVarTerm()); if (!sexp_to_pl(yh, l)) @@ -129,15 +118,16 @@ SEXP yap4r::peek(int i) { return term_to_sexp(Yap_InitSlot(Yap_XREGS[i]), false); } -RCPP_MODULE(mod_yap4r) { +RCPP_MODULE(yap4r) { class_("yap4r") .constructor("create an object encapsulating a Prolog engine") - .method("query", &yap4r::query, "create an active query within the engine") + .method("query", &yap4r::query, "create an active query within the enginefrom text") .method("more", &yap4r::more, "ask for an extra solution") .method("done", &yap4r::done, "terminate the query") .method("eval_text", &yap4r::eval_text, "terminate the query") .method("run", &yap4r::run, "terminate the query") .method("compile", &yap4r::compile, "compile the file") .method("library", &yap4r::library, "compile the library") - .method("peek", &yap4r::peek, "load arg[i] into R"); + .method("peek", &yap4r::peek, "load arg[i] into R") + ; } From adf6ffd2a6d06b9d2ae1316705f31e08532ce715 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Sat, 4 May 2019 10:45:42 +0100 Subject: [PATCH 24/29] left-over --- C/terms.c | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/C/terms.c b/C/terms.c index 3839b6d6a..05834c382 100644 --- a/C/terms.c +++ b/C/terms.c @@ -241,9 +241,9 @@ if (IS_VISIT_MARKER) { \ #define def_overflow() \ def_aux_overflow(); \ def_global_overflow(); \ - def_trail_overflow() + def_trail_overflow() + - #define CYC_APPL \ if (IS_VISIT_MARKER) { \ while (to_visit > to_visit0) { \ @@ -259,7 +259,7 @@ if (IS_VISIT_MARKER) { \ static Term cyclic_complex_term(CELL *pt0_, CELL *pt0_end_ USES_REGS) { CELL *pt0, *pt0_end; - int lvl; + int lvl; size_t auxsz = 1024 * sizeof(struct non_single_struct_t); struct non_single_struct_t *to_visit0, *to_visit,* to_visit_max; CELL *InitialH = HR; @@ -315,7 +315,7 @@ static int cycles_in_complex_term( CELL *pt0_, CELL *pt0_end_ USES_REGS) { size_t auxsz = 1024 * sizeof(struct non_single_struct_t); struct non_single_struct_t *to_visit0, *to_visit, *to_visit_max; int lvl; - + reset: lvl = push_text_stack(); pt0 = pt0_, pt0_end = pt0_end_; @@ -433,7 +433,7 @@ return rc; def_overflow(); - + } Term Yap_CyclesInTerm(Term t USES_REGS) { @@ -473,7 +473,7 @@ static Int cycles_in_term(USES_REGS1) /* cyclic_term(+T) */ static bool ground_complex_term(CELL * pt0_, CELL * pt0_end_ USES_REGS) { CELL *pt0, *pt0_end; - int lvl; + int lvl; size_t auxsz = 1024 * sizeof(struct non_single_struct_t); struct non_single_struct_t *to_visit0, *to_visit,* to_visit_max; CELL *InitialH = HR; @@ -527,7 +527,7 @@ static Int ground(USES_REGS1) /* ground(+T) */ static Int var_in_complex_term(CELL *pt0_, CELL *pt0_end_ , Term v USES_REGS) { CELL *pt0, *pt0_end; - int lvl; + int lvl; size_t auxsz = 1024 * sizeof(struct non_single_struct_t); struct non_single_struct_t *to_visit0, *to_visit,* to_visit_max; CELL *InitialH = HR; @@ -611,10 +611,10 @@ static Term vars_in_complex_term(CELL *pt0_, CELL *pt0_end_ , } inp = TailOfTerm(inp); } - + CELL output = AbsPair(HR); CELL *pt0, *pt0_end; - int lvl; + int lvl; size_t auxsz = 1024 * sizeof(struct non_single_struct_t); struct non_single_struct_t *to_visit0, *to_visit,* to_visit_max; CELL *InitialH = HR; @@ -781,7 +781,7 @@ typedef struct att_rec { static Term attvars_in_complex_term( CELL *pt0_, CELL *pt0_end_ , Term inp USES_REGS) { CELL *pt0, *pt0_end; - int lvl; + int lvl; size_t auxsz = 1024 * sizeof(struct non_single_struct_t); struct non_single_struct_t *to_visit0, *to_visit,* to_visit_max; CELL *InitialH = HR; @@ -852,7 +852,7 @@ static Int term_attvars(USES_REGS1) /* variables in term t */ static Term new_vars_in_complex_term( CELL *pt0_, CELL *pt0_end_ , Term inp USES_REGS) { CELL *pt0, *pt0_end; - int lvl; + int lvl; size_t auxsz = 1024 * sizeof(struct non_single_struct_t); struct non_single_struct_t *to_visit0, *to_visit,* to_visit_max; CELL *InitialH = HR; @@ -866,13 +866,14 @@ static Term new_vars_in_complex_term( if (IsVarTerm(t)) { n++; TrailTerm(TR++) = t; + TrailTerm(TR++) = t; *VarOfTerm(t) = TermFoundVar; if ((tr_fr_ptr)LOCAL_TrailTop - TR < 1024) { size_t expand = (tr_fr_ptr)LOCAL_TrailTop - TR; clean_tr(TR0 PASS_REGS); *HR++ = inp0; - /* Trail overflow */ - if (!Yap_growtrail(expand, false)) { + /* Trail overflow */ + if (!Yap_growtrail(expand, false)) { Yap_ThrowError(RESOURCE_ERROR_TRAIL, TermNil, expand); } inp = *--HR; @@ -894,7 +895,7 @@ if (HR + 1024 > ASP) { } END_WALK(); -clean_tr(TR0-n PASS_REGS); +clean_tr(TR0 PASS_REGS); pop_text_stack(lvl); return output; @@ -944,12 +945,12 @@ static Term vars_within_complex_term( Int n=0; CELL output = AbsPair(HR); CELL *pt0, *pt0_end; - int lvl; + int lvl; size_t auxsz = 1024 * sizeof(struct non_single_struct_t); struct non_single_struct_t *to_visit0, *to_visit,* to_visit_max; CELL *InitialH = HR; tr_fr_ptr TR0 = TR; - + while (!IsVarTerm(inp) && IsPairTerm(inp)) { Term t = HeadOfTerm(inp); if (IsVarTerm(t)) { @@ -968,7 +969,7 @@ static Term vars_within_complex_term( goto restart; END_WALK(); - clean_tr(TR0-n PASS_REGS); + clean_tr(TR0 PASS_REGS); pop_text_stack(lvl); if (HR != InitialH) { HR[-1] = TermNil; @@ -1036,7 +1037,7 @@ static Int free_variables_in_term( else { out = new_vars_in_complex_term(&(t)-1, &(t), Yap_TermVariables(bounds, 3) PASS_REGS); } - + if (found_module && t != t0) { Term ts[2]; ts[0] = found_module; @@ -1058,7 +1059,7 @@ return Yap_unify(ARG2, t) && Yap_unify(ARG3, out); static Term non_singletons_in_complex_term(CELL * pt0_, CELL * pt0_end_ USES_REGS) { CELL *pt0, *pt0_end; - int lvl; + int lvl; size_t auxsz = 1024 * sizeof(struct non_single_struct_t); struct non_single_struct_t *to_visit0, *to_visit,* to_visit_max; CELL *InitialH = HR; @@ -1132,7 +1133,7 @@ if (singles) { \ static Int numbervars_in_complex_term(CELL * pt0_, CELL * pt0_end_, Int numbv, int singles USES_REGS) { CELL *pt0, *pt0_end; - int lvl; + int lvl; size_t auxsz = 1024 * sizeof(struct non_single_struct_t); struct non_single_struct_t *to_visit0, *to_visit,* to_visit_max; CELL *InitialH = HR; @@ -1220,7 +1221,7 @@ if (FunctorOfTerm(d0) == FunctorDollarVar) { \ static int max_numbered_var(CELL * pt0_, CELL * pt0_end_, Int * maxp USES_REGS) { CELL *pt0, *pt0_end; - int lvl; + int lvl; size_t auxsz = 1024 * sizeof(struct non_single_struct_t); struct non_single_struct_t *to_visit0, *to_visit,* to_visit_max; CELL *InitialH = HR; @@ -1365,7 +1366,7 @@ Int cp_link(Term t, Int i, Int j, cl_connector * q, Int max, CELL * tailp) { if (IsVarTerm(ref)) { q[i].copy[j] = ref; // fprintf(stderr," - %p\n", ref); - } + } else { Term v = UNFOLD_LOOP(ref, tailp); q[i].copy[j] = v; From e23055d4f06b13b7f368ea1c10ff4cfdb7950fc0 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Thu, 9 May 2019 12:44:50 +0100 Subject: [PATCH 25/29] gecode debugger. --- C/scanner.c | 5 +- C/sort.c | 2 +- H/YapGFlagInfo.h | 15 ------ H/YapLFlagInfo.h | 12 +++++ library/matrix.yap | 3 +- packages/gecode/clpfd.yap | 39 ++++++++++---- pl/boot.yap | 2 +- pl/debug.yap | 111 +++++++++++++++----------------------- pl/signals.yap | 4 +- pl/spy.yap | 80 +++++++++++++++++++++++---- pl/top.yap | 18 +++---- 11 files changed, 170 insertions(+), 121 deletions(-) diff --git a/C/scanner.c b/C/scanner.c index cdb06f1bb..b232b3816 100755 --- a/C/scanner.c +++ b/C/scanner.c @@ -1437,7 +1437,7 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, ch = getchr(st); } add_ch_to_buff('\0'); - if (!isvar) { + if (!isvar || (ch == '(' && trueLocalPrologFlag(ALLOW_VARIABLE_NAME_AS_FUNCTOR_FLAG) ) ) { Atom ae; /* don't do this in iso */ ae = Yap_LookupAtom(TokImage); @@ -1585,7 +1585,8 @@ TokEntry *Yap_tokenizer(struct stream_desc *st, bool store_comments, charp = (unsigned char *)TokImage+sz; break; } - if (ch == 10 && trueGlobalPrologFlag(ISO_FLAG)) { + if (ch == 10 && (trueGlobalPrologFlag(ISO_FLAG) || + trueLocalPrologFlag(MULTILINE_QUOTED_TEXT_FLAG))) { /* in ISO a new line terminates a string */ LOCAL_ErrorMessage = "layout character \n inside quotes"; break; diff --git a/C/sort.c b/C/sort.c index bb6e60296..8381306dd 100644 --- a/C/sort.c +++ b/C/sort.c @@ -59,7 +59,7 @@ build_new_list(CELL *pt, Term t USES_REGS) pt += 2; if (pt > ASP - 4096) { if (!Yap_gcl((ASP-HR)*sizeof(CELL), 2, ENV, gc_P(P,CP))) { - Yap_Error(RESOURCE_ERROR_STACK, TermNil, LOCAL_ErrorMessage); + Yap_ThrowError(RESOURCE_ERROR_STACK, TermNil, LOCAL_ErrorMessage); return(FALSE); } t = Deref(ARG1); diff --git a/H/YapGFlagInfo.h b/H/YapGFlagInfo.h index 73cc33054..631c06ca4 100644 --- a/H/YapGFlagInfo.h +++ b/H/YapGFlagInfo.h @@ -53,21 +53,6 @@ opportunity. Initial value is 10,000. May be changed. A value of 0 "allow_assert_for_static_predicates", true, booleanFlag, "true", NULL), - /**< - - boolean flag allows syntax such - as - ~~~ - Tree(Node(L,node,R)) :- - Tree(L), - Tree(R). - ~~~ - */ - YAP_FLAG(ALLOW_VARIABLE_NAME_AS_FUNCTOR_FLAG, - "allow_variable_name_as_functor", false, booleanFlag, "false", - NULL), - - /**< how to present answers, default is `~p`. */ YAP_FLAG(ANSWER_FORMAT_FLAG, "answer_format", true, isatom, "~p", NULL), /**< diff --git a/H/YapLFlagInfo.h b/H/YapLFlagInfo.h index 0269c16e2..611f9a229 100644 --- a/H/YapLFlagInfo.h +++ b/H/YapLFlagInfo.h @@ -26,6 +26,13 @@ START_LOCAL_FLAGS +/**< Allow constructs such as 'Functor( V )'. Functor is parsed as an + atom. The token `V` is still understood as a variable. + +Originally a SWI-Prolog flag. + */ +YAP_FLAG(ALLOW_VARIABLE_NAME_AS_FUNCTOR_FLAG, "allow_variable_name_as_functor", true, booleanFlag, "false", NULL), + /**< set the system to look for undefined procedures */ YAP_FLAG(AUTOLOAD_FLAG, "autoload", true, booleanFlag, "false", NULL), @@ -72,6 +79,11 @@ YAP_FLAG(AUTOLOAD_FLAG, "autoload", true, booleanFlag, "false", NULL), */ YAP_FLAG(LANGUAGE_MODE_FLAG, "language_mode", true, isatom, "yap", NULL), + /**< If true, quoted atoms, string, lists of codes and of chars may extend over several lines, without the need to escape the new-line characters. Otherwise, unquoted line breaks cause a syntax error. + + The default was for it to be true, except if in iso mode. YAP-6.5 changed the default, in order to ensure compatibility. + */ + YAP_FLAG(MULTILINE_QUOTED_TEXT_FLAG, "multiline_quoted_text", false, booleanFlag, "false", NULL), /**< Show the execution stack in exceptions. */ YAP_FLAG(STACK_DUMP_ON_ERROR_FLAG, "stack_dump_on_error", false, booleanFlag, "true", NULL), diff --git a/library/matrix.yap b/library/matrix.yap index 9efefb539..cdbd51a88 100644 --- a/library/matrix.yap +++ b/library/matrix.yap @@ -29,6 +29,7 @@ (+=)/2, op(800, xfx, +=), (-=)/2, op(800, xfx, -=), op(700, xfx, in), + op(700, xfx, within), op(700, xfx, ins), op(450, xfx, ..), % should bind more tightly than \/ op(710, xfx, of), of/2, @@ -974,8 +975,6 @@ mtimes(I1, I2, V) :- V = I1*I2 ) ; V = I1 *I2. - - % % three types of matrix: integers, floats and general terms. % diff --git a/packages/gecode/clpfd.yap b/packages/gecode/clpfd.yap index a5a683113..00e3457da 100644 --- a/packages/gecode/clpfd.yap +++ b/packages/gecode/clpfd.yap @@ -72,6 +72,7 @@ Constraints supported are: (#\/)/2, (#/\)/2, in/2 , + fd_in/2 , ins/2, boolvar/1, boolvars/1, @@ -80,7 +81,7 @@ Constraints supported are: all_distinct/2, maximize/1, minimize/1, - sum/3, + sum/3, fd_sum/3, lex_chain/1, minimum/2, min/2, @@ -232,6 +233,7 @@ The product of constant _Cs_ by _Vs_ must be in relation :- reexport(library(matrix), [(<==)/2, op(800, xfx, '<=='), op(700, xfx, in), + op(700, xfx, fd_in), op(700, xfx, ins), op(450, xfx, ..), % should bind more tightly than \/ op(710, xfx, of), @@ -258,13 +260,13 @@ constraint( (_ #<==> _) ). constraint( (_ #==> _) ). constraint( (_ #<== _) ). constraint( (_ #\/ _) ). -constraint( (_ #/\ _) ). constraint( in(_, _) ). %2, constraint( ins(_, _) ). %2, constraint( all_different(_) ). %1, constraint( all_distinct(_) ). %1, constraint( all_distinct(_,_) ). %1, constraint( sum(_, _, _) ). %3, +constraint( fd_sum(_, _, _) ). %3, constraint( scalar_product(_, _, _, _) ). %4, constraint( min(_, _) ). %2, constraint( minimum(_, _) ). %2, @@ -297,12 +299,16 @@ constraint( fd_dom(_, _) ). %2 constraint( clause(_, _, _, _) ). %2 -process_constraints((B0,B1), (NB0, NB1), Env) :- - process_constraints(B0, NB0, Env), - process_constraints(B1, NB1, Env). -process_constraints(B, B, env(_Space)) :- +process_constraints(V, V, _Env, _) :- + var(V), !. +process_constraints((B0,B1), (NB0, NB1), Env, L) :- + process_constraints(B0, NB0, Env, L), + process_constraints(B1, NB1, Env,L). +process_constraints(labeling(A,B),labeling(A, B), env(_Space),true) :- + !. +process_constraints(B, B, env(_Space),_) :- constraint(B), !. -process_constraints(B, B, _Env). +process_constraints(B, B, _Env,_). % process_constraint(B, NB, Space). ( A #= B) :- @@ -385,6 +391,8 @@ sum( L, Op, V) :- check(L, NL), check(V, NV), post( rel(sum(NL), Op, NV), Env, _). +fd_sum( L, Op, V) :- + sum( L, Op, V). ( ( A #<==> VBool )) :- get_home(Space-Map), check(A, NA), @@ -444,6 +452,12 @@ sum( L, Op, V) :- check(B, NB), m(X, NX, NA, NB, Map), NX := intvar(Space, NA, NB). +( X fd_in A..B) :- + get_home(Space-Map), + check(A, NA), + check(B, NB), + m(X, NX, NA, NB, Map), + NX := intvar(Space, NA, NB). ( Xs ins A..B) :- get_home(Space-Map), check(A, NA), @@ -580,6 +594,7 @@ check(V, NV) :- V = '$matrix'(_, _, _, _, C) -> C =.. [_|L], maplist(check, L, NV) ; V = A+B -> check(A,NA), check(B, NB), NV = NB+NA ; V = A-B -> check(A,NA), check(B, NB), NV = NB-NA ; + V in Domain -> V fd_in Domain, V=NV ; arith(V, _) -> V =.. [C|L], maplist(check, L, NL), NV =.. [C|NL] ; constraint(V) -> V =.. [C|L], maplist(check, L, NL), NV =.. [C|NL] ). @@ -859,7 +874,6 @@ linearize(AC, C, [A|Bs], Bs, [C|CBs], CBs, I, I, Env) :- Env = _-Map, l(V, A, Map). -arith('/\\'(_,_), (/\)). arith('\\/'(_,_), (\/)). arith('=>'(_,_), (=>)). arith('<=>'(_,_), (<=>)). @@ -869,6 +883,7 @@ arith(min(_), min). arith(max(_), max). arith(min(_,_), min). arith(max(_,_), max). +arith((_ - _), minus). arith((_ * _), times). arith((_ / _), div). arith(sum(_), sum). @@ -1208,7 +1223,8 @@ in_c_l(Env, V, IV) :- in_c(V, IV, Env). user:term_expansion( ( H :- B), (H :- (gecode_clpfd:init_gecode(Space, Me), NB, gecode_clpfd:close_gecode(Space, Vs, Me)) ) ) :- - process_constraints(B, NB, Env), + process_constraints(B, NB, Env, Labeling), + nonvar(Labeling), term_variables(H, Vs), nonvar( Env ), !, Env = env( Space ). @@ -1266,6 +1282,11 @@ attr_unify_hook(v(IV1,_,_), Y) :- % Translate attributes from this module to residual goals + +attribute_goals(X) --> + { get_attr(X, gecode_clpfd, v(_,0,1)) }, + !, + [boolvar(X)]. attribute_goals(X) --> { get_attr(X, gecode_clpfd, v(_,A,B)) }, [X in A..B]. diff --git a/pl/boot.yap b/pl/boot.yap index 941e1c8c7..89188051e 100644 --- a/pl/boot.yap +++ b/pl/boot.yap @@ -267,7 +267,7 @@ initialize_prolog :- :- c_compile( 'protect.yap' ). :- ['absf.yap']. -%:- stop_low_level_trace. + :- use_module('error.yap'). :- [ diff --git a/pl/debug.yap b/pl/debug.yap index 1f3deecce..f8a0097a2 100644 --- a/pl/debug.yap +++ b/pl/debug.yap @@ -1,4 +1,3 @@ - /**********************************************************************a*** * * * YAP Prolog * @@ -302,7 +301,12 @@ be lost. '$trace'(Mod:G) :- '$creep_is_off'(Mod:G,_GN0), !, - '$execute_nonstop'(G,Mod). + gated_call( + true, + Mod:G, + E, + '$reenter_debugger'(E) + ). '$trace'(Mod:G) :- '$$save_by'(CP), '$trace_query'(G, Mod, CP, G, EG), @@ -314,12 +318,6 @@ be lost. ). -'$continue_debugging'(exit) :- !, '$creep'. -'$continue_debugging'(answer) :- !, '$creep'. -'$continue_debugging'(fail) :- !, '$creep'. -'$continue_debugging'(_). - - @@ -454,53 +452,55 @@ be lost. '$trace_goal'(G, M, L, H), E, '$TraceError'(E, G, M, L, H) - ))). + ))). %% @pred $trace_goal( +Goal, +Module, +CallId, +CallInfo) %% -%% Actuallb sy debugs a +%% Actually debugs a %% goal! -'$trace_goal'(G, M, GoalNumber, _H) :- - '$creep_is_off'(M:G,GoalNumber), - !, - '$execute_nonstop'(G,M). -'$trace_goal'(G, M, _GoalNumber, _H) :- - '$undefined'(G, M), - !, - '$undefp'([M|G], _ ). -% meta system '$trace_goal'(G, M, GoalNumber, H) :- '$is_metapredicate'(G, prolog), !, '$debugger_expand_meta_call'(M:G, [], G1), strip_module(G1, MF, NG), - gated_call( - '$enter_trace'(GoalNumber, G, M, H), - '$execute_nonstop'(NG,MF), - Port, - '$trace_port'(Port, GoalNumber, G, M, true, H) - ). -% system_ + '$trace_goal__'(NG,MF, GoalNumber, H). '$trace_goal'(G, M, GoalNumber, H) :- - ( - '$is_opaque_predicate'(G, M) - ; - 'strip_module'(M:G, prolog, _NG) - ), + '$trace_goal__'(G,M, GoalNumber, H). + +'$trace_goal__'(G,M, _GoalNumber, _H) :- + '$undefined'(G,M), !, + '$undefp'([M|G], _). +'$trace_goal__'(G,M, GoalNumber, H) :- + '$is_source'(G,M), + '$current_choice_point'(CP), + !, + '$enter_trace'(GoalNumber, G, M, H), gated_call( - '$enter_trace'(GoalNumber, G, M, H), - '$execute_nonstop'(G,M), - Port, - '$trace_port'(Port, GoalNumber, G, M, true, H) - ). -'$trace_goal'(G, M, GoalNumber, H) :- - gated_call( - '$enter_trace'(GoalNumber, G, M, H), - '$debug'( GoalNumber, G, M, H), + true, + ( '$creep_is_on_at_entry'(G,M) + -> + clause(M:G, B), '$trace_query'(B,M,CP,B,H) + ; + '$execute_nonstop'(G,M) + ), Port, '$trace_port'(Port, GoalNumber, G, M, true, H) ). +% system_ +'$trace_goal__'(G,M, GoalNumber, H) :- + !, + gated_call( + '$enter_trace'(GoalNumber, G, M, H), + ( '$creep_is_on_at_entry'(G,M) + -> + '$execute_nonstop'(('$creep',G),M) + ; + '$execute_nonstop'(G,M) + ), + Port, + '$trace_port'(Port, GoalNumber, G, M, true, H) + ). /** @@ -542,33 +542,6 @@ be lost. '__NB_setval__'('$spy_gn',L1). '$id_goal'(_L). -/** - * @pred '$enter_trace'(+L, 0:G, +Module, +Info) - * - * call goal: setup the diferrent cases - * - zip, just run through - * - source, call an interpreter - * - compiled code: try black magic. - * - * @parameter _Module_:_G_ - * @parameter _GoalNumber_ identifies the active goal - * @parameter _Info_ describes the goal - * - */ - -'$debug'(_, G, M, _H) :- - '__NB_getval__'('$debug_status',state(zip,_Border,Spy,_Trace), fail), - ( Spy == stop -> \+ '$pred_being_spied'(G,M) ; true ), - !, - '$execute_nonstop'( G, M ). -'$debug'(GoalNumber, G, M, Info) :- - '$is_source'(G,M), - !, - '$trace_go'(GoalNumber, G, M, Info). -'$debug'(GoalNumber, G, M, Info) :- - '$creep_step'(GoalNumber, G, M, Info). - - /** * @pred '$trace_go'(+L, 0:G, +Module, +Info) * @@ -705,7 +678,7 @@ be lost. '$port'(_P, _G, _M,GoalNumber,_Determinic, _Info ) :- %%> leap '__NB_getval__'('$debug_status',state(leap,Border,_,_), fail), - GoalNumber > Border, + GoalNumber < Border, !. '$port'(P,G,Module,L,Deterministic, Info) :- % at this point we are done with leap or skip @@ -714,7 +687,7 @@ be lost. ( '$unleashed'(P) -> '$action'('\n',P,L,G,Module,Info), - put_code(debugger_output, 10) + nl(debugger_output) ; write(debugger_output,' ? '), '$clear_input'(debugger_input), diff --git a/pl/signals.yap b/pl/signals.yap index f9b9603be..4a0cb7242 100644 --- a/pl/signals.yap +++ b/pl/signals.yap @@ -181,8 +181,8 @@ '$trace'(Mod:G). '$no_creep_call'('$execute_clause'(G,Mod,Ref,CP),_) :- !, - '$enable_debugging', - '$execute_clause'(G,Mod,Ref,CP). + '$enable_debugging', + '$execute_clause'(G,Mod,Ref,CP). '$no_creep_call'('$execute_nonstop'(G, M),_) :- !, '$enable_debugging', '$execute_nonstop'(G, M). diff --git a/pl/spy.yap b/pl/spy.yap index cb3149008..425dc0f51 100644 --- a/pl/spy.yap +++ b/pl/spy.yap @@ -393,7 +393,16 @@ notrace(G) :- fail ). -'$disable_debugging_on_port'(retry) :- +'$creep_at_port'(retry) :- + current_prolog_flag(debug, true), + '__NB_getval__'('$trace',Trace,fail), + Trace = on, + !, + '$enable_debugging'. +'$creep_at_port'(fail) :- + current_prolog_flag(debug, true), + '__NB_getval__'('$trace',Trace,fail), + Trace = on, !, '$enable_debugging'. '$disable_debugging_on_port'(_Port) :- @@ -401,19 +410,52 @@ notrace(G) :- -% enable creeping -'$enable_debugging':- - current_prolog_flag(debug, false), !. -'$enable_debugging' :- - '__NB_getval__'('$trace',Trace,fail), - nb_setval('$debug_status', state(creep, 0, stop,Trace)), - Trace = on, !, - '$creep'. -'$enable_debugging'. +%% @pred $enter_debugging(G,Mod,CP,G0,NG) +%% +%% Internal predicate called by top-level; +%% enable creeping on a goal by just switching execution to debugger. +%% +'$enter_debugging'(G,Mod,CP,G0,NG) :- + '$creep_is_on_at_entry'(G,Mod), + !, + '$trace_query'(G,Mod,CP,G0,NG). +'$enter_debugging'(G,_Mod,_CP,_G0,G). +%% we're coming back from external code to a debugger call. +%% +'$reenter_debugger'(retry) :- + '$re_enter_creep_mode'. +'$reenter_debugger'(_) :- + set_current_flag(debug, false). + +%% @pred $re_enter_creep_mode1 +%% +%% Internal predicate called when exiting through a port; +%% enable creeping on the next goal. +%% +'$re_enter_creep_mode' :- + '$creep_is_on', + !, + '$creep'. +'$re_enter_creep_mode'. + +'$continue_debugging'(exit) :- + !, + '$re_enter_creep_mode'. +'$continue_debugging'(answer) :- + !, + '$re_enter_creep_mode'. +'$continue_debugging'(fail) :- + !, + '$re_enter_creep_mode', +'$continue_debugging'(_). + +'$enable_debugging' :- + '$re_enter_creep_mode'. + '$trace_on' :- '__NB_getval__'('$debug_status', state(_Creep, GN, Spy,_), fail), - '__NB_setval__'('$trace',on), + nb_setval('$trace',on), nb_setval('$debug_status', state(creep, GN, Spy, on)). '$trace_off' :- @@ -438,6 +480,22 @@ notrace(G) :- GN > GN0 ). +%% +% +'$creep_is_on' :- + current_prolog_flag(debug, true), + '__NB_getval__'('$debug_status',state(Step, _GN, _Spy,_), fail), + Step \= zip. + +'$creep_is_on_at_entry'(G,M) :- + current_prolog_flag(debug, true), + '__NB_getval__'('$debug_status',state(Step, _GN, Spy,_), fail), + ( + Step \= zip + ; + Spy == stop, + '$pred_being_spied'(G,M) + ). /* diff --git a/pl/top.yap b/pl/top.yap index 0367deaea..8abf13d29 100644 --- a/pl/top.yap +++ b/pl/top.yap @@ -444,10 +444,12 @@ write_query_answer( Bindings ) :- '$purge_dontcares'([],[]). '$purge_dontcares'([Name=_|Vs],NVs) :- - atom_codes(Name, [C|_]), C is "_", !, - '$purge_dontcares'(Vs,NVs). + atom_codes(Name, [C|_]), + C is "_", + !, + '$purge_dontcares'(Vs,NVs). '$purge_dontcares'([V|Vs],[V|NVs]) :- - '$purge_dontcares'(Vs,NVs). + '$purge_dontcares'(Vs,NVs). '$prep_answer_var_by_var'([], L, L). @@ -577,10 +579,10 @@ write_query_answer( Bindings ) :- '$user_call'(G, CP, G0, M) :- gated_call( - '$enable_debugging', - '$call'(G, CP, G0, M), - Port, - '$disable_debugging_on_port'(Port) + '$enable_debugging', + '$call'(G, CP, G0, M), + Port, + '$disable_debugging_on_port'(Port) ). @@ -773,8 +775,6 @@ Command = (H --> B) -> '$boot_clause'( Command, _ ) :- format(user_error, ' ~w failed.~n', [Command]). - - '$enter_command'(Stream, Mod, Status) :- prompt1(': '), prompt(_,' '), Options = [module(Mod), syntax_errors(dec10),variable_names(Vars), term_position(Pos)], From 4d395761a443303602213793e064b23c8ba0cdec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Fri, 10 May 2019 03:05:40 +0100 Subject: [PATCH 26/29] debugger --- library/rbtrees.yap | 4 +- pl/debug.yap | 40 ++++--------- pl/spy.yap | 106 +++++++++++++++++----------------- pl/top.yap | 135 +++++++++++++++++++++++--------------------- 4 files changed, 138 insertions(+), 147 deletions(-) diff --git a/library/rbtrees.yap b/library/rbtrees.yap index 8b52743b4..d78dace0c 100644 --- a/library/rbtrees.yap +++ b/library/rbtrees.yap @@ -76,7 +76,7 @@ form colour(Left, Key, Value, Right), where _colour_ is one of =red= or rb_partial_map(+,+,2,-), rb_apply(+,+,2,-). -/* + :- use_module(library(type_check)). :- type rbtree(K,V) ---> t(tree(K,V),tree(K,V)). @@ -97,7 +97,7 @@ form colour(Left, Key, Value, Right), where _colour_ is one of =red= or :- pred max(tree(K,V),K,V). :- pred rb_next(rbtree(K,V),K,pair(K,V),V). :- pred next(tree(K,V),K,pair(K,V),V,tree(K,V)). -*/ + %% @pred rb_new(-T) is det. % create an empty tree. diff --git a/pl/debug.yap b/pl/debug.yap index f8a0097a2..be708e3a6 100644 --- a/pl/debug.yap +++ b/pl/debug.yap @@ -14,11 +14,9 @@ * comments: YAP debugger * * * *************************************************************************/ - - -:- system_module( '$_debug', [], ['$trace_query'/4, - '$init_debugger'/0, - '$skipeol'/1]). +:- system_module('$_debug', + [], + ['$trace_query'/4, '$init_debugger'/0, '$skipeol'/1]). @@ -489,15 +487,10 @@ be lost. ). % system_ '$trace_goal__'(G,M, GoalNumber, H) :- - !, + '$enter_trace'(GoalNumber, G, M, H), gated_call( - '$enter_trace'(GoalNumber, G, M, H), - ( '$creep_is_on_at_entry'(G,M) - -> - '$execute_nonstop'(('$creep',G),M) - ; - '$execute_nonstop'(G,M) - ), + true, + '$execute_nonstop'(G,M), Port, '$trace_port'(Port, GoalNumber, G, M, true, H) ). @@ -580,17 +573,12 @@ be lost. '$trace_port_'(redo, GoalNumber, G, Module, Info). '$trace_port'(Port, GoalNumber, G, Module, _CalledFromDebugger, Info) :- - '$stop_creeping'(_) , - current_prolog_flag(debug, true), - '__NB_getval__'('$debug_status',state(Skip,Border,_,Trace), fail), - ( Skip == creep -> true; - '$stop_creeping'(_) , - '$id_goal'(GoalNumber), - GoalNumber =< Border), + '$trace_off', !, - '__NB_setval__'('$debug_status', state(creep, 0, stop,Trace)), - '$trace_port_'(Port, GoalNumber, G, Module, Info). -'$trace_port'(_Port, _GoalNumber, _G, _Module, _CalledFromDebugger, _Info). + '$trace_port_'(Port, GoalNumber, G, Module, Info), + '$continue_debugging'(Port). +'$trace_port'(Port, _GoalNumber, _G, _Module, _CalledFromDebugger, _Info) :- + '$continue_debugging'(Port). '$trace_port_'(call, GoalNumber, G, Module, Info) :- '$port'(call,G,Module,GoalNumber,deterministic, Info). @@ -737,12 +725,8 @@ be lost. '$action'(!,_,_,_,_,_) :- !, % ! 'g execute read(debugger_input, G), % don't allow yourself to be caught by creep. - current_prolog_flag(debug, OldDeb), - set_prolog_flag(debug, false), ignore( G ), - % at this point we are done with leap or skip - set_prolog_flag(debug, OldDeb), -% skip( debugger_input, 10), % ' + skip( debugger_input, 10), % ' fail. '$action'(<,_,_,_,_,_) :- !, % <'Depth '$new_deb_depth', diff --git a/pl/spy.yap b/pl/spy.yap index 425dc0f51..b86dcac5b 100644 --- a/pl/spy.yap +++ b/pl/spy.yap @@ -60,18 +60,7 @@ mode and the existing spy-points, when the debugger is on. :- op(900,fx,[spy,nospy]). -'$init_debugger' :- - '__NB_getval__'('$trace', _, fail), !. -'$init_debugger' :- - '$debugger_input', - '__NB_setval__'('$trace',off), - '__NB_setval__'('$if_skip_mode',no_skip), - '__NB_setval__'('$spy_glist',[]), - '__NB_setval__'('$spy_gn',1), - '__NB_setval__'('$debug_state', state(zip,0,stop,off)). - - - % First part : setting and reseting spy points +% First part : setting and reseting spy points % $suspy does most of the work '$suspy'(V,S,M) :- var(V) , !, @@ -214,19 +203,15 @@ debug :- '$start_debugging'(on), print_message(informational,debug(debug)). -'$start_debugging'(Mode) :- - (Mode == on -> - set_prolog_flag(debug, true) - ; - set_prolog_flag(debug, false) - ), - '__NB_getval__'('$trace',Trace, fail), - ( Trace == on -> Creep = crep; Creep = zip ), - '__NB_setval__'('$debug_state',state(Creep,0,stop,Trace) ). +'$start_debugging'(_Mode) :- + '__NB_setval__'(debug, false), + '__NB_getval__'('$trace',Trace, fail), + ( Trace == on -> Creep = crep; Creep = zip ), + '__NB_setval__'('$debug_state',state(Creep,0,stop,Trace) ). nodebug :- - '$init_debugger', set_prolog_flag(debug, false), + '$init_debugger', '__NB_setval__'('$trace',off), print_message(informational,debug(off)). @@ -394,21 +379,30 @@ notrace(G) :- ). '$creep_at_port'(retry) :- - current_prolog_flag(debug, true), - '__NB_getval__'('$trace',Trace,fail), + '__NB_getval__'(debug, true, fail), + '__NB_getval__'('$trace',Trace,fail), Trace = on, !, '$enable_debugging'. '$creep_at_port'(fail) :- - current_prolog_flag(debug, true), + '__NB_getval__'(debug, true, fail), '__NB_getval__'('$trace',Trace,fail), Trace = on, !, '$enable_debugging'. -'$disable_debugging_on_port'(_Port) :- - '$disable_debugging'. - +'$init_debugger' :- + '$init_debugger_trace', + '__NB_setval__'('$if_skip_mode',no_skip), + '__NB_setval__'('$spy_glist',[]), + '__NB_setval__'('$spy_gn',1). + +'$init_debugger_trace' :- + '__NB_getval__'('$trace',on,fail), + !, + nb_setval('$debug_status', state(creep, 0, stop, on)). +'$init_debugger_trace' :- + nb_setval('$debug_status', state(zip, 0, stop, off)). %% @pred $enter_debugging(G,Mod,CP,G0,NG) %% @@ -416,7 +410,7 @@ notrace(G) :- %% enable creeping on a goal by just switching execution to debugger. %% '$enter_debugging'(G,Mod,CP,G0,NG) :- - '$creep_is_on_at_entry'(G,Mod), + '$creepcalls'(G,Mod), !, '$trace_query'(G,Mod,CP,G0,NG). '$enter_debugging'(G,_Mod,_CP,_G0,G). @@ -426,19 +420,9 @@ notrace(G) :- '$reenter_debugger'(retry) :- '$re_enter_creep_mode'. '$reenter_debugger'(_) :- - set_current_flag(debug, false). - -%% @pred $re_enter_creep_mode1 -%% -%% Internal predicate called when exiting through a port; -%% enable creeping on the next goal. -%% -'$re_enter_creep_mode' :- - '$creep_is_on', - !, - '$creep'. -'$re_enter_creep_mode'. + '__NB_setval__'(debug, false). +% what to do when you exit the debugger. '$continue_debugging'(exit) :- !, '$re_enter_creep_mode'. @@ -452,19 +436,21 @@ notrace(G) :- '$enable_debugging' :- '$re_enter_creep_mode'. - -'$trace_on' :- - '__NB_getval__'('$debug_status', state(_Creep, GN, Spy,_), fail), - nb_setval('$trace',on), - nb_setval('$debug_status', state(creep, GN, Spy, on)). - -'$trace_off' :- - '__NB_getval__'('$debug_status', state(_Creep, GN, Spy), fail), - '__NB_setval__'('$trace',off), - nb_setval('$debug_status', state(zip, GN, Spy,off)). + + +%% @pred $re_enter_creep_mode1 +%% +%% Internal predicate called when exiting through a port; +%% enable creeping on the next goal. +%% +'$re_enter_creep_mode' :- + '__NB_getval__'(debug, true, fail), + !, + '$creep'. +'$re_enter_creep_mode'. '$creep_is_off'(_,_) :- - current_prolog_flag(debug, false), !. + '__NB_getval__'(debug, false, fail), !. '$creep_is_off'(Module:G, GN0) :- '__NB_getval__'('$debug_status',state(zip, GN, Spy,_), fail), ( @@ -483,12 +469,13 @@ notrace(G) :- %% % '$creep_is_on' :- - current_prolog_flag(debug, true), + '__NB_getval__'(debug, true, fail), '__NB_getval__'('$debug_status',state(Step, _GN, _Spy,_), fail), Step \= zip. '$creep_is_on_at_entry'(G,M) :- - current_prolog_flag(debug, true), + '__NB_getval__'(debug, true, fail), + \+ '$system_predicate'(G,M), '__NB_getval__'('$debug_status',state(Step, _GN, Spy,_), fail), ( Step \= zip @@ -497,6 +484,17 @@ notrace(G) :- '$pred_being_spied'(G,M) ). + +'$trace_on' :- + '__NB_getval__'('$debug_status', state(_Creep, GN, Spy,Trace), fail), + nb_getval('$trace',on), + nb_setval('$debug_status', state(creep, GN, Spy, Trace)). + +'$trace_off' :- +'__NB_getval__'('$debug_status', state(_Creep, GN, Spy, Trace),fail), +'__NB_setval__'(debug,false), +nb_setval('$debug_status', state(zip, GN, Spy,Trace)). + /* @} diff --git a/pl/top.yap b/pl/top.yap index 8abf13d29..9a3db0b30 100644 --- a/pl/top.yap +++ b/pl/top.yap @@ -13,25 +13,23 @@ * @{ * */ - - :- '$system_meta_predicates'([ - gated_call(0,0,?,0), - catch(0,?,0), - log_event(+,:)]). +:- '$system_meta_predicates'([gated_call(0, 0, ?, 0), catch(0, ?, 0), log_event(+, :)]). % @pred live % % start a Prolog engine. live :- repeat, - yap_flag(verbose,normal), - current_source_module(Module,Module), - ( Module==user -> - true % '$compile_mode'(_,0) - ; - format(user_error,'[~w]~n', [Module]) + yap_flag(verbose, normal), + current_source_module(Module, Module), + ( Module==user + -> true % '$compile_mode'(_,0) + ; format(user_error, '[~w]~n', [Module]) ), - '$system_catch'('$enter_top_level',Module,Error,'$Error'(Error)). + '$system_catch'('$enter_top_level', + Module, + Error, + '$Error'(Error)). % Start file for yap @@ -46,64 +44,75 @@ live :- /* main execution loop */ '$read_toplevel'(Goal, Bindings, Pos) :- - '$prompt', - catch(read_term(user_input, - Goal, - [variable_names(Bindings), syntax_errors(dec10), term_position(Pos)]), - E, '$handle_toplevel_error'( E) ). + '$prompt', + catch(read_term(user_input, + Goal, + + [ variable_names(Bindings), + syntax_errors(dec10), + term_position(Pos) + ]), + E, + '$handle_toplevel_error'(E)). -'$handle_toplevel_error'( syntax_error(_)) :- - !, - fail. -'$handle_toplevel_error'( error(io_error(read,user_input),_)) :- - !. +'$handle_toplevel_error'(syntax_error(_)) :- + !, + fail. +'$handle_toplevel_error'(error(io_error(read, user_input), _)) :- + !. '$handle_toplevel_error'(_, E) :- - throw(E). + throw(E). % reset alarms when entering top-level. '$enter_top_level' :- - '$alarm'(0, 0, _, _), - fail. + '$alarm'(0, 0, _, _), + fail. '$enter_top_level' :- - '$clean_up_dead_clauses', - fail. + '$clean_up_dead_clauses', + fail. '$enter_top_level' :- - get_value('$top_level_goal',GA), GA \= [], !, - set_value('$top_level_goal',[]), - '$run_atom_goal'(GA), - fail. + get_value('$top_level_goal', GA), + GA\=[], + !, + set_value('$top_level_goal', []), + '$run_atom_goal'(GA), + fail. '$enter_top_level' :- flush_output, - '$run_toplevel_hooks', - prompt1(' ?- '), - '$read_toplevel'(Command,Varnames,Pos), - nb_setval('$spy_gn',1), - % stop at spy-points if debugging is on. - nb_setval('$debug_run',off), - nb_setval('$debug_jump',off), - '__NB_setval__'('$trace',off), - nb_setval('$debug_status', state(zip, 0, stop,off)), - '$command'(Command,Varnames,Pos,top), - current_prolog_flag(break_level, BreakLevel), - ( - BreakLevel \= 0 - -> - true - ; - '$pred_exists'(halt(_), user) - -> - halt(0) - ; - '$halt'(0) - ). + '$run_toplevel_hooks', + prompt1(' ?- '), + '$read_toplevel'(Command, Varnames, Pos), + '$init_debugger', + '$command'(Command, Varnames, Pos, top), + current_prolog_flag(break_level, BreakLevel), + ( BreakLevel\=0 + -> true + ; '$pred_exists'(halt(_), user) + -> halt(0) + ; '$halt'(0) + ). + +'$init_debug' :- + nb_setval('$spy_gn', 1), + % stop at spy-points if debugging is on. + nb_setval('$debug_run', off), + nb_setval('$debug_jump', off), + '__NB_getval__'('$trace', Trace, fail), + ( Trace==on + -> nb_setval('$debug_status', state(creep, 0, stop, on)) + ; nb_setval('$debug_status', state(zip, 0, stop, off)) + ). '$erase_sets' :- - eraseall('$'), - eraseall('$$set'), - eraseall('$$one'), - eraseall('$reconsulted'), fail. -'$erase_sets' :- \+ recorded('$path',_,_), recorda('$path',[],_). + eraseall($), + eraseall('$$set'), + eraseall('$$one'), + eraseall('$reconsulted'), + fail. +'$erase_sets' :- + \+ recorded('$path', _, _), + recorda('$path', [], _). '$erase_sets'. '$start_corouts' :- @@ -176,7 +185,7 @@ live :- '$expand_term'(T,top,O). '$expand_term'(T,Con,O) :- - catch( '$expand_term0'(T,Con,O), _,( '$disable_debugging', fail) ), + catch( '$expand_term0'(T,Con,O), _,( '$reenter_debugger'(exit), fail) ), !. '$expand_term0'(T,consult,O) :- @@ -389,7 +398,7 @@ live :- '$do_another'(C) :- ( C=:= ";" -> - skip(user_input,10), % + skip(user_input,10), % '$add_nl_outside_console', fail ; @@ -582,7 +591,7 @@ write_query_answer( Bindings ) :- '$enable_debugging', '$call'(G, CP, G0, M), Port, - '$disable_debugging_on_port'(Port) + '$reenter_debugger'(Port) ). @@ -591,7 +600,7 @@ write_query_answer( Bindings ) :- '$enable_debugging', M:G, Port, - '$disable_debugging_on_port'(Port) + '$reenter_debugger'(Port) ). '$cut_by'(CP) :- '$$cut_by'(CP). @@ -696,7 +705,7 @@ write_query_answer( Bindings ) :- % ( % '$is_metapredicate'(G,CurMod) % -> -% '$disable_debugging', +% '$reenter_debugger'(exit)', % ( '$expand_meta_call'(CurMod:G, [], NG) -> true ; true ), % '$enable_debugging' % ; From 46b9b46bcadf7b0ffe13dc7695b46b0c3d56a1c5 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Sat, 11 May 2019 11:24:15 +0100 Subject: [PATCH 27/29] debuggecode --- library/maplist.yap | 9 ++-- packages/gecode/clpfd.yap | 54 +++++++++++++++++--- packages/gecode/gecode6_yap_hand_written.yap | 36 ++++++++++++- pl/debug.yap | 44 +++++++++------- pl/spy.yap | 22 +++++--- 5 files changed, 127 insertions(+), 38 deletions(-) diff --git a/library/maplist.yap b/library/maplist.yap index a79eed3a9..e1f134907 100644 --- a/library/maplist.yap +++ b/library/maplist.yap @@ -766,8 +766,7 @@ goal_expansion(maplist(Meta, ListIn, ListOut), Mod:Goal) :- append_args(HeadPrefix, [[In|Ins], [Out|Outs]], RecursionHead), append_args(Pred, [In, Out], Apply), append_args(HeadPrefix, [Ins, Outs], RecursiveCall), - compile_aux([ - Base, + compile_aux([ Base, (RecursionHead :- Apply, RecursiveCall) ], Mod). @@ -887,19 +886,19 @@ goal_expansion(selectlists(Meta, ListIn, ListIn1, ListOut, ListOut1), Mod:Goal) aux_preds(Meta, MetaVars, Pred, PredVars, Proto), !, % the new goal - pred_name(selectlist, 4, Proto, GoalName), + pred_name(selectlists, 4, Proto, GoalName), append(MetaVars, [ListIn, ListIn1, ListOut, ListOut1], GoalArgs), Goal =.. [GoalName|GoalArgs], % the new predicate declaration HeadPrefix =.. [GoalName|PredVars], append_args(HeadPrefix, [[], [], [], []], Base), append_args(HeadPrefix, [[In|Ins], [In1|Ins1], Outs, Outs1], RecursionHead), - append_args(Pred, [In, In1], Apply), + append_args(Pred, [In, Out], Apply), append_args(HeadPrefix, [Ins, Ins1, NOuts, NOuts1], RecursiveCall), compile_aux([ Base, (RecursionHead :- - (Apply -> Outs = [In|NOuts], Outs1 = [In1|NOuts1]; Outs = NOuts, Outs1 = NOuts1), + (Apply -> Outs = [Out|NOuts], Outs1 = [In1|NOuts1]; Outs = NOuts, Outs1 = NOuts1), RecursiveCall) ], Mod). diff --git a/packages/gecode/clpfd.yap b/packages/gecode/clpfd.yap index 00e3457da..259b816fe 100644 --- a/packages/gecode/clpfd.yap +++ b/packages/gecode/clpfd.yap @@ -260,7 +260,7 @@ constraint( (_ #<==> _) ). constraint( (_ #==> _) ). constraint( (_ #<== _) ). constraint( (_ #\/ _) ). -constraint( in(_, _) ). %2, +constraint( fd_in(_, _) ). %2, constraint( ins(_, _) ). %2, constraint( all_different(_) ). %1, constraint( all_distinct(_) ). %1, @@ -292,7 +292,7 @@ constraint( zcompare(_, _, _) ). %3, constraint( chain(_, _) ). %2, constraint( element(_, _) ). %2, constraint( fd_var(_) ). %1, -constraint( fd_inf(_, _) ). %2, +sconstraint( fd_inf(_, _) ). %2, constraint( fd_sup(_, _) ). %2, constraint( fd_size(_, _) ). %2, constraint( fd_dom(_, _) ). %2 @@ -453,6 +453,7 @@ fd_sum( L, Op, V) :- m(X, NX, NA, NB, Map), NX := intvar(Space, NA, NB). ( X fd_in A..B) :- + var(X), get_home(Space-Map), check(A, NA), check(B, NB), @@ -549,6 +550,22 @@ clause( or, Ps, Ns, V ) :- check(V, NV), post(clause( 'BOT_OR', NPs, NNs, NV), Env, _ ). +bool_labeling(Opts, Xs) :- + get_home(Space-Map), + foldl2( processs_bool_lab_opt, Opts, 'BOOL_VAR_DEGREE_MIN', BranchVar, 'BOOL_VAL_MIN', BranchVal), + term_variables(Xs, Vs), + check( Vs, X1s ), + ( X1s == [] -> true ; + maplist(ll(Map), X1s, NXs), + Space += branch(NXs, BranchVar, BranchVal) ). + +processs_bool_lab_opt(leftmost, _, 'BOOL_VAR_NONE', BranchVal, BranchVal). +processs_bool_lab_opt(min, _, 'BOOL_VAR_DEGREE_MIN', BranchVal, BranchVal). +processs_bool_lab_opt(max, _, 'BOOL_VAR_DEGREE_MAX', BranchVal, BranchVal). +processs_bool_lab_opt(min_step, BranchVar, BranchVar, _, 'BOOL_VAL_MIN'). +processs_bool_lab_opt(max_step, BranchVar, BranchVar, _, 'BOOL_VAL_MIN'). +processs_bool_lab_opt(enum, BranchVar, BranchVar, _, 'BOOL_VALUES_MIN'). + labeling(Opts, Xs) :- get_home(Space-Map), foldl2( processs_lab_opt, Opts, 'INT_VAR_SIZE_MIN', BranchVar, 'INT_VAL_MIN', BranchVal), @@ -594,7 +611,9 @@ check(V, NV) :- V = '$matrix'(_, _, _, _, C) -> C =.. [_|L], maplist(check, L, NV) ; V = A+B -> check(A,NA), check(B, NB), NV = NB+NA ; V = A-B -> check(A,NA), check(B, NB), NV = NB-NA ; - V in Domain -> V fd_in Domain, V=NV ; + V = A/\B -> check(A,NA), check(B, NB), NV = NB/\NA ; + V = A\/B -> check(A,NA), check(B, NB), NV = NB\/NA ; + V fd_in A..B, var(V) -> check(A,NA), check(B, NB), NV fd_in NB..NA ; arith(V, _) -> V =.. [C|L], maplist(check, L, NL), NV =.. [C|NL] ; constraint(V) -> V =.. [C|L], maplist(check, L, NL), NV =.. [C|NL] ). @@ -678,9 +697,21 @@ post( rel( sum(Foreach, Cond), Op, Out), Space-Map, Reify):- !, Space += linear(Cs, IL, GOP, IOut); Space += linear(Cs, IL, GOP, IOut, Reify) ). +post( rel( sum(L0), Op, Out), Space-Map, Reify):- +!, + selectlist(var,L0,L,LC), + sumlist(LC,0), + ( var(Out) -> l(Out, IOut, Map) ; integer(Out) -> IOut = Out ; equality(Out, NOut, Space-Map), l(NOut, IOut, Map) ), + maplist(ll(Map), [Out|L], [IOut|IL] ), + gecode_arith_op( Op, GOP ), + (L = [] -> true ; + var(Reify) -> + Space += linear(Cs, IL, GOP, IOut); + Space += linear(Cs, IL, GOP, IOut, Reify) + ). post( rel(A1+A2, Op, B), Space-Map, Reify):- - ( nonvar(B) ; B = _ + _ ; B = _-_), !, + ( var(B) ; B = _ + _ ; B = _-_), !, linearize(A1+A2, 1, As, Bs, CAs, CBs, 0, A0, Space-Map), linearize(B, -1, Bs, [], CBs, [], A0, B0, Space-Map), gecode_arith_op( Op, GOP ), @@ -697,7 +728,7 @@ post( rel(A1+A2, Op, B), Space-Map, Reify):- ). post( rel(A1-A2, Op, B), Space-Map, Reify):- - ( nonvar(B) ; B = _ + _ ; B = _-_), !, + ( var(B) ; B = _ + _ ; B = _-_), !, linearize(A1-A2, 1, As, Bs, CAs, CBs, 0, A0, Space-Map), linearize(B, -1, Bs, [], CBs, [], A0, B0, Space-Map), gecode_arith_op( Op, GOP ), @@ -731,6 +762,15 @@ post( rel(A, Op, B), Space-Map, Reify):- equality(B, B1, Space-Map), out_c(Name, VA1, B1, Op, Space-Map, Reify). +post( rel(A1 \/ A2, Ope, B), Space-Map, Reify):- + !, + equality(A1, NA1, Space-Map), + in_c(NA1, VA1, Space-Map), + equality(A2, NA2, Space-Map), + in_c(NA2, VA2, Space-Map), + equality(B, B1, Space-Map), + out_c('\\/', VA1, VA2, B1, Op, Space-Map, Reify). + post( rel(A, Op, B), Space-Map, Reify):- arith(A, Name), A =.. [_Op,A1,A2], !, @@ -874,7 +914,6 @@ linearize(AC, C, [A|Bs], Bs, [C|CBs], CBs, I, I, Env) :- Env = _-Map, l(V, A, Map). -arith('\\/'(_,_), (\/)). arith('=>'(_,_), (=>)). arith('<=>'(_,_), (<=>)). arith(xor(_,_), xor). @@ -1010,7 +1049,8 @@ out_c(Name, A1, A2, B, Op, Space-Map, Reify) :- ). % X*Y #= Cin[..] out_c(Name, A1, A2, B, (#=), Space-Map, Reify) :- - var(Reify), +Name \= '\\/', + var(Reify), l(B, IB, Map), !, l(A1, IA1, Map), l(A2, IA2, Map), diff --git a/packages/gecode/gecode6_yap_hand_written.yap b/packages/gecode/gecode6_yap_hand_written.yap index b61f5027a..c7a5f3d87 100644 --- a/packages/gecode/gecode6_yap_hand_written.yap +++ b/packages/gecode/gecode6_yap_hand_written.yap @@ -288,7 +288,7 @@ is_IntVar_('IntVar'(I,K),N) :- nb_getval(gecode_space_use_keep_index,B), (B=true -> N=K ; N=I). is_FloatVar_('FloatVar'(I,K),N) :- - integer(I), + integer(I), integer(K), nb_getval(gecode_space_use_keep_index,B), (B=true -> N=K ; N=I). @@ -479,6 +479,30 @@ is_IntVarBranch_(X, X) :- is_IntVarBranch(X,Y) :- nonvar(X), is_IntVarBranch_(X,Y). is_IntVarBranch(X) :- is_IntVarBranch(X,_). +%% Var and Val Branching changed in Gecode 4 to be done as a set of functions, +%%% not as an enum. + +is_BoolVarBranch_('BOOL_VAR_NONE'). +is_BoolVarBranch_('BOOL_VAR_RND'(_)). +%is_BoolVarBranch_('BOOL_VAR_MERIT_MIN'(_)). +%is_BoolVarBranch_('BOOL_VAR_MERIT_MAX'(_)). +is_BoolVarBranch_('BOOL_VAR_DEGREE_MIN'). +is_BoolVarBranch_('BOOL_VAR_DEGREE_MAX'). +is_BoolVarBranch_('BOOL_VAR_MAX_MIN'). +is_BoolVarBranch_('BOOL_VAR_MAX_MAX'). +is_BoolVarBranch_('BOOL_VAR_AFC_MIN'(_)). +is_BoolVarBranch_('BOOL_VAR_AFC_MAX'(_)). +is_BoolVarBranch_('BOOL_VAR_ACTION_MIN'(_)). +is_BoolVarBranch_('BOOL_VAR_ACTION_MAX'(_)). +is_BoolVarBranch_('BOOL_VAR_CHB_MIN'(_)). +is_BoolVarBranch_('BOOL_VAR_CHB_MAX'(_)). + +is_BoolVarBranch_(X, X) :- + is_BoolVarBranch_(X). + +is_BoolVarBranch(X,Y) :- nonvar(X), is_BoolVarBranch_(X,Y). +is_BoolVarBranch(X) :- is_BoolVarBranch(X,_). + is_SetVarBranch_('SET_VAR_NONE'). is_SetVarBranch_('SET_VAR_RND'(_)). is_SetVarBranch_('SET_VAR_MERIT_MIN'(_)). @@ -557,6 +581,16 @@ is_IntValBranch_(X,X) :- is_IntValBranch_(X). is_IntValBranch(X,Y) :- nonvar(X), is_IntValBranch_(X,Y). is_IntValBranch(X) :- is_IntValBranch(X,_). +is_BoolValBranch_('BOOL_VAL_RND'(_)). +is_BoolValBranch_('BOOL_VAL'(_,_)). +is_BoolValBranch_('BOOL_VAL_MIN'). +is_BoolValBranch_('BOOL_VAL_MAX'). + +is_BoolValBranch_(X,X) :- is_BoolValBranch_(X). + +is_BoolValBranch(X,Y) :- nonvar(X), is_BoolValBranch_(X,Y). +is_BoolValBranch(X) :- is_BoolValBranch(X,_). + is_SetValBranch_('SET_VAL_RND_INC'(_)). is_SetValBranch_('SET_VAL_RND_EXC'(_)). is_SetValBranch_('SET_VAL'(_,_)). diff --git a/pl/debug.yap b/pl/debug.yap index be708e3a6..e387ddb5f 100644 --- a/pl/debug.yap +++ b/pl/debug.yap @@ -310,7 +310,7 @@ be lost. '$trace_query'(G, Mod, CP, G, EG), gated_call( '$debugger_io', - EG, + ( '$enter_debugging'(G,Mod), EG ), E, '$continue_debugging'(E) ). @@ -456,6 +456,26 @@ be lost. %% %% Actually debugs a %% goal! +'$trace_goal'(G,M, GoalNumber, H) :- + '$is_source'(G,M), + '$current_choice_point'(CP), + !, + '$enter_trace'(GoalNumber, G, M, H), + gated_call( + true, + ( '$enter_debugging'(G,M,GoalNumber) + -> + % source mode + clause(M:G, B), '$trace_query'(B,M,CP,B,H) + ; + '$execute_nonstop'(G,M) + ), + Port, + ( + '$reenter_debugging'(Port,G,M,GoalNumber), + '$trace_port'(Port, GoalNumber, G, M, true, H) + ) + ). '$trace_goal'(G, M, GoalNumber, H) :- '$is_metapredicate'(G, prolog), !, @@ -469,28 +489,16 @@ be lost. '$undefined'(G,M), !, '$undefp'([M|G], _). -'$trace_goal__'(G,M, GoalNumber, H) :- - '$is_source'(G,M), - '$current_choice_point'(CP), - !, - '$enter_trace'(GoalNumber, G, M, H), - gated_call( - true, - ( '$creep_is_on_at_entry'(G,M) - -> - clause(M:G, B), '$trace_query'(B,M,CP,B,H) - ; - '$execute_nonstop'(G,M) - ), - Port, - '$trace_port'(Port, GoalNumber, G, M, true, H) - ). % system_ '$trace_goal__'(G,M, GoalNumber, H) :- '$enter_trace'(GoalNumber, G, M, H), gated_call( true, - '$execute_nonstop'(G,M), + ( + % try creeping + ( '$enter_debugging'(G,M,GoalNumber) -> '$creep' ; true ), + '$execute_nonstop'(G,M) + ), Port, '$trace_port'(Port, GoalNumber, G, M, true, H) ). diff --git a/pl/spy.yap b/pl/spy.yap index b86dcac5b..2d7305b3c 100644 --- a/pl/spy.yap +++ b/pl/spy.yap @@ -415,6 +415,20 @@ notrace(G) :- '$trace_query'(G,Mod,CP,G0,NG). '$enter_debugging'(G,_Mod,_CP,_G0,G). +'$enter_debugging'(G,Mod,GN) :- + çurrent_prolog_flag( debug, Deb ), + '__NB_set_value__'( debug, Deb ), + ( Deb = false + -> + true + ; + '$creep_is_on_at_entry'(G,Mod,GN) + -> + '$creep' + ; + true + ). + %% we're coming back from external code to a debugger call. %% '$reenter_debugger'(retry) :- @@ -444,13 +458,10 @@ notrace(G) :- %% enable creeping on the next goal. %% '$re_enter_creep_mode' :- - '__NB_getval__'(debug, true, fail), !, '$creep'. '$re_enter_creep_mode'. -'$creep_is_off'(_,_) :- - '__NB_getval__'(debug, false, fail), !. '$creep_is_off'(Module:G, GN0) :- '__NB_getval__'('$debug_status',state(zip, GN, Spy,_), fail), ( @@ -469,12 +480,10 @@ notrace(G) :- %% % '$creep_is_on' :- - '__NB_getval__'(debug, true, fail), '__NB_getval__'('$debug_status',state(Step, _GN, _Spy,_), fail), Step \= zip. -'$creep_is_on_at_entry'(G,M) :- - '__NB_getval__'(debug, true, fail), +'$creep_is_on_at_entry'(G,M,GoalNo) :- \+ '$system_predicate'(G,M), '__NB_getval__'('$debug_status',state(Step, _GN, Spy,_), fail), ( @@ -492,7 +501,6 @@ notrace(G) :- '$trace_off' :- '__NB_getval__'('$debug_status', state(_Creep, GN, Spy, Trace),fail), -'__NB_setval__'(debug,false), nb_setval('$debug_status', state(zip, GN, Spy,Trace)). /* From babf3dd77ded07140d0a121df8e55b2f9d154cfa Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Sun, 12 May 2019 15:40:29 +0100 Subject: [PATCH 28/29] gecode --- packages/gecode/clpfd.yap | 89 ++++++++++++++++++++++++++++++--------- 1 file changed, 68 insertions(+), 21 deletions(-) diff --git a/packages/gecode/clpfd.yap b/packages/gecode/clpfd.yap index 259b816fe..4b5f77691 100644 --- a/packages/gecode/clpfd.yap +++ b/packages/gecode/clpfd.yap @@ -9,7 +9,7 @@ in a more CLP like style. It requires ~~~~~{.prolog} :- use_module(library(gecode/clpfd)). ~~~~~ -Several example programs are available with the distribution. +Several example programs are available with the distributionv. Integer variables are declared as: @@ -96,7 +96,8 @@ Constraints supported are: in_dfa/2, in_dfa/4, /* tuples_in/2, */ - labeling/2 /*, + labeling/2, + bool_labeling/2 /*, label/1, indomain/1, serialized/2, @@ -306,6 +307,8 @@ process_constraints((B0,B1), (NB0, NB1), Env, L) :- process_constraints(B1, NB1, Env,L). process_constraints(labeling(A,B),labeling(A, B), env(_Space),true) :- !. +process_constraints(bool_labeling(A,B),bool_labeling(A, B), env(_Space),true) :- + !. process_constraints(B, B, env(_Space),_) :- constraint(B), !. process_constraints(B, B, _Env,_). @@ -552,37 +555,37 @@ clause( or, Ps, Ns, V ) :- bool_labeling(Opts, Xs) :- get_home(Space-Map), - foldl2( processs_bool_lab_opt, Opts, 'BOOL_VAR_DEGREE_MIN', BranchVar, 'BOOL_VAL_MIN', BranchVal), + foldl2( process_bool_lab_opt, Opts, 'BOOL_VAR_DEGREE_MIN', BranchVar, 'BOOL_VAL_MIN', BranchVal), term_variables(Xs, Vs), check( Vs, X1s ), ( X1s == [] -> true ; maplist(ll(Map), X1s, NXs), Space += branch(NXs, BranchVar, BranchVal) ). -processs_bool_lab_opt(leftmost, _, 'BOOL_VAR_NONE', BranchVal, BranchVal). -processs_bool_lab_opt(min, _, 'BOOL_VAR_DEGREE_MIN', BranchVal, BranchVal). -processs_bool_lab_opt(max, _, 'BOOL_VAR_DEGREE_MAX', BranchVal, BranchVal). -processs_bool_lab_opt(min_step, BranchVar, BranchVar, _, 'BOOL_VAL_MIN'). -processs_bool_lab_opt(max_step, BranchVar, BranchVar, _, 'BOOL_VAL_MIN'). -processs_bool_lab_opt(enum, BranchVar, BranchVar, _, 'BOOL_VALUES_MIN'). +process_bool_lab_opt(leftmost, _, 'BOOL_VAR_NONE', BranchVal, BranchVal). +process_bool_lab_opt(min, _, 'BOOL_VAR_DEGREE_MIN', BranchVal, BranchVal). +process_bool_lab_opt(max, _, 'BOOL_VAR_DEGREE_MAX', BranchVal, BranchVal). +process_bool_lab_opt(min_step, BranchVar, BranchVar, _, 'BOOL_VAL_MIN'). +process_bool_lab_opt(max_step, BranchVar, BranchVar, _, 'BOOL_VAL_MIN'). +process_bool_lab_opt(enum, BranchVar, BranchVar, _, 'BOOL_VALUES_MIN'). labeling(Opts, Xs) :- get_home(Space-Map), - foldl2( processs_lab_opt, Opts, 'INT_VAR_SIZE_MIN', BranchVar, 'INT_VAL_MIN', BranchVal), + foldl2( process_lab_opt, Opts, 'INT_VAR_SIZE_MIN', BranchVar, 'INT_VAL_MIN', BranchVal), term_variables(Xs, Vs), check( Vs, X1s ), ( X1s == [] -> true ; maplist(ll(Map), X1s, NXs), Space += branch(NXs, BranchVar, BranchVal) ). -processs_lab_opt(leftmost, _, 'INT_VAR_NONE', BranchVal, BranchVal). -processs_lab_opt(min, _, 'INT_VAR_SIZE_MIN', BranchVal, BranchVal). -processs_lab_opt(max, _, 'INT_VAR_SIZE_MAX', BranchVal, BranchVal). -processs_lab_opt(ff, _, 'INT_VAR_DEGREE_MIN', BranchVal, BranchVal). -processs_lab_opt(min_step, BranchVar, BranchVar, _, 'INT_VAL_MIN'). -processs_lab_opt(max_step, BranchVar, BranchVar, _, 'INT_VAL_MIN'). -processs_lab_opt(bisect, BranchVar, BranchVar, _, 'INT_VAL_MED'). -processs_lab_opt(enum, BranchVar, BranchVar, _, 'INT_VALUES_MIN'). +process_lab_opt(leftmost, _, 'INT_VAR_NONE', BranchVal, BranchVal). +process_lab_opt(min, _, 'INT_VAR_SIZE_MIN', BranchVal, BranchVal). +process_lab_opt(max, _, 'INT_VAR_SIZE_MAX', BranchVal, BranchVal). +process_lab_opt(ff, _, 'INT_VAR_DEGREE_MIN', BranchVal, BranchVal). +process_lab_opt(min_step, BranchVar, BranchVar, _, 'INT_VAL_MIN'). +process_lab_opt(max_step, BranchVar, BranchVar, _, 'INT_VAL_MIN'). +process_lab_opt(bisect, BranchVar, BranchVar, _, 'INT_VAL_MED'). +process_lab_opt(enum, BranchVar, BranchVar, _, 'INT_VALUES_MIN'). maximize(V) :- @@ -601,7 +604,6 @@ extensional_constraint( Tuples, TupleSet) :- dfa( S0, Transitions, Finals, DFA) :- DFA := dfa( S0, Transitions, Finals ). - check(V, NV) :- ( var(V) -> V = NV ; number(V) -> V = NV ; @@ -711,7 +713,23 @@ post( rel( sum(L0), Op, Out), Space-Map, Reify):- ). post( rel(A1+A2, Op, B), Space-Map, Reify):- - ( var(B) ; B = _ + _ ; B = _-_), !, + var( B ), !, + linearize(A1+A2, 1, As, [], CAs, [], 0, A0, Space-Map), + l(B, B0, Map), + gecode_arith_op( Op, GOP ), + (var(Reify) -> + ( checklist(is_one, CAs) -> + Space += linear(As, GOP, B0); + Space += linear(CAs, As, GOP, B0) + ) + ; + ( checklist(is_one, CAs) -> + Space += linear(As, GOP, B0, Reify); + Space += linear(CAs, As, GOP, B0, Reify) + ) + ). +post( rel(A1+A2, Op, B), Space-Map, Reify):- + ( B = _ + _ ; B = _-_), !, linearize(A1+A2, 1, As, Bs, CAs, CBs, 0, A0, Space-Map), linearize(B, -1, Bs, [], CBs, [], A0, B0, Space-Map), gecode_arith_op( Op, GOP ), @@ -728,7 +746,24 @@ post( rel(A1+A2, Op, B), Space-Map, Reify):- ). post( rel(A1-A2, Op, B), Space-Map, Reify):- - ( var(B) ; B = _ + _ ; B = _-_), !, + ( var(B) ), !, + linearize(A1-A2, 1, As, [], CAs, [], 0, A0, Space-Map), + l(B, B0, Map), + gecode_arith_op( Op, GOP ), + (var(Reify) -> + ( checklist(is_one, CAs) -> + Space += linear(As, GOP, B0); + Space += linear(CAs, As, GOP, B0) + ) + ; + ( checklist(is_one, CAs) -> + Space += linear(As, GOP, B0, Reify); + Space += linear(CAs, As, GOP, B0, Reify) + ) + ). + +post( rel(A1-A2, Op, B), Space-Map, Reify):- + ( B = _ + _ ; B = _-_), !, linearize(A1-A2, 1, As, Bs, CAs, CBs, 0, A0, Space-Map), linearize(B, -1, Bs, [], CBs, [], A0, B0, Space-Map), gecode_arith_op( Op, GOP ), @@ -887,24 +922,36 @@ linearize(V, C, [A|As], As, [C|CAs], CAs, I, I, _-Map) :- var(V), !, l(V, A, Map). linearize(A+B, C, As, Bs, CAs, CBs, I, IF, Env) :- + !, + linearize(A, C, As, A1s, CAs, CA1s, I, I1, Env), + linearize(B, C, A1s, Bs, CA1s, CBs, I1, IF, Env). +linearize([], _C, As, As, CAs, CAs, I, I, _) :- + !. +linearize([A|B], C, As, Bs, CAs, CBs, I, IF, Env) :- + !, linearize(A, C, As, A1s, CAs, CA1s, I, I1, Env), linearize(B, C, A1s, Bs, CA1s, CBs, I1, IF, Env). linearize(A-B, C, As, Bs, CAs, CBs, I, IF, Env) :- + !, NC is -C, linearize(A, C, As, A1s, CAs, CA1s, I, I1, Env), linearize(B, NC, A1s, Bs, CA1s, CBs, I1, IF, Env). linearize(A, C, As, As, CAs, CAs, I, IF, _) :- + !, integer(A), !, IF is I-C*A. linearize(A, C, As, As, CAs, CAs, I, IF, _) :- + !, ground(A), catch( (B is eval(A)), _, fail ), !, IF is I-C*B. linearize(C1*B, C, As, Bs, CAs, CBs, I, IF, Env) :- + !, integer(C1), !, NC is C*C1, linearize(B, NC, As, Bs, CAs, CBs, I, IF, Env). linearize(B*C1, C, As, Bs, CAs, CBs, I, IF, Env) :- + !, integer(C1), !, NC is C*C1, linearize(B, NC, As, Bs, CAs, CBs, I, IF, Env). From ef3d435dec2b9606993430da2f66e06d38f3a399 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Wed, 15 May 2019 18:51:50 +0100 Subject: [PATCH 29/29] debugger cleanup - I --- C/cdmgr.c | 14 +-- C/exec.c | 22 ++++ C/globals.c | 2 +- library/rbtrees.yap | 6 +- pl/debug.yap | 245 +++++++++++++++++++++----------------------- pl/signals.yap | 26 ++--- pl/spy.yap | 103 +++++++++++-------- pl/top.yap | 25 +---- 8 files changed, 229 insertions(+), 214 deletions(-) diff --git a/C/cdmgr.c b/C/cdmgr.c index e880251b7..024d4e617 100644 --- a/C/cdmgr.c +++ b/C/cdmgr.c @@ -2036,7 +2036,7 @@ static Int p_sys_export(USES_REGS1) { /* '$set_spy'(+Fun,+M) */ ******************************************************************/ -static Int p_is_no_trace(USES_REGS1) { /* '$undefined'(P,Mod) */ +static Int p_is_private(USES_REGS1) { /* '$undefined'(P,Mod) */ PredEntry *pe; pe = Yap_get_pred(Deref(ARG1), Deref(ARG2), "undefined/1"); @@ -2051,7 +2051,7 @@ static Int p_is_no_trace(USES_REGS1) { /* '$undefined'(P,Mod) */ return false; } -static Int p_set_no_trace(USES_REGS1) { /* '$set_no_trace'(+Fun,+M) */ +static Int p_set_private(USES_REGS1) { /* '$set_private'(+Fun,+M) */ PredEntry *pe; pe = Yap_get_pred(Deref(ARG1), Deref(ARG2), "undefined/1"); @@ -2067,7 +2067,7 @@ int Yap_SetNoTrace(char *name, arity_t arity, Term tmod) { PredEntry *pe; if (arity == 0) { - pe = Yap_get_pred(MkAtomTerm(Yap_LookupAtom(name)), tmod, "no_trace"); + pe = Yap_get_pred(MkAtomTerm(Yap_LookupAtom(name)), tmod, "private"); } else { pe = RepPredProp( PredPropByFunc(Yap_MkFunctor(Yap_LookupAtom(name), arity), tmod)); @@ -4252,7 +4252,7 @@ static Int init_pred_flag_vals(USES_REGS1) { ModuleTransparentPredFlag PASS_REGS); pred_flag_clause(f, mod, "multi", MultiFileFlag PASS_REGS); pred_flag_clause(f, mod, "no_spy", NoSpyPredFlag PASS_REGS); - pred_flag_clause(f, mod, "no_trace", NoTracePredFlag PASS_REGS); + pred_flag_clause(f, mod, "private", NoTracePredFlag PASS_REGS); pred_flag_clause(f, mod, "number_db", NumberDBPredFlag PASS_REGS); pred_flag_clause(f, mod, "profiled", ProfiledPredFlag PASS_REGS); pred_flag_clause(f, mod, "quasi_quotation", QuasiQuotationPredFlag PASS_REGS); @@ -4331,9 +4331,9 @@ void Yap_InitCdMgr(void) { SafePredFlag | SyncPredFlag); Yap_InitCPred("$is_discontiguous", 2, p_is_discontiguous, TestPredFlag | SafePredFlag); - Yap_InitCPred("$is_no_trace", 2, p_is_no_trace, TestPredFlag | SafePredFlag); - Yap_InitCPred("$set_no_trace", 2, p_set_no_trace, - TestPredFlag | SafePredFlag); + Yap_InitCPred("$is_private", 2, p_is_private, TestPredFlag | SafePredFlag); + Yap_InitCPred("$set_private", 2, p_set_private, + SyncPredFlag | SafePredFlag); Yap_InitCPred("$is_profiled", 1, p_is_profiled, SafePredFlag | SyncPredFlag); Yap_InitCPred("$profile_info", 3, p_profile_info, SafePredFlag | SyncPredFlag); diff --git a/C/exec.c b/C/exec.c index de50c122e..4db48eb05 100755 --- a/C/exec.c +++ b/C/exec.c @@ -792,6 +792,14 @@ restart_exec: return CallPredicate(RepPredProp(pe), cut_cp, code PASS_REGS); } +static Int creep_clause(USES_REGS1) { /* '$execute_clause'(Goal) */ + Int rc = execute_clause( PASS_REGS1 ); + if (!LOCAL_InterruptsDisabled) { + Yap_signal(YAP_CREEP_SIGNAL); + } + return rc; +} + static Int execute_in_mod(USES_REGS1) { /* '$execute'(Goal) */ return do_execute(Deref(ARG1), Deref(ARG2) PASS_REGS); } @@ -898,6 +906,10 @@ static bool watch_cut(Term ext USES_REGS) { bool active = ArgOfTerm(5, task) == TermTrue; bool ex_mode = false; + LOCAL_Signals = 0; + CalculateStackGap(PASS_REGS1); + LOCAL_PrologMode = UserMode; + if (complete) { return true; } @@ -945,6 +957,9 @@ static bool watch_retry(Term d0 USES_REGS) { bool complete = !IsVarTerm(ArgOfTerm(4, task)); bool active = ArgOfTerm(5, task) == TermTrue; choiceptr B0 = (choiceptr)(LCL0 - IntegerOfTerm(ArgOfTerm(6, task))); + LOCAL_Signals = 0; + CalculateStackGap(PASS_REGS1); + LOCAL_PrologMode = UserMode; if (complete) return true; @@ -1003,6 +1018,9 @@ static Int setup_call_catcher_cleanup(USES_REGS1) { Int oENV = LCL0 - ENV; Int oYENV = LCL0 - YENV; bool rc; + LOCAL_Signals = 0; + CalculateStackGap(PASS_REGS1); + LOCAL_PrologMode = UserMode; Yap_DisableInterrupts(worker_id); rc = Yap_RunTopGoal(Setup, false); Yap_EnableInterrupts(worker_id); @@ -1038,6 +1056,9 @@ static Int cleanup_on_exit(USES_REGS1) { bool box = ArgOfTerm(1, task) == TermTrue; Term cleanup = ArgOfTerm(3, task); Term complete = IsNonVarTerm(ArgOfTerm(4, task)); + LOCAL_Signals = 0; + CalculateStackGap(PASS_REGS1); + LOCAL_PrologMode = UserMode; while (B->cp_ap->opc == FAIL_OPCODE) B = B->cp_b; @@ -2376,6 +2397,7 @@ void Yap_InitExecFs(void) { Yap_InitCPred("$execute_nonstop", 1, execute_nonstop1, NoTracePredFlag); Yap_InitCPred("$creep_step", 2, creep_step, NoTracePredFlag); Yap_InitCPred("$execute_clause", 4, execute_clause, NoTracePredFlag); + Yap_InitCPred("$creep_clause", 4,creep_clause, NoTracePredFlag); Yap_InitCPred("$current_choice_point", 1, current_choice_point, 0); Yap_InitCPred("$current_choicepoint", 1, current_choice_point, 0); CurrentModule = HACKS_MODULE; diff --git a/C/globals.c b/C/globals.c index 637066b64..e1c128900 100644 --- a/C/globals.c +++ b/C/globals.c @@ -212,7 +212,7 @@ static Term NewArena(UInt size, int wid, UInt arity, CELL *where, struct cell_sp WORKER_REGS(wid) exit_cell_space(cellSpace); // make sure we have enough room - while (HR + size > ASP - MIN_ARENA_SIZE) { + while (HR + size > ASP - 2*MIN_ARENA_SIZE) { if (!Yap_gcl(size * sizeof(CELL), arity, ENV, P)) { Yap_ThrowError(RESOURCE_ERROR_STACK, TermNil, LOCAL_ErrorMessage); return TermNil; diff --git a/library/rbtrees.yap b/library/rbtrees.yap index d78dace0c..bef880120 100644 --- a/library/rbtrees.yap +++ b/library/rbtrees.yap @@ -76,7 +76,7 @@ form colour(Left, Key, Value, Right), where _colour_ is one of =red= or rb_partial_map(+,+,2,-), rb_apply(+,+,2,-). - +/* :- use_module(library(type_check)). :- type rbtree(K,V) ---> t(tree(K,V),tree(K,V)). @@ -97,7 +97,7 @@ form colour(Left, Key, Value, Right), where _colour_ is one of =red= or :- pred max(tree(K,V),K,V). :- pred rb_next(rbtree(K,V),K,pair(K,V),V). :- pred next(tree(K,V),K,pair(K,V),V,tree(K,V)). - +*/ %% @pred rb_new(-T) is det. % create an empty tree. @@ -1455,4 +1455,4 @@ with _NewVal_. Fails if it cannot find _Key_ in _T_. */ -%%! @} \ No newline at end of file +%%! @} diff --git a/pl/debug.yap b/pl/debug.yap index e387ddb5f..cf5992193 100644 --- a/pl/debug.yap +++ b/pl/debug.yap @@ -296,27 +296,10 @@ be lost. * @param _Mod_:_Goal_ is the goal to be examined. * @return `call(Goal)` */ -'$trace'(Mod:G) :- - '$creep_is_off'(Mod:G,_GN0), - !, - gated_call( - true, - Mod:G, - E, - '$reenter_debugger'(E) - ). +%%! The first case matches system_predicates or zip '$trace'(Mod:G) :- '$$save_by'(CP), - '$trace_query'(G, Mod, CP, G, EG), - gated_call( - '$debugger_io', - ( '$enter_debugging'(G,Mod), EG ), - E, - '$continue_debugging'(E) - ). - - - + '$trace_query'(G, Mod, CP, _G). '$trace'(Mod:G, A1) :- @@ -408,100 +391,133 @@ be lost. '$trace_meta_call'( G, M, CP ) :- - '$trace_query'(G, M, CP, G, EG ), - call(EG). + '$trace_query'(G, M, CP, _G ). %% @pred '$trace_query'( +G, +M, +CP, +Expanded) % % debug a complex query % -'$trace_query'(V, M, _CP, _, call(M:V)) :- - var(V), !. -'$trace_query'(!, _, CP, _, '$$cut_by'(CP)) :- - !. -'$trace_query'('$cut_by'(M), _, _, _, '$$cut_by'(M)) :- - !. -'$trace_query'('$$cut_by'(M), _, _, _, '$$cut_by'(M)) :- - !. -'$trace_query'(true, _, _, _, true) :- !. -'$trace_query'(fail, _, _, _, '$trace'(fail)) :- !. -'$trace_query'(M:G, _, CP,S, Expanded) :- +'$trace_query'(V, M, _CP, _) :- + var(V), !, call(M:V). +'$trace_query'(!, _, CP, _) :- + !, '$$cut_by'(CP). +'$trace_query'('$cut_by'(M), _, _, _) :- + !, '$$cut_by'(M). +'$trace_query'('$$cut_by'(M), _, _, _) :- + !, '$$cut_by'(M). +'$trace_query'(M:G, _, CP,S) :- !, '$yap_strip_module'(M:G, M0, G0), - '$trace_query'(G0, M0, CP,S, Expanded ). -'$trace_query'((A,B), M, CP, S, (EA,EB)) :- !, - '$trace_query'(A, M, CP, S, EA), - '$trace_query'(B, M, CP, S, EB). -'$trace_query'((A->B), M, CP, S, (EA->EB)) :- !, - '$trace_query'(A, M, CP, S, EA), - '$trace_query'(B, M, CP, S, EB). -'$trace_query'((A;B), M, CP, S, (EA;EB)) :- !, - '$trace_query'(A, M, CP, S, EA), - '$trace_query'(B, M, CP, S, EB). -'$trace_query'((A|B), M, CP, S, (EA|EB)) :- !, - '$trace_query'(A, M, CP, S, EA), - '$trace_query'(B, M, CP, S, EB). -'$trace_query'((\+ A), M, CP, S, (\+ EA)) :- !, - '$trace_query'(A, M, CP, S, EA). -'$trace_query'(G, M, _CP, _, ( + '$trace_query'(G0, M0, CP,S ). +'$trace_query'((A,B), M, CP, S) :- !, + '$trace_query'(A, M, CP, S), + '$trace_query'(B, M, CP, S). +'$trace_query'((A->B), M, CP, S) :- !, + '$trace_query'(A, M, CP, S) -> + '$trace_query'(B, M, CP, S). +'$trace_query'((A;B), M, CP, S) :- !, + '$trace_query'(A, M, CP, S); + '$trace_query'(B, M, CP, S). +'$trace_query'((A|B), M, CP, S) :- !, + '$trace_query'(A, M, CP, S); + '$trace_query'(B, M, CP, S). +'$trace_query'((\+ A), M, CP, S) :- !, + '$trace_query'(A, M, CP, S). +'$trace_query'(G, M,_CP,S) :- + '$is_metapredicate'(G, prolog), + !, + '$debugger_expand_meta_call'(M:G, [], G1), + strip_module(M:G1, MF, NG), + % spy a literal + '$id_goal'(L), + catch( + '$trace_goal'(NG, MF, L, S), + E, + '$TraceError'(E, G, M, L, S) + ). +'$trace_query'(G, M, _CP, H) :- % spy a literal '$id_goal'(L), catch( '$trace_goal'(G, M, L, H), E, '$TraceError'(E, G, M, L, H) - ))). + ). + %% @pred $trace_goal( +Goal, +Module, +CallId, +CallInfo) %% %% Actually debugs a %% goal! +'$trace_goal'(G,M, _GoalNumber, _H) :- + ( + '$is_private'(G, M) + ; + current_prolog_flag(debug,false) + ), + !, + gated_call( + '$start_user_code', + % try creeping + '$execute_nonstop'(G,M), + Port, + '$reenter_debugger'(Port) + ). +'$trace_goal'(G,M, GoalNumber, H) :- + '$enter_trace'(GoalNumber, G, M, H), + '$creep_is_off'(M:G, GoalNumber), + !, + gated_call( + '$start_user_code', + % try creeping + '$execute_nonstop'(G,M), + Port, + '$trace_port_'( Port, GoalNumber, G, M, H) + ). '$trace_goal'(G,M, GoalNumber, H) :- '$is_source'(G,M), - '$current_choice_point'(CP), !, - '$enter_trace'(GoalNumber, G, M, H), + '$current_choice_point'(CP), + %clause generator: it controls fail, redo gated_call( true, - ( '$enter_debugging'(G,M,GoalNumber) - -> - % source mode - clause(M:G, B), '$trace_query'(B,M,CP,B,H) - ; - '$execute_nonstop'(G,M) - ), + clause(M:G, B), + Port0, + '$trace_port'(pred,Port0, GoalNumber, G, M, H) + ), + gated_call( + true,% source mode + '$trace'(B,M,CP,H), Port, ( - '$reenter_debugging'(Port,G,M,GoalNumber), - '$trace_port'(Port, GoalNumber, G, M, true, H) + '$trace_port'(clause,Port, GoalNumber, G, M, H) ) ). +'$trace_goal'(G,M, GoalNumber, H) :- + !, + '$current_choice_point'(CP), + %clause generator: it controls fail, redo + gated_call( + true, + '$static_clause'(G,M,_,Ref), + Port0, + '$trace_port'(pred,Port0, GoalNumber, G, M, H) + ), + gated_call( + '$start_user_code', + % source mode + '$creep_clause'(G,M,Ref,CP), + Port, + '$trace_port'(clause, Port, GoalNumber, G, M, H) + ). '$trace_goal'(G, M, GoalNumber, H) :- - '$is_metapredicate'(G, prolog), - !, - '$debugger_expand_meta_call'(M:G, [], G1), - strip_module(G1, MF, NG), - '$trace_goal__'(NG,MF, GoalNumber, H). -'$trace_goal'(G, M, GoalNumber, H) :- - '$trace_goal__'(G,M, GoalNumber, H). - -'$trace_goal__'(G,M, _GoalNumber, _H) :- '$undefined'(G,M), !, - '$undefp'([M|G], _). + '$undefp'([M|G], G1), + strip_module(G1, MF, NG), + '$trace_goal'(NG,MF, GoalNumber, H). + % system_ -'$trace_goal__'(G,M, GoalNumber, H) :- - '$enter_trace'(GoalNumber, G, M, H), - gated_call( - true, - ( - % try creeping - ( '$enter_debugging'(G,M,GoalNumber) -> '$creep' ; true ), - '$execute_nonstop'(G,M) - ), - Port, - '$trace_port'(Port, GoalNumber, G, M, true, H) - ). /** @@ -515,22 +531,12 @@ be lost. * */ '$enter_trace'(L, G, Module, Info) :- - /* get goal no. */ - ( var(L) -> - '__NB_getval__'('$spy_gn',L,fail), - /* bump it */ - L1 is L+1, - /* and save it globaly */ - '__NB_setval__'('$spy_gn',L1) - ; - true - ), + '$id_goal'(L), /* get goal no. */ /* get goal list */ '__NB_getval__'('$spy_glist',History,History=[]), H = [Info|History], Info = info(L,Module,G,_Retry,_Det,_HasFoundAnswers), - b_setval('$spy_glist',H), - /* and update it */ + b_setval('$spy_glist',H), /* and update it */ '$port'(call,G,Module,L,deterministic, Info). '$id_goal'(L) :- @@ -556,58 +562,44 @@ be lost. * @parameter _Info_ describes the goal * */ -'$trace_go'(GoalNumber, G, M, Info) :- - X=marker(_,M,G), - '$$save_by'(CP), - clause(M:G, Cl, _), - '$retry_clause'(GoalNumber, G, M, Info, X), - '$trace_query'(Cl, M, CP, Cl, ECl), - '$execute0'(ECl,M). +'$trace_port'(_, _, _GoalNumber, _G, _Module, _Info) :- + '$stop_creeping'(_), + fail. -'$creep_step'(GoalNumber, G, M, Info) :- - X=marker(_,M,G), - '$$save_by'(CP), - '$static_clause'(G,M,_,Ref), - '$retry_clause'(GoalNumber, G, M, Info, X), - '$creep', - '$execute_clause'(G,M,Ref,CP). - -'$retry_clause'(_GoalNumber, _G, _M, _Info, MarkerV) :- - arg(1, MarkerV, V), - var(V), +'$trace_port'(pred, fail, GoalNumber, G, Module, Info) :- + !, + '$trace_port_'(fail, GoalNumber, G, Module, Info). +'$trace_port'(pred, call, GoalNumber, G, Module, Info) :- + !, + '$trace_port_'(call, GoalNumber, G, Module, Info). +'$trace_port'(pred, redo, GoalNumber, G, Module, Info) :- !, - nb_setarg(1,MarkerV, visited). -'$retry_clause'(GoalNumber, G, Module, Info, _X) :- '$trace_port_'(redo, GoalNumber, G, Module, Info). +'$trace_port'(pred, _Port, _GoalNumber, _G, _Module, _Info). + -'$trace_port'(Port, GoalNumber, G, Module, _CalledFromDebugger, Info) :- - '$trace_off', +'$trace_port'(clause, call, _GoalNumber, _G, _Module, _Info). +'$trace_port'(clause, fail, _GoalNumber, _G, _Module, _Info) :- + fail. +'$trace_port'(clause, Port, GoalNumber, G, Module, Info) :- !, - '$trace_port_'(Port, GoalNumber, G, Module, Info), - '$continue_debugging'(Port). -'$trace_port'(Port, _GoalNumber, _G, _Module, _CalledFromDebugger, _Info) :- - '$continue_debugging'(Port). + '$trace_port_'(Port, GoalNumber, G, Module, Info). '$trace_port_'(call, GoalNumber, G, Module, Info) :- '$port'(call,G,Module,GoalNumber,deterministic, Info). '$trace_port_'(exit, GoalNumber, G, Module, Info) :- - nb_setarg(6, Info, true), '$port'(exit,G,Module,GoalNumber,deterministic, Info). '$trace_port_'(answer, GoalNumber, G, Module, Info) :- '$port'(exit,G,Module,GoalNumber,nondeterministic, Info). '$trace_port_'(redo, GoalNumber, G, Module, Info) :- - '$stop_creeping'(_ ), '$port'(redo,G,Module,GoalNumber,nondeterministic, Info). /* inform user_error */ '$trace_port_'(fail, GoalNumber, G, Module, Info) :- - '$stop_creeping'(_ ), '$port'(fail,G,Module,GoalNumber,deterministic, Info). /* inform user_error */ '$trace_port_'(! ,_GoalNumber,_G,_Module,_Imfo) :- /* inform user_error */ !. '$trace_port_'(exception(E), GoalNumber, G, Module, Info) :- - '$stop_creeping'(_ ), '$TraceError'(E, GoalNumber, G, Module, Info). '$trace_port_'(external_exception(E), GoalNumber, G, Module, Info) :- - '$stop_creeping'(_ ), '$TraceError'(E, GoalNumber, G, Module, Info). @@ -731,7 +723,7 @@ be lost. '__NB_getval__'('$trace',Trace,fail), '__NB_setval__'('$debug_status', state(creep, 0, stop, Trace)). '$action'(!,_,_,_,_,_) :- !, % ! 'g execute - read(debugger_input, G), + read(debugger_input, G), % don't allow yourself to be caught by creep. ignore( G ), skip( debugger_input, 10), % ' @@ -753,7 +745,6 @@ be lost. fail. '$action'(a,_,_,_,_,_) :- !, % 'a abort skip( debugger_input, 10), - '$stop_creeping'(_), nodebug, abort. '$action'(b,_,_,_,_,_) :- !, % 'b break diff --git a/pl/signals.yap b/pl/signals.yap index 4a0cb7242..215697084 100644 --- a/pl/signals.yap +++ b/pl/signals.yap @@ -295,18 +295,18 @@ read_sig. % % % make thes predicates non-traceable. % -:- '$set_no_trace'(current_choicepoint(_DCP), yap_hacks). -:- '$set_no_trace'('$current_choice_point'(_DCP), _). -:- '$set_no_trace'('$$cut_by'(_DCP), prolog). -:- '$set_no_trace'(true, yap_hacks). -:- '$set_no_trace'(true, prolog). -:- '$set_no_trace'('$call'(_,_,_,_), prolog). -:- '$set_no_trace'('$execute_nonstop'(_,_), prolog). -:- '$set_no_trace'('$execute_clause'(_,_,_,_), prolog). -:- '$set_no_trace'('$restore_regs'(_,_), prolog). -:- '$set_no_trace'('$undefp'(_,_), prolog). -:- '$set_no_trace'('$Error'(_), prolog). -:- '$set_no_trace'('$LoopError'(_,_), prolog). -:- '$set_no_trace'('$TraceError'(_,_,_,_,_), prolog). +:- '$set_private'(current_choicepoint(_DCP), yap_hacks). +:- '$set_private'('$current_choice_point'(_DCP), _). +:- '$set_private'('$$cut_by'(_DCP), prolog). +:- '$set_private'(true, yap_hacks). +:- '$set_private'(true, prolog). +:- '$set_private'('$call'(_,_,_,_), prolog). +:- '$set_private'('$execute_nonstop'(_,_), prolog). +:- '$set_private'('$execute_clause'(_,_,_,_), prolog). +:- '$set_private'('$restore_regs'(_,_), prolog). +:- '$set_private'('$undefp'(_,_), prolog). +:- '$set_private'('$Error'(_), prolog). +:- '$set_private'('$LoopError'(_,_), prolog). +:- '$set_private'('$TraceError'(_,_,_,_,_), prolog). %%! @} diff --git a/pl/spy.yap b/pl/spy.yap index 2d7305b3c..a6b734db5 100644 --- a/pl/spy.yap +++ b/pl/spy.yap @@ -200,13 +200,15 @@ nospyall. debug :- '$init_debugger', ( '__NB_getval__'('$spy_gn',_, fail) -> true ; '__NB_setval__'('$spy_gn',1) ), - '$start_debugging'(on), + set_prolog_flag(debug,true), + '$start_user_code', print_message(informational,debug(debug)). -'$start_debugging'(_Mode) :- - '__NB_setval__'(debug, false), +'$start_user_code' :- + yap_flag(debug, Can), + '__NB_setval__'(debug, Can), '__NB_getval__'('$trace',Trace, fail), - ( Trace == on -> Creep = crep; Creep = zip ), + ( Trace == on -> Creep = creep; Creep = zip ), '__NB_setval__'('$debug_state',state(Creep,0,stop,Trace) ). nodebug :- @@ -228,13 +230,10 @@ Switches on the debugger and enters tracing mode. */ trace :- - '$init_debugger', - fail. -trace :- - '__NB_setval__'('$trace',on), - '$start_debugging'(on), print_message(informational,debug(trace)), - '$creep'. + set_prolog_flag(debug,true), + '__NB_setval__'('$trace',on), + '$init_debugger'. /** @pred notrace @@ -392,16 +391,18 @@ notrace(G) :- '$enable_debugging'. '$init_debugger' :- - '$init_debugger_trace', + '$debugger_io', + '$init_debugger_trace', '__NB_setval__'('$if_skip_mode',no_skip), '__NB_setval__'('$spy_glist',[]), '__NB_setval__'('$spy_gn',1). '$init_debugger_trace' :- '__NB_getval__'('$trace',on,fail), - !, - nb_setval('$debug_status', state(creep, 0, stop, on)). + !, + nb_setval('$debug_status', state(creep, 0, stop, on)). '$init_debugger_trace' :- + '__NB_setval__'('$trace',off), nb_setval('$debug_status', state(zip, 0, stop, off)). %% @pred $enter_debugging(G,Mod,CP,G0,NG) @@ -409,14 +410,27 @@ notrace(G) :- %% Internal predicate called by top-level; %% enable creeping on a goal by just switching execution to debugger. %% -'$enter_debugging'(G,Mod,CP,G0,NG) :- +'$enter_debugging'(G,Mod,_CP,_G0,_NG) :- '$creepcalls'(G,Mod), - !, - '$trace_query'(G,Mod,CP,G0,NG). + !. '$enter_debugging'(G,_Mod,_CP,_G0,G). '$enter_debugging'(G,Mod,GN) :- - çurrent_prolog_flag( debug, Deb ), + current_prolog_flag( debug, Deb ), + '__NB_set_value__'( debug, Deb ), + ( Deb = false + -> + true + ; + '$creep_is_on_at_entry'(G,Mod,GN) + -> + '$creep' + ; + true + ). + +'$exit_debugger'(Mod:G, GN) :- + current_prolog_flag( debug, Deb ), '__NB_set_value__'( debug, Deb ), ( Deb = false -> @@ -431,7 +445,7 @@ notrace(G) :- %% we're coming back from external code to a debugger call. %% -'$reenter_debugger'(retry) :- +'$reenter_debugger'(fail) :- '$re_enter_creep_mode'. '$reenter_debugger'(_) :- '__NB_setval__'(debug, false). @@ -442,10 +456,15 @@ notrace(G) :- '$re_enter_creep_mode'. '$continue_debugging'(answer) :- !, - '$re_enter_creep_mode'. + '$re_enter_creep_mode'. '$continue_debugging'(fail) :- !, '$re_enter_creep_mode', + fail. +'$continue_debugging'(redo) :- + !, + '$re_enter_creep_mode', + fail. '$continue_debugging'(_). '$enable_debugging' :- @@ -458,33 +477,37 @@ notrace(G) :- %% enable creeping on the next goal. %% '$re_enter_creep_mode' :- - !, - '$creep'. -'$re_enter_creep_mode'. + current_prolog_flag( debug, Deb ), + '__NB_setval__'( debug, Deb ). -'$creep_is_off'(Module:G, GN0) :- - '__NB_getval__'('$debug_status',state(zip, GN, Spy,_), fail), - ( - + +'$creep_is_off'(Module:G, GoalNo) :- + ( + current_prolog_flag( debug, false ) + -> true + ; + '$system_predicate'(G,Module) + -> true + ; + '$is_private'(G,Module) + -> true + ; + '__NB_getval__'('$debug_status',state(zip, GN, Spy,_), fail) + -> + true + ; '$pred_being_spied'(G,Module) -> Spy == ignore ; - var(GN0) + var(GN) -> - true + false ; - GN > GN0 - ). - -%% -% -'$creep_is_on' :- - '__NB_getval__'('$debug_status',state(Step, _GN, _Spy,_), fail), - Step \= zip. - -'$creep_is_on_at_entry'(G,M,GoalNo) :- - \+ '$system_predicate'(G,M), + GN > GoalNo + ). +'$creep_is_on_at_entry'(G,M,_GoalNo) :- + \+ '$system_predicate'(G,M), '__NB_getval__'('$debug_status',state(Step, _GN, Spy,_), fail), ( Step \= zip @@ -496,7 +519,7 @@ notrace(G) :- '$trace_on' :- '__NB_getval__'('$debug_status', state(_Creep, GN, Spy,Trace), fail), - nb_getval('$trace',on), + nb_setval('$trace',on), nb_setval('$debug_status', state(creep, GN, Spy, Trace)). '$trace_off' :- diff --git a/pl/top.yap b/pl/top.yap index 9a3db0b30..117b4cd2a 100644 --- a/pl/top.yap +++ b/pl/top.yap @@ -93,16 +93,6 @@ live :- ; '$halt'(0) ). -'$init_debug' :- - nb_setval('$spy_gn', 1), - % stop at spy-points if debugging is on. - nb_setval('$debug_run', off), - nb_setval('$debug_jump', off), - '__NB_getval__'('$trace', Trace, fail), - ( Trace==on - -> nb_setval('$debug_status', state(creep, 0, stop, on)) - ; nb_setval('$debug_status', state(zip, 0, stop, off)) - ). '$erase_sets' :- eraseall($), @@ -587,21 +577,10 @@ write_query_answer( Bindings ) :- '$call'(G, CP, G, M). '$user_call'(G, CP, G0, M) :- - gated_call( - '$enable_debugging', - '$call'(G, CP, G0, M), - Port, - '$reenter_debugger'(Port) - ). - + '$trace_query'(G, M, CP, G0). '$user_call'(G, M) :- - gated_call( - '$enable_debugging', - M:G, - Port, - '$reenter_debugger'(Port) - ). + '$trace'(M:G). '$cut_by'(CP) :- '$$cut_by'(CP).