Gecode 5.0.0

This commit is contained in:
Vitor Santos Costa 2016-12-10 03:09:59 -06:00
parent 45a54e2b04
commit 82ad65a344
17 changed files with 18711 additions and 3424 deletions

View File

@ -0,0 +1 @@
5.0.0

File diff suppressed because it is too large Load Diff

View File

@ -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 <http://www.gnu.org/licenses/>.
//=============================================================================
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);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,674 @@
// -*- 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 <http://www.gnu.org/licenses/>.
//=============================================================================
{ 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_SPEED");
gecode_IPL_SPEED = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("IPL_MEMORY");
gecode_IPL_MEMORY = 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_DONE");
gecode_TE_DONE = 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_unary_476", gecode_constraint_unary_476, 6);
YAP_UserCPredicate("gecode_constraint_unary_472", gecode_constraint_unary_472, 6);
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_357", gecode_constraint_nvalues_357, 5);
YAP_UserCPredicate("gecode_constraint_nvalues_359", gecode_constraint_nvalues_359, 5);
YAP_UserCPredicate("gecode_constraint_max_315", gecode_constraint_max_315, 4);
YAP_UserCPredicate("gecode_constraint_max_321", gecode_constraint_max_321, 4);
YAP_UserCPredicate("gecode_constraint_max_314", gecode_constraint_max_314, 4);
YAP_UserCPredicate("gecode_constraint_max_318", gecode_constraint_max_318, 4);
YAP_UserCPredicate("gecode_constraint_dom_205", gecode_constraint_dom_205, 6);
YAP_UserCPredicate("gecode_constraint_dom_211", gecode_constraint_dom_211, 6);
YAP_UserCPredicate("gecode_constraint_argmin_10", gecode_constraint_argmin_10, 3);
YAP_UserCPredicate("gecode_constraint_convex_105", gecode_constraint_convex_105, 3);
YAP_UserCPredicate("gecode_constraint_nooverlap_343", gecode_constraint_nooverlap_343, 5);
YAP_UserCPredicate("gecode_constraint_assign_18", gecode_constraint_assign_18, 3);
YAP_UserCPredicate("gecode_constraint_assign_27", gecode_constraint_assign_27, 3);
YAP_UserCPredicate("gecode_constraint_assign_24", gecode_constraint_assign_24, 3);
YAP_UserCPredicate("gecode_constraint_assign_16", gecode_constraint_assign_16, 3);
YAP_UserCPredicate("gecode_constraint_assign_30", gecode_constraint_assign_30, 3);
YAP_UserCPredicate("gecode_constraint_assign_20", gecode_constraint_assign_20, 3);
YAP_UserCPredicate("gecode_constraint_assign_33", gecode_constraint_assign_33, 3);
YAP_UserCPredicate("gecode_constraint_assign_22", gecode_constraint_assign_22, 3);
YAP_UserCPredicate("gecode_constraint_element_256", gecode_constraint_element_256, 4);
YAP_UserCPredicate("gecode_constraint_element_258", gecode_constraint_element_258, 4);
YAP_UserCPredicate("gecode_constraint_element_250", gecode_constraint_element_250, 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_262", gecode_constraint_element_262, 4);
YAP_UserCPredicate("gecode_constraint_element_232", gecode_constraint_element_232, 4);
YAP_UserCPredicate("gecode_constraint_element_234", gecode_constraint_element_234, 4);
YAP_UserCPredicate("gecode_constraint_element_230", gecode_constraint_element_230, 4);
YAP_UserCPredicate("gecode_constraint_sequence_453", gecode_constraint_sequence_453, 2);
YAP_UserCPredicate("gecode_constraint_notMax_351", gecode_constraint_notMax_351, 3);
YAP_UserCPredicate("gecode_constraint_ite_272", gecode_constraint_ite_272, 5);
YAP_UserCPredicate("gecode_constraint_unary_465", gecode_constraint_unary_465, 3);
YAP_UserCPredicate("gecode_constraint_nroot_355", gecode_constraint_nroot_355, 5);
YAP_UserCPredicate("gecode_constraint_circuit_99", gecode_constraint_circuit_99, 4);
YAP_UserCPredicate("gecode_constraint_circuit_88", gecode_constraint_circuit_88, 4);
YAP_UserCPredicate("gecode_constraint_dom_203", gecode_constraint_dom_203, 5);
YAP_UserCPredicate("gecode_constraint_dom_204", gecode_constraint_dom_204, 5);
YAP_UserCPredicate("gecode_constraint_dom_201", gecode_constraint_dom_201, 5);
YAP_UserCPredicate("gecode_constraint_dom_197", gecode_constraint_dom_197, 5);
YAP_UserCPredicate("gecode_constraint_dom_228", gecode_constraint_dom_228, 5);
YAP_UserCPredicate("gecode_constraint_dom_225", gecode_constraint_dom_225, 5);
YAP_UserCPredicate("gecode_constraint_dom_188", gecode_constraint_dom_188, 5);
YAP_UserCPredicate("gecode_constraint_dom_210", gecode_constraint_dom_210, 5);
YAP_UserCPredicate("gecode_constraint_dom_209", gecode_constraint_dom_209, 5);
YAP_UserCPredicate("gecode_constraint_dom_207", gecode_constraint_dom_207, 5);
YAP_UserCPredicate("gecode_constraint_argmax_9", gecode_constraint_argmax_9, 6);
YAP_UserCPredicate("gecode_constraint_nooverlap_348", gecode_constraint_nooverlap_348, 8);
YAP_UserCPredicate("gecode_constraint_nooverlap_349", gecode_constraint_nooverlap_349, 8);
YAP_UserCPredicate("gecode_constraint_element_260", gecode_constraint_element_260, 7);
YAP_UserCPredicate("gecode_constraint_element_252", gecode_constraint_element_252, 7);
YAP_UserCPredicate("gecode_constraint_element_255", gecode_constraint_element_255, 7);
YAP_UserCPredicate("gecode_constraint_element_263", gecode_constraint_element_263, 7);
YAP_UserCPredicate("gecode_constraint_element_238", gecode_constraint_element_238, 7);
YAP_UserCPredicate("gecode_constraint_element_236", gecode_constraint_element_236, 7);
YAP_UserCPredicate("gecode_constraint_max_319", gecode_constraint_max_319, 3);
YAP_UserCPredicate("gecode_constraint_max_320", gecode_constraint_max_320, 3);
YAP_UserCPredicate("gecode_constraint_max_317", gecode_constraint_max_317, 3);
YAP_UserCPredicate("gecode_constraint_unshare_479", gecode_constraint_unshare_479, 2);
YAP_UserCPredicate("gecode_constraint_unshare_477", gecode_constraint_unshare_477, 2);
YAP_UserCPredicate("gecode_constraint_path_374", gecode_constraint_path_374, 5);
YAP_UserCPredicate("gecode_constraint_path_373", gecode_constraint_path_373, 5);
YAP_UserCPredicate("gecode_constraint_branch_61", gecode_constraint_branch_61, 7);
YAP_UserCPredicate("gecode_constraint_branch_52", gecode_constraint_branch_52, 7);
YAP_UserCPredicate("gecode_constraint_branch_67", gecode_constraint_branch_67, 7);
YAP_UserCPredicate("gecode_constraint_mult_341", gecode_constraint_mult_341, 4);
YAP_UserCPredicate("gecode_constraint_mult_340", gecode_constraint_mult_340, 4);
YAP_UserCPredicate("gecode_constraint_clause_103", gecode_constraint_clause_103, 6);
YAP_UserCPredicate("gecode_constraint_clause_101", gecode_constraint_clause_101, 6);
YAP_UserCPredicate("gecode_constraint_precede_382", gecode_constraint_precede_382, 5);
YAP_UserCPredicate("gecode_constraint_argmax_4", gecode_constraint_argmax_4, 3);
YAP_UserCPredicate("gecode_constraint_distinct_176", gecode_constraint_distinct_176, 2);
YAP_UserCPredicate("gecode_constraint_member_327", gecode_constraint_member_327, 4);
YAP_UserCPredicate("gecode_constraint_member_328", gecode_constraint_member_328, 4);
YAP_UserCPredicate("gecode_constraint_member_323", gecode_constraint_member_323, 4);
YAP_UserCPredicate("gecode_constraint_member_324", gecode_constraint_member_324, 4);
YAP_UserCPredicate("gecode_constraint_mod_339", gecode_constraint_mod_339, 5);
YAP_UserCPredicate("gecode_constraint_cardinality_68", gecode_constraint_cardinality_68, 3);
YAP_UserCPredicate("gecode_constraint_atmostOne_36", gecode_constraint_atmostOne_36, 3);
YAP_UserCPredicate("gecode_constraint_channelSorted_87", gecode_constraint_channelSorted_87, 3);
YAP_UserCPredicate("gecode_constraint_linear_288", gecode_constraint_linear_288, 4);
YAP_UserCPredicate("gecode_constraint_linear_286", gecode_constraint_linear_286, 4);
YAP_UserCPredicate("gecode_constraint_linear_274", gecode_constraint_linear_274, 4);
YAP_UserCPredicate("gecode_constraint_linear_278", gecode_constraint_linear_278, 4);
YAP_UserCPredicate("gecode_constraint_linear_306", gecode_constraint_linear_306, 4);
YAP_UserCPredicate("gecode_constraint_linear_310", gecode_constraint_linear_310, 4);
YAP_UserCPredicate("gecode_constraint_circuit_96", gecode_constraint_circuit_96, 2);
YAP_UserCPredicate("gecode_constraint_rel_402", gecode_constraint_rel_402, 5);
YAP_UserCPredicate("gecode_constraint_rel_404", gecode_constraint_rel_404, 5);
YAP_UserCPredicate("gecode_constraint_rel_398", gecode_constraint_rel_398, 5);
YAP_UserCPredicate("gecode_constraint_rel_399", gecode_constraint_rel_399, 5);
YAP_UserCPredicate("gecode_constraint_rel_394", gecode_constraint_rel_394, 5);
YAP_UserCPredicate("gecode_constraint_rel_395", gecode_constraint_rel_395, 5);
YAP_UserCPredicate("gecode_constraint_rel_391", gecode_constraint_rel_391, 5);
YAP_UserCPredicate("gecode_constraint_rel_389", gecode_constraint_rel_389, 5);
YAP_UserCPredicate("gecode_constraint_rel_436", gecode_constraint_rel_436, 5);
YAP_UserCPredicate("gecode_constraint_rel_434", gecode_constraint_rel_434, 5);
YAP_UserCPredicate("gecode_constraint_rel_430", gecode_constraint_rel_430, 5);
YAP_UserCPredicate("gecode_constraint_rel_419", gecode_constraint_rel_419, 5);
YAP_UserCPredicate("gecode_constraint_rel_417", gecode_constraint_rel_417, 5);
YAP_UserCPredicate("gecode_constraint_rel_444", gecode_constraint_rel_444, 5);
YAP_UserCPredicate("gecode_constraint_rel_448", gecode_constraint_rel_448, 5);
YAP_UserCPredicate("gecode_constraint_rel_446", gecode_constraint_rel_446, 5);
YAP_UserCPredicate("gecode_constraint_rel_406", gecode_constraint_rel_406, 5);
YAP_UserCPredicate("gecode_constraint_rel_407", gecode_constraint_rel_407, 5);
YAP_UserCPredicate("gecode_constraint_rel_411", gecode_constraint_rel_411, 5);
YAP_UserCPredicate("gecode_constraint_rel_412", gecode_constraint_rel_412, 5);
YAP_UserCPredicate("gecode_constraint_rel_415", gecode_constraint_rel_415, 5);
YAP_UserCPredicate("gecode_constraint_rel_426", gecode_constraint_rel_426, 5);
YAP_UserCPredicate("gecode_constraint_rel_428", gecode_constraint_rel_428, 5);
YAP_UserCPredicate("gecode_constraint_rel_388", gecode_constraint_rel_388, 5);
YAP_UserCPredicate("gecode_constraint_rel_386", gecode_constraint_rel_386, 5);
YAP_UserCPredicate("gecode_constraint_min_331", gecode_constraint_min_331, 4);
YAP_UserCPredicate("gecode_constraint_min_337", gecode_constraint_min_337, 4);
YAP_UserCPredicate("gecode_constraint_min_330", gecode_constraint_min_330, 4);
YAP_UserCPredicate("gecode_constraint_min_334", gecode_constraint_min_334, 4);
YAP_UserCPredicate("gecode_constraint_cardinality_70", gecode_constraint_cardinality_70, 4);
YAP_UserCPredicate("gecode_constraint_cardinality_69", gecode_constraint_cardinality_69, 4);
YAP_UserCPredicate("gecode_constraint_count_125", gecode_constraint_count_125, 4);
YAP_UserCPredicate("gecode_constraint_count_126", gecode_constraint_count_126, 4);
YAP_UserCPredicate("gecode_constraint_count_118", gecode_constraint_count_118, 4);
YAP_UserCPredicate("gecode_constraint_count_121", gecode_constraint_count_121, 4);
YAP_UserCPredicate("gecode_constraint_count_122", gecode_constraint_count_122, 4);
YAP_UserCPredicate("gecode_constraint_sqrt_463", gecode_constraint_sqrt_463, 3);
YAP_UserCPredicate("gecode_constraint_sqrt_462", gecode_constraint_sqrt_462, 3);
YAP_UserCPredicate("gecode_constraint_cumulatives_171", gecode_constraint_cumulatives_171, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_169", gecode_constraint_cumulatives_169, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_167", gecode_constraint_cumulatives_167, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_165", gecode_constraint_cumulatives_165, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_163", gecode_constraint_cumulatives_163, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_161", gecode_constraint_cumulatives_161, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_159", gecode_constraint_cumulatives_159, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_157", gecode_constraint_cumulatives_157, 9);
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_356", gecode_constraint_nvalues_356, 4);
YAP_UserCPredicate("gecode_constraint_nvalues_358", gecode_constraint_nvalues_358, 4);
YAP_UserCPredicate("gecode_constraint_binpacking_37", gecode_constraint_binpacking_37, 4);
YAP_UserCPredicate("gecode_constraint_linear_301", gecode_constraint_linear_301, 7);
YAP_UserCPredicate("gecode_constraint_linear_305", gecode_constraint_linear_305, 7);
YAP_UserCPredicate("gecode_constraint_linear_293", gecode_constraint_linear_293, 7);
YAP_UserCPredicate("gecode_constraint_linear_297", gecode_constraint_linear_297, 7);
YAP_UserCPredicate("gecode_constraint_abs_3", gecode_constraint_abs_3, 4);
YAP_UserCPredicate("gecode_constraint_convex_104", gecode_constraint_convex_104, 2);
YAP_UserCPredicate("gecode_constraint_div_181", gecode_constraint_div_181, 4);
YAP_UserCPredicate("gecode_constraint_div_180", gecode_constraint_div_180, 4);
YAP_UserCPredicate("gecode_constraint_rel_408", gecode_constraint_rel_408, 6);
YAP_UserCPredicate("gecode_constraint_rel_413", gecode_constraint_rel_413, 6);
YAP_UserCPredicate("gecode_constraint_rel_440", gecode_constraint_rel_440, 6);
YAP_UserCPredicate("gecode_constraint_rel_439", gecode_constraint_rel_439, 6);
YAP_UserCPredicate("gecode_constraint_rel_400", gecode_constraint_rel_400, 6);
YAP_UserCPredicate("gecode_constraint_rel_396", gecode_constraint_rel_396, 6);
YAP_UserCPredicate("gecode_constraint_rel_392", gecode_constraint_rel_392, 6);
YAP_UserCPredicate("gecode_constraint_rel_390", gecode_constraint_rel_390, 6);
YAP_UserCPredicate("gecode_constraint_rel_424", gecode_constraint_rel_424, 6);
YAP_UserCPredicate("gecode_constraint_rel_423", gecode_constraint_rel_423, 6);
YAP_UserCPredicate("gecode_constraint_rel_422", gecode_constraint_rel_422, 6);
YAP_UserCPredicate("gecode_constraint_rel_421", gecode_constraint_rel_421, 6);
YAP_UserCPredicate("gecode_constraint_weights_481", gecode_constraint_weights_481, 5);
YAP_UserCPredicate("gecode_constraint_max_316", gecode_constraint_max_316, 5);
YAP_UserCPredicate("gecode_constraint_path_371", gecode_constraint_path_371, 9);
YAP_UserCPredicate("gecode_constraint_unary_473", gecode_constraint_unary_473, 4);
YAP_UserCPredicate("gecode_constraint_unary_469", gecode_constraint_unary_469, 4);
YAP_UserCPredicate("gecode_constraint_unary_466", gecode_constraint_unary_466, 4);
YAP_UserCPredicate("gecode_constraint_unary_467", gecode_constraint_unary_467, 4);
YAP_UserCPredicate("gecode_constraint_nroot_354", gecode_constraint_nroot_354, 4);
YAP_UserCPredicate("gecode_constraint_nroot_353", gecode_constraint_nroot_353, 4);
YAP_UserCPredicate("gecode_constraint_sorted_458", gecode_constraint_sorted_458, 5);
YAP_UserCPredicate("gecode_constraint_circuit_92", gecode_constraint_circuit_92, 5);
YAP_UserCPredicate("gecode_constraint_circuit_89", gecode_constraint_circuit_89, 5);
YAP_UserCPredicate("gecode_constraint_circuit_90", gecode_constraint_circuit_90, 5);
YAP_UserCPredicate("gecode_constraint_dom_190", gecode_constraint_dom_190, 4);
YAP_UserCPredicate("gecode_constraint_dom_187", gecode_constraint_dom_187, 4);
YAP_UserCPredicate("gecode_constraint_dom_215", gecode_constraint_dom_215, 4);
YAP_UserCPredicate("gecode_constraint_dom_214", gecode_constraint_dom_214, 4);
YAP_UserCPredicate("gecode_constraint_dom_186", gecode_constraint_dom_186, 4);
YAP_UserCPredicate("gecode_constraint_dom_224", gecode_constraint_dom_224, 4);
YAP_UserCPredicate("gecode_constraint_dom_223", gecode_constraint_dom_223, 4);
YAP_UserCPredicate("gecode_constraint_dom_221", gecode_constraint_dom_221, 4);
YAP_UserCPredicate("gecode_constraint_dom_219", gecode_constraint_dom_219, 4);
YAP_UserCPredicate("gecode_constraint_dom_193", gecode_constraint_dom_193, 4);
YAP_UserCPredicate("gecode_constraint_dom_202", gecode_constraint_dom_202, 4);
YAP_UserCPredicate("gecode_constraint_dom_199", gecode_constraint_dom_199, 4);
YAP_UserCPredicate("gecode_constraint_dom_200", gecode_constraint_dom_200, 4);
YAP_UserCPredicate("gecode_constraint_dom_195", gecode_constraint_dom_195, 4);
YAP_UserCPredicate("gecode_constraint_dom_196", gecode_constraint_dom_196, 4);
YAP_UserCPredicate("gecode_constraint_dom_227", gecode_constraint_dom_227, 4);
YAP_UserCPredicate("gecode_constraint_dom_226", gecode_constraint_dom_226, 4);
YAP_UserCPredicate("gecode_constraint_dom_208", gecode_constraint_dom_208, 4);
YAP_UserCPredicate("gecode_constraint_dom_206", gecode_constraint_dom_206, 4);
YAP_UserCPredicate("gecode_constraint_abs_2", gecode_constraint_abs_2, 3);
YAP_UserCPredicate("gecode_constraint_abs_1", gecode_constraint_abs_1, 3);
YAP_UserCPredicate("gecode_constraint_channel_84", gecode_constraint_channel_84, 5);
YAP_UserCPredicate("gecode_constraint_channel_79", gecode_constraint_channel_79, 5);
YAP_UserCPredicate("gecode_constraint_assign_29", gecode_constraint_assign_29, 5);
YAP_UserCPredicate("gecode_constraint_assign_26", gecode_constraint_assign_26, 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_rel_441", gecode_constraint_rel_441, 3);
YAP_UserCPredicate("gecode_constraint_rel_431", gecode_constraint_rel_431, 3);
YAP_UserCPredicate("gecode_constraint_path_372", gecode_constraint_path_372, 4);
YAP_UserCPredicate("gecode_constraint_branch_42", gecode_constraint_branch_42, 4);
YAP_UserCPredicate("gecode_constraint_branch_53", gecode_constraint_branch_53, 4);
YAP_UserCPredicate("gecode_constraint_branch_47", gecode_constraint_branch_47, 4);
YAP_UserCPredicate("gecode_constraint_branch_40", gecode_constraint_branch_40, 4);
YAP_UserCPredicate("gecode_constraint_branch_56", gecode_constraint_branch_56, 4);
YAP_UserCPredicate("gecode_constraint_branch_44", gecode_constraint_branch_44, 4);
YAP_UserCPredicate("gecode_constraint_branch_62", gecode_constraint_branch_62, 4);
YAP_UserCPredicate("gecode_constraint_branch_46", gecode_constraint_branch_46, 4);
YAP_UserCPredicate("gecode_constraint_mult_342", gecode_constraint_mult_342, 5);
YAP_UserCPredicate("gecode_constraint_circuit_93", gecode_constraint_circuit_93, 6);
YAP_UserCPredicate("gecode_constraint_circuit_94", gecode_constraint_circuit_94, 6);
YAP_UserCPredicate("gecode_constraint_circuit_91", gecode_constraint_circuit_91, 6);
YAP_UserCPredicate("gecode_constraint_clause_102", gecode_constraint_clause_102, 5);
YAP_UserCPredicate("gecode_constraint_clause_100", gecode_constraint_clause_100, 5);
YAP_UserCPredicate("gecode_constraint_precede_384", gecode_constraint_precede_384, 4);
YAP_UserCPredicate("gecode_constraint_precede_381", gecode_constraint_precede_381, 4);
YAP_UserCPredicate("gecode_constraint_precede_380", gecode_constraint_precede_380, 4);
YAP_UserCPredicate("gecode_constraint_channel_85", gecode_constraint_channel_85, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_141", gecode_constraint_cumulative_141, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_142", gecode_constraint_cumulative_142, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_137", gecode_constraint_cumulative_137, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_138", gecode_constraint_cumulative_138, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_135", gecode_constraint_cumulative_135, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_153", gecode_constraint_cumulative_153, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_154", gecode_constraint_cumulative_154, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_149", gecode_constraint_cumulative_149, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_150", gecode_constraint_cumulative_150, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_147", gecode_constraint_cumulative_147, 7);
YAP_UserCPredicate("gecode_constraint_distinct_178", gecode_constraint_distinct_178, 3);
YAP_UserCPredicate("gecode_constraint_distinct_177", gecode_constraint_distinct_177, 3);
YAP_UserCPredicate("gecode_constraint_distinct_172", gecode_constraint_distinct_172, 3);
YAP_UserCPredicate("gecode_constraint_distinct_174", gecode_constraint_distinct_174, 3);
YAP_UserCPredicate("gecode_constraint_member_329", gecode_constraint_member_329, 5);
YAP_UserCPredicate("gecode_constraint_member_325", gecode_constraint_member_325, 5);
YAP_UserCPredicate("gecode_constraint_mod_338", gecode_constraint_mod_338, 4);
YAP_UserCPredicate("gecode_constraint_sqr_460", gecode_constraint_sqr_460, 3);
YAP_UserCPredicate("gecode_constraint_sqr_459", gecode_constraint_sqr_459, 3);
YAP_UserCPredicate("gecode_constraint_sequence_452", gecode_constraint_sequence_452, 7);
YAP_UserCPredicate("gecode_constraint_sequence_450", gecode_constraint_sequence_450, 7);
YAP_UserCPredicate("gecode_constraint_path_368", gecode_constraint_path_368, 7);
YAP_UserCPredicate("gecode_constraint_path_365", gecode_constraint_path_365, 7);
YAP_UserCPredicate("gecode_constraint_path_366", gecode_constraint_path_366, 7);
YAP_UserCPredicate("gecode_constraint_divmod_184", gecode_constraint_divmod_184, 6);
YAP_UserCPredicate("gecode_constraint_sorted_455", gecode_constraint_sorted_455, 3);
YAP_UserCPredicate("gecode_constraint_extensional_271", gecode_constraint_extensional_271, 4);
YAP_UserCPredicate("gecode_constraint_extensional_269", gecode_constraint_extensional_269, 4);
YAP_UserCPredicate("gecode_constraint_extensional_267", gecode_constraint_extensional_267, 4);
YAP_UserCPredicate("gecode_constraint_extensional_265", gecode_constraint_extensional_265, 4);
YAP_UserCPredicate("gecode_constraint_circuit_98", gecode_constraint_circuit_98, 3);
YAP_UserCPredicate("gecode_constraint_circuit_97", gecode_constraint_circuit_97, 3);
YAP_UserCPredicate("gecode_constraint_argmin_11", gecode_constraint_argmin_11, 4);
YAP_UserCPredicate("gecode_constraint_argmin_13", gecode_constraint_argmin_13, 4);
YAP_UserCPredicate("gecode_constraint_channel_75", gecode_constraint_channel_75, 3);
YAP_UserCPredicate("gecode_constraint_channel_74", gecode_constraint_channel_74, 3);
YAP_UserCPredicate("gecode_constraint_channel_77", gecode_constraint_channel_77, 3);
YAP_UserCPredicate("gecode_constraint_channel_80", gecode_constraint_channel_80, 3);
YAP_UserCPredicate("gecode_constraint_channel_72", gecode_constraint_channel_72, 3);
YAP_UserCPredicate("gecode_constraint_channel_71", gecode_constraint_channel_71, 3);
YAP_UserCPredicate("gecode_constraint_channel_83", gecode_constraint_channel_83, 3);
YAP_UserCPredicate("gecode_constraint_channel_81", gecode_constraint_channel_81, 3);
YAP_UserCPredicate("gecode_constraint_channel_76", gecode_constraint_channel_76, 3);
YAP_UserCPredicate("gecode_constraint_channel_86", gecode_constraint_channel_86, 3);
YAP_UserCPredicate("gecode_constraint_count_110", gecode_constraint_count_110, 5);
YAP_UserCPredicate("gecode_constraint_count_112", gecode_constraint_count_112, 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_114", gecode_constraint_count_114, 5);
YAP_UserCPredicate("gecode_constraint_count_116", gecode_constraint_count_116, 5);
YAP_UserCPredicate("gecode_constraint_count_119", gecode_constraint_count_119, 5);
YAP_UserCPredicate("gecode_constraint_count_123", gecode_constraint_count_123, 5);
YAP_UserCPredicate("gecode_constraint_count_127", gecode_constraint_count_127, 5);
YAP_UserCPredicate("gecode_constraint_count_106", gecode_constraint_count_106, 5);
YAP_UserCPredicate("gecode_constraint_count_108", gecode_constraint_count_108, 5);
YAP_UserCPredicate("gecode_constraint_cumulatives_170", gecode_constraint_cumulatives_170, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_168", gecode_constraint_cumulatives_168, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_166", gecode_constraint_cumulatives_166, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_164", gecode_constraint_cumulatives_164, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_162", gecode_constraint_cumulatives_162, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_160", gecode_constraint_cumulatives_160, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_158", gecode_constraint_cumulatives_158, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_156", gecode_constraint_cumulatives_156, 8);
YAP_UserCPredicate("gecode_constraint_binpacking_38", gecode_constraint_binpacking_38, 5);
YAP_UserCPredicate("gecode_constraint_extensional_270", gecode_constraint_extensional_270, 3);
YAP_UserCPredicate("gecode_constraint_extensional_268", gecode_constraint_extensional_268, 3);
YAP_UserCPredicate("gecode_constraint_extensional_266", gecode_constraint_extensional_266, 3);
YAP_UserCPredicate("gecode_constraint_extensional_264", gecode_constraint_extensional_264, 3);
YAP_UserCPredicate("gecode_constraint_linear_309", gecode_constraint_linear_309, 6);
YAP_UserCPredicate("gecode_constraint_linear_313", gecode_constraint_linear_313, 6);
YAP_UserCPredicate("gecode_constraint_linear_277", gecode_constraint_linear_277, 6);
YAP_UserCPredicate("gecode_constraint_linear_281", gecode_constraint_linear_281, 6);
YAP_UserCPredicate("gecode_constraint_linear_285", gecode_constraint_linear_285, 6);
YAP_UserCPredicate("gecode_constraint_linear_283", gecode_constraint_linear_283, 6);
YAP_UserCPredicate("gecode_constraint_linear_299", gecode_constraint_linear_299, 6);
YAP_UserCPredicate("gecode_constraint_linear_300", gecode_constraint_linear_300, 6);
YAP_UserCPredicate("gecode_constraint_linear_303", gecode_constraint_linear_303, 6);
YAP_UserCPredicate("gecode_constraint_linear_304", gecode_constraint_linear_304, 6);
YAP_UserCPredicate("gecode_constraint_linear_291", gecode_constraint_linear_291, 6);
YAP_UserCPredicate("gecode_constraint_linear_292", gecode_constraint_linear_292, 6);
YAP_UserCPredicate("gecode_constraint_linear_295", gecode_constraint_linear_295, 6);
YAP_UserCPredicate("gecode_constraint_linear_296", gecode_constraint_linear_296, 6);
YAP_UserCPredicate("gecode_constraint_nooverlap_347", gecode_constraint_nooverlap_347, 7);
YAP_UserCPredicate("gecode_constraint_nooverlap_346", gecode_constraint_nooverlap_346, 7);
YAP_UserCPredicate("gecode_constraint_div_182", gecode_constraint_div_182, 5);
YAP_UserCPredicate("gecode_constraint_sqr_461", gecode_constraint_sqr_461, 4);
YAP_UserCPredicate("gecode_constraint_channel_82", gecode_constraint_channel_82, 4);
YAP_UserCPredicate("gecode_constraint_channel_78", gecode_constraint_channel_78, 4);
YAP_UserCPredicate("gecode_constraint_channel_73", gecode_constraint_channel_73, 4);
YAP_UserCPredicate("gecode_constraint_path_369", gecode_constraint_path_369, 8);
YAP_UserCPredicate("gecode_constraint_path_370", gecode_constraint_path_370, 8);
YAP_UserCPredicate("gecode_constraint_path_367", gecode_constraint_path_367, 8);
YAP_UserCPredicate("gecode_constraint_unary_474", gecode_constraint_unary_474, 5);
YAP_UserCPredicate("gecode_constraint_unary_475", gecode_constraint_unary_475, 5);
YAP_UserCPredicate("gecode_constraint_unary_470", gecode_constraint_unary_470, 5);
YAP_UserCPredicate("gecode_constraint_unary_471", gecode_constraint_unary_471, 5);
YAP_UserCPredicate("gecode_constraint_unary_468", gecode_constraint_unary_468, 5);
YAP_UserCPredicate("gecode_constraint_sorted_456", gecode_constraint_sorted_456, 4);
YAP_UserCPredicate("gecode_constraint_sorted_457", gecode_constraint_sorted_457, 4);
YAP_UserCPredicate("gecode_constraint_element_261", gecode_constraint_element_261, 8);
YAP_UserCPredicate("gecode_constraint_element_253", gecode_constraint_element_253, 8);
YAP_UserCPredicate("gecode_constraint_element_239", gecode_constraint_element_239, 8);
YAP_UserCPredicate("gecode_constraint_element_237", gecode_constraint_element_237, 8);
YAP_UserCPredicate("gecode_constraint_assign_19", gecode_constraint_assign_19, 4);
YAP_UserCPredicate("gecode_constraint_assign_28", gecode_constraint_assign_28, 4);
YAP_UserCPredicate("gecode_constraint_assign_25", gecode_constraint_assign_25, 4);
YAP_UserCPredicate("gecode_constraint_assign_17", gecode_constraint_assign_17, 4);
YAP_UserCPredicate("gecode_constraint_assign_31", gecode_constraint_assign_31, 4);
YAP_UserCPredicate("gecode_constraint_assign_21", gecode_constraint_assign_21, 4);
YAP_UserCPredicate("gecode_constraint_assign_34", gecode_constraint_assign_34, 4);
YAP_UserCPredicate("gecode_constraint_assign_23", gecode_constraint_assign_23, 4);
YAP_UserCPredicate("gecode_constraint_element_257", gecode_constraint_element_257, 5);
YAP_UserCPredicate("gecode_constraint_element_259", gecode_constraint_element_259, 5);
YAP_UserCPredicate("gecode_constraint_element_251", gecode_constraint_element_251, 5);
YAP_UserCPredicate("gecode_constraint_element_249", gecode_constraint_element_249, 5);
YAP_UserCPredicate("gecode_constraint_element_246", gecode_constraint_element_246, 5);
YAP_UserCPredicate("gecode_constraint_element_244", gecode_constraint_element_244, 5);
YAP_UserCPredicate("gecode_constraint_element_242", gecode_constraint_element_242, 5);
YAP_UserCPredicate("gecode_constraint_element_240", gecode_constraint_element_240, 5);
YAP_UserCPredicate("gecode_constraint_element_233", gecode_constraint_element_233, 5);
YAP_UserCPredicate("gecode_constraint_element_235", gecode_constraint_element_235, 5);
YAP_UserCPredicate("gecode_constraint_element_231", gecode_constraint_element_231, 5);
YAP_UserCPredicate("gecode_constraint_sequence_454", gecode_constraint_sequence_454, 3);
YAP_UserCPredicate("gecode_constraint_branch_54", gecode_constraint_branch_54, 5);
YAP_UserCPredicate("gecode_constraint_branch_50", gecode_constraint_branch_50, 5);
YAP_UserCPredicate("gecode_constraint_branch_48", gecode_constraint_branch_48, 5);
YAP_UserCPredicate("gecode_constraint_branch_59", gecode_constraint_branch_59, 5);
YAP_UserCPredicate("gecode_constraint_branch_57", gecode_constraint_branch_57, 5);
YAP_UserCPredicate("gecode_constraint_branch_63", gecode_constraint_branch_63, 5);
YAP_UserCPredicate("gecode_constraint_branch_65", gecode_constraint_branch_65, 5);
YAP_UserCPredicate("gecode_constraint_circuit_95", gecode_constraint_circuit_95, 7);
YAP_UserCPredicate("gecode_constraint_pow_377", gecode_constraint_pow_377, 4);
YAP_UserCPredicate("gecode_constraint_pow_376", gecode_constraint_pow_376, 4);
YAP_UserCPredicate("gecode_constraint_precede_383", gecode_constraint_precede_383, 3);
YAP_UserCPredicate("gecode_constraint_precede_379", gecode_constraint_precede_379, 3);
YAP_UserCPredicate("gecode_constraint_argmax_6", gecode_constraint_argmax_6, 5);
YAP_UserCPredicate("gecode_constraint_argmax_8", gecode_constraint_argmax_8, 5);
YAP_UserCPredicate("gecode_constraint_cumulative_140", gecode_constraint_cumulative_140, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_136", gecode_constraint_cumulative_136, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_133", gecode_constraint_cumulative_133, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_134", gecode_constraint_cumulative_134, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_152", gecode_constraint_cumulative_152, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_148", gecode_constraint_cumulative_148, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_145", gecode_constraint_cumulative_145, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_146", gecode_constraint_cumulative_146, 6);
YAP_UserCPredicate("gecode_constraint_distinct_179", gecode_constraint_distinct_179, 4);
YAP_UserCPredicate("gecode_constraint_distinct_173", gecode_constraint_distinct_173, 4);
YAP_UserCPredicate("gecode_constraint_distinct_175", gecode_constraint_distinct_175, 4);
YAP_UserCPredicate("gecode_constraint_min_335", gecode_constraint_min_335, 3);
YAP_UserCPredicate("gecode_constraint_min_336", gecode_constraint_min_336, 3);
YAP_UserCPredicate("gecode_constraint_min_333", gecode_constraint_min_333, 3);
YAP_UserCPredicate("gecode_constraint_sqrt_464", gecode_constraint_sqrt_464, 4);
YAP_UserCPredicate("gecode_constraint_sequence_451", gecode_constraint_sequence_451, 6);
YAP_UserCPredicate("gecode_constraint_sequence_449", gecode_constraint_sequence_449, 6);
YAP_UserCPredicate("gecode_constraint_unshare_480", gecode_constraint_unshare_480, 3);
YAP_UserCPredicate("gecode_constraint_unshare_478", gecode_constraint_unshare_478, 3);
YAP_UserCPredicate("gecode_constraint_path_375", gecode_constraint_path_375, 6);
YAP_UserCPredicate("gecode_constraint_path_364", gecode_constraint_path_364, 6);
YAP_UserCPredicate("gecode_constraint_divmod_183", gecode_constraint_divmod_183, 5);
YAP_UserCPredicate("gecode_constraint_branch_55", gecode_constraint_branch_55, 6);
YAP_UserCPredicate("gecode_constraint_branch_51", gecode_constraint_branch_51, 6);
YAP_UserCPredicate("gecode_constraint_branch_49", gecode_constraint_branch_49, 6);
YAP_UserCPredicate("gecode_constraint_branch_60", gecode_constraint_branch_60, 6);
YAP_UserCPredicate("gecode_constraint_branch_58", gecode_constraint_branch_58, 6);
YAP_UserCPredicate("gecode_constraint_branch_64", gecode_constraint_branch_64, 6);
YAP_UserCPredicate("gecode_constraint_branch_66", gecode_constraint_branch_66, 6);
YAP_UserCPredicate("gecode_constraint_nooverlap_350", gecode_constraint_nooverlap_350, 9);
YAP_UserCPredicate("gecode_constraint_argmin_12", gecode_constraint_argmin_12, 5);
YAP_UserCPredicate("gecode_constraint_argmin_14", gecode_constraint_argmin_14, 5);
YAP_UserCPredicate("gecode_constraint_cumulative_132", gecode_constraint_cumulative_132, 5);
YAP_UserCPredicate("gecode_constraint_cumulative_144", gecode_constraint_cumulative_144, 5);
YAP_UserCPredicate("gecode_constraint_member_326", gecode_constraint_member_326, 3);
YAP_UserCPredicate("gecode_constraint_member_322", gecode_constraint_member_322, 3);
YAP_UserCPredicate("gecode_constraint_count_107", gecode_constraint_count_107, 6);
YAP_UserCPredicate("gecode_constraint_count_109", gecode_constraint_count_109, 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_115", gecode_constraint_count_115, 6);
YAP_UserCPredicate("gecode_constraint_count_117", gecode_constraint_count_117, 6);
YAP_UserCPredicate("gecode_constraint_count_111", gecode_constraint_count_111, 6);
YAP_UserCPredicate("gecode_constraint_count_113", gecode_constraint_count_113, 6);
YAP_UserCPredicate("gecode_constraint_pow_378", gecode_constraint_pow_378, 5);
YAP_UserCPredicate("gecode_constraint_notMin_352", gecode_constraint_notMin_352, 3);
YAP_UserCPredicate("gecode_constraint_cumulative_143", gecode_constraint_cumulative_143, 8);
YAP_UserCPredicate("gecode_constraint_cumulative_139", gecode_constraint_cumulative_139, 8);
YAP_UserCPredicate("gecode_constraint_cumulative_155", gecode_constraint_cumulative_155, 8);
YAP_UserCPredicate("gecode_constraint_cumulative_151", gecode_constraint_cumulative_151, 8);
YAP_UserCPredicate("gecode_constraint_branch_43", gecode_constraint_branch_43, 3);
YAP_UserCPredicate("gecode_constraint_branch_39", gecode_constraint_branch_39, 3);
YAP_UserCPredicate("gecode_constraint_branch_41", gecode_constraint_branch_41, 3);
YAP_UserCPredicate("gecode_constraint_branch_45", gecode_constraint_branch_45, 3);
YAP_UserCPredicate("gecode_constraint_dom_189", gecode_constraint_dom_189, 3);
YAP_UserCPredicate("gecode_constraint_dom_191", gecode_constraint_dom_191, 3);
YAP_UserCPredicate("gecode_constraint_dom_217", gecode_constraint_dom_217, 3);
YAP_UserCPredicate("gecode_constraint_dom_216", gecode_constraint_dom_216, 3);
YAP_UserCPredicate("gecode_constraint_dom_213", gecode_constraint_dom_213, 3);
YAP_UserCPredicate("gecode_constraint_dom_185", gecode_constraint_dom_185, 3);
YAP_UserCPredicate("gecode_constraint_dom_222", gecode_constraint_dom_222, 3);
YAP_UserCPredicate("gecode_constraint_dom_220", gecode_constraint_dom_220, 3);
YAP_UserCPredicate("gecode_constraint_dom_218", gecode_constraint_dom_218, 3);
YAP_UserCPredicate("gecode_constraint_dom_192", gecode_constraint_dom_192, 3);
YAP_UserCPredicate("gecode_constraint_dom_198", gecode_constraint_dom_198, 3);
YAP_UserCPredicate("gecode_constraint_dom_194", gecode_constraint_dom_194, 3);
YAP_UserCPredicate("gecode_constraint_dom_229", gecode_constraint_dom_229, 3);
YAP_UserCPredicate("gecode_constraint_dom_212", gecode_constraint_dom_212, 3);
YAP_UserCPredicate("gecode_constraint_linear_307", gecode_constraint_linear_307, 5);
YAP_UserCPredicate("gecode_constraint_linear_308", gecode_constraint_linear_308, 5);
YAP_UserCPredicate("gecode_constraint_linear_311", gecode_constraint_linear_311, 5);
YAP_UserCPredicate("gecode_constraint_linear_312", gecode_constraint_linear_312, 5);
YAP_UserCPredicate("gecode_constraint_linear_289", gecode_constraint_linear_289, 5);
YAP_UserCPredicate("gecode_constraint_linear_287", gecode_constraint_linear_287, 5);
YAP_UserCPredicate("gecode_constraint_linear_275", gecode_constraint_linear_275, 5);
YAP_UserCPredicate("gecode_constraint_linear_276", gecode_constraint_linear_276, 5);
YAP_UserCPredicate("gecode_constraint_linear_279", gecode_constraint_linear_279, 5);
YAP_UserCPredicate("gecode_constraint_linear_280", gecode_constraint_linear_280, 5);
YAP_UserCPredicate("gecode_constraint_linear_284", gecode_constraint_linear_284, 5);
YAP_UserCPredicate("gecode_constraint_linear_282", gecode_constraint_linear_282, 5);
YAP_UserCPredicate("gecode_constraint_linear_298", gecode_constraint_linear_298, 5);
YAP_UserCPredicate("gecode_constraint_linear_302", gecode_constraint_linear_302, 5);
YAP_UserCPredicate("gecode_constraint_linear_290", gecode_constraint_linear_290, 5);
YAP_UserCPredicate("gecode_constraint_linear_294", gecode_constraint_linear_294, 5);
YAP_UserCPredicate("gecode_constraint_argmin_15", gecode_constraint_argmin_15, 6);
YAP_UserCPredicate("gecode_constraint_nooverlap_344", gecode_constraint_nooverlap_344, 6);
YAP_UserCPredicate("gecode_constraint_nooverlap_345", gecode_constraint_nooverlap_345, 6);
YAP_UserCPredicate("gecode_constraint_element_247", gecode_constraint_element_247, 6);
YAP_UserCPredicate("gecode_constraint_element_245", gecode_constraint_element_245, 6);
YAP_UserCPredicate("gecode_constraint_element_243", gecode_constraint_element_243, 6);
YAP_UserCPredicate("gecode_constraint_element_241", gecode_constraint_element_241, 6);
YAP_UserCPredicate("gecode_constraint_rel_401", gecode_constraint_rel_401, 4);
YAP_UserCPredicate("gecode_constraint_rel_403", gecode_constraint_rel_403, 4);
YAP_UserCPredicate("gecode_constraint_rel_397", gecode_constraint_rel_397, 4);
YAP_UserCPredicate("gecode_constraint_rel_393", gecode_constraint_rel_393, 4);
YAP_UserCPredicate("gecode_constraint_rel_437", gecode_constraint_rel_437, 4);
YAP_UserCPredicate("gecode_constraint_rel_438", gecode_constraint_rel_438, 4);
YAP_UserCPredicate("gecode_constraint_rel_435", gecode_constraint_rel_435, 4);
YAP_UserCPredicate("gecode_constraint_rel_432", gecode_constraint_rel_432, 4);
YAP_UserCPredicate("gecode_constraint_rel_433", gecode_constraint_rel_433, 4);
YAP_UserCPredicate("gecode_constraint_rel_429", gecode_constraint_rel_429, 4);
YAP_UserCPredicate("gecode_constraint_rel_418", gecode_constraint_rel_418, 4);
YAP_UserCPredicate("gecode_constraint_rel_416", gecode_constraint_rel_416, 4);
YAP_UserCPredicate("gecode_constraint_rel_443", gecode_constraint_rel_443, 4);
YAP_UserCPredicate("gecode_constraint_rel_447", gecode_constraint_rel_447, 4);
YAP_UserCPredicate("gecode_constraint_rel_442", gecode_constraint_rel_442, 4);
YAP_UserCPredicate("gecode_constraint_rel_445", gecode_constraint_rel_445, 4);
YAP_UserCPredicate("gecode_constraint_rel_405", gecode_constraint_rel_405, 4);
YAP_UserCPredicate("gecode_constraint_rel_410", gecode_constraint_rel_410, 4);
YAP_UserCPredicate("gecode_constraint_rel_409", gecode_constraint_rel_409, 4);
YAP_UserCPredicate("gecode_constraint_rel_414", gecode_constraint_rel_414, 4);
YAP_UserCPredicate("gecode_constraint_rel_420", gecode_constraint_rel_420, 4);
YAP_UserCPredicate("gecode_constraint_rel_425", gecode_constraint_rel_425, 4);
YAP_UserCPredicate("gecode_constraint_rel_427", gecode_constraint_rel_427, 4);
YAP_UserCPredicate("gecode_constraint_rel_387", gecode_constraint_rel_387, 4);
YAP_UserCPredicate("gecode_constraint_rel_385", gecode_constraint_rel_385, 4);
YAP_UserCPredicate("gecode_constraint_min_332", gecode_constraint_min_332, 5);
YAP_UserCPredicate("gecode_constraint_count_124", gecode_constraint_count_124, 3);
YAP_UserCPredicate("gecode_constraint_count_120", gecode_constraint_count_120, 3);
YAP_UserCPredicate("gecode_constraint_argmax_5", gecode_constraint_argmax_5, 4);
YAP_UserCPredicate("gecode_constraint_argmax_7", gecode_constraint_argmax_7, 4);
YAP_UserCPredicate("gecode_constraint_ite_273", gecode_constraint_ite_273, 6);

View File

@ -49,8 +49,9 @@ if (GECODE_FOUND)
ARCHIVE DESTINATION ${dlls}
)
install(FILES gecode.yap
install(FILES gecode${GECODE_MAJOR}.yap
DESTINATION ${libpl}
RENAME gecode.yap
)
install(FILES clpfd.yap

View File

@ -0,0 +1,5 @@
all:
python code-generator.py
clean:
-rm -f *~ *.pyc

20
packages/gecode/dev/code-generator.py Normal file → Executable file
View File

@ -6,12 +6,12 @@
# the terms of the GNU 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 General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
#==============================================================================
@ -26,12 +26,12 @@ NOTICE_CC = """// -*- c++ -*-
// 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 <http://www.gnu.org/licenses/>.
//=============================================================================
@ -45,12 +45,12 @@ NOTICE_PROLOG="""%% -*- prolog -*-
%% 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 <http://www.gnu.org/licenses/>.
%%=============================================================================
@ -120,7 +120,7 @@ class Type(object):
def clone(self):
return type(self)(self)
class Constraint(object):
@ -165,7 +165,7 @@ class Constraint(object):
def clone(self):
return type(self)(self)
COMMENT = re.compile("""^\\s*//.*$""")
@ -598,7 +598,7 @@ class YAPEnumProlog(object):
print
class YAPEnumPrologGenerator(object):
def generate(self):
for c in enum_classes():
class C(c,YAPEnumProlog): pass
@ -677,7 +677,7 @@ def gecode_version():
os.remove(file_hh)
os.remove(file_txt)
else:
version = "4.4.0"
version = "5.0.0"
GECODE_VERSION = version
return version

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,38 @@
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/local/opt/gecode
GECODECONFIG := $(GECODEDIR)/support/config.hpp
GECODEVERSION := $(shell cat $(GECODECONFIG) | egrep '\<GECODE_VERSION\>' | awk '{print $$3}' | sed 's/"//g')
GECODEVERSION="5.0.0"
PROTOTYPES = ../gecode-prototypes-$(GECODEVERSION).hh
ENUMS = ../gecode-enums-$(GECODEVERSION).py
all: $(PROTOTYPES) $(ENUMS)
$(PROTOTYPES): % : xml/namespaceGecode.xml extract-prototypes.xsl
cat notice.hh > $@ || { rm -f $@; exit 1; }
xsltproc extract-prototypes.xsl $< \
| grep EXPORT \
| grep -v Symmetry \
| sed 's/Gecode:://g' \
| sed 's/< /</g' \
| sed 's/ >/>/g' \
| sed 's/ \&/\&/g' \
| sed 's/, /,/g' \
| sed 's/forceinline //g' \
| sed 's/GECODE_INT_EXPORT //g' \
| sed 's/GECODE_FLOAT_EXPORT //g' \
| sed 's/GECODE_SET_EXPORT //g' \
| grep -v '*' | sort >> $@ || { rm -f $@; exit 1; }
$(ENUMS): % : xml/namespaceGecode.xml extract-enums.xsl
cat notice.py > $@ || { rm -f $@; exit 1; }
xsltproc extract-enums.xsl $< >> $@ || { rm -f $@; exit 1; }
xml/namespaceGecode.xml: Doxyfile
doxygen Doxyfile
Doxyfile: Doxyfile.in
cat $< | sed "s#@GECODEDIR@#$(GECODEDIR)#" > $@ || { rm -f $@; exit 1; }
clean:
-rm -rf *~ gecode-prototypes-*.hh gecode-enums-*.py Doxyfile xml

File diff suppressed because it is too large Load Diff

View File

@ -82,7 +82,7 @@ namespace generic_gecode
struct GenericRestartDFS: GenericEngine
{
RBS<DFS,GenericSpace> engine;
RBS<GenericSpace,DFS> engine;
GenericRestartDFS(GenericSpace* s,Search::Options& opt) : engine(s,opt) {}
virtual GenericSpace* next(void) { return engine.next(); }
};
@ -96,7 +96,7 @@ namespace generic_gecode
struct GenericRestartBAB: GenericEngine
{
RBS<BAB,GenericSpace> engine;
RBS<GenericSpace,BAB> engine;
GenericRestartBAB(GenericSpace* s,Search::Options& opt) : engine(s,opt) {}
virtual GenericSpace* next(void) { return engine.next(); }
};

View File

@ -0,0 +1,423 @@
// -*- 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 <http://www.gnu.org/licenses/>.
//=============================================================================
#ifndef GECODE_COMMON
#define GECODE_COMMON
#if defined(_MSC_VER) || defined(__MINGW32__)
#define __i386__ 1
#if __x86_64__
#define _WIN64 1
#define _AMD64_ 1
#endif
#include <windows.h>
#endif
#include "gecode/driver.hh"
#include "gecode/int.hh"
#include "gecode/set.hh"
#include "gecode/search.hh"
#include <vector>
namespace generic_gecode
{
using namespace std;
using namespace Gecode;
// description of the optimization criterion
struct Optimizing
{
enum What { OPT_NONE, OPT_INT, OPT_RATIO };
enum How { OPT_MIN, OPT_MAX };
int num;
int den;
What what;
How how;
Optimizing(): num(-1), den(-1), what(OPT_NONE), how(OPT_MAX) {}
Optimizing(Optimizing& o)
: num(o.num), den(o.den), what(o.what), how(o.how) {}
void check_ok() const
{ if (what!=OPT_NONE)
throw Exception("gecode-python","too many optimization criteria"); }
void maximize(int i)
{ check_ok(); what = OPT_INT; how = OPT_MAX; num = i; };
void maximize(int i,int j)
{ check_ok(); what = OPT_RATIO; how = OPT_MAX; num = i; den = j; };
void minimize(int i)
{ check_ok(); what = OPT_INT; how = OPT_MIN; num = i; };
void minimize(int i,int j)
{ check_ok(); what = OPT_RATIO; how = OPT_MIN; num = i; den = j; };
};
struct GenericSpace;
struct GenericEngine
{
virtual GenericSpace* next(void)=0;
virtual ~GenericEngine() {};
};
struct GenericDFS: GenericEngine
{
DFS<GenericSpace> engine;
GenericDFS(GenericSpace* s,Search::Options& opt) : engine(s,opt) {}
virtual GenericSpace* next(void) { return engine.next(); }
};
struct GenericRestartDFS: GenericEngine
{
RBS<DFS,GenericSpace> engine;
GenericRestartDFS(GenericSpace* s,Search::Options& opt) : engine(s,opt) {}
virtual GenericSpace* next(void) { return engine.next(); }
};
struct GenericBAB: GenericEngine
{
BAB<GenericSpace> engine;
GenericBAB(GenericSpace* s,Search::Options& opt) : engine(s,opt) {}
virtual GenericSpace* next(void) { return engine.next(); }
};
struct GenericRestartBAB: GenericEngine
{
RBS<BAB,GenericSpace> engine;
GenericRestartBAB(GenericSpace* s,Search::Options& opt) : engine(s,opt) {}
virtual GenericSpace* next(void) { return engine.next(); }
};
#ifdef OLD
struct GenericRestart: GenericEngine
{
Restart<GenericSpace> engine;
GenericRestart(GenericSpace* s,Search::Options& opt): engine(s,opt) {}
virtual GenericSpace* next(void) { return engine.next(); }
};
#endif
struct LoadingDock
{
vector<IntVar> ivars;
vector<BoolVar> bvars;
vector<FloatVar> fvars;
vector<SetVar> svars;
vector<int> ikeep;
vector<int> bkeep;
vector<int> fkeep;
vector<int> skeep;
bool keeping_some() const
{
return (ikeep.size() != 0)
|| (bkeep.size() != 0)
|| (fkeep.size() != 0)
|| (skeep.size() != 0);
}
IntVar get_ivar(int i) const { return ivars[i]; }
BoolVar get_bvar(int i) const { return bvars[i]; }
FloatVar get_fvar(int i) const { return fvars[i]; }
SetVar get_svar(int i) const { return svars[i]; }
int enter_ivar(const IntVar& v)
{ ivars.push_back(v); return static_cast<int>(ivars.size()-1); }
int enter_bvar(const BoolVar& v)
{ bvars.push_back(v); return static_cast<int>(bvars.size()-1); }
int enter_fvar(const FloatVar& v)
{ fvars.push_back(v); return static_cast<int>(fvars.size()-1); }
int enter_svar(const SetVar& v)
{ svars.push_back(v); return static_cast<int>(svars.size()-1); }
int keep_ivar(int i) { ikeep.push_back(i); return static_cast<int>(ikeep.size()-1); }
int keep_bvar(int i) { bkeep.push_back(i); return static_cast<int>(bkeep.size()-1); }
int keep_fvar(int i) { fkeep.push_back(i); return static_cast<int>(fkeep.size()-1); }
int keep_svar(int i) { skeep.push_back(i); return static_cast<int>(skeep.size()-1); }
void freeze(Space& home,
IntVarArray& iarr, BoolVarArray& barr, SetVarArray& sarr, FloatVarArray& farr,
int& num, int& den)
{
if (keeping_some())
{
// make sure that optimization vars (if any) are kept
if (num != -1)
{
const int _num(num);
const int _den(den);
int n = static_cast<int>(ikeep.size());
bool num_found(false);
bool den_found(false);
for (;n--;)
{
const int idx(ikeep[n]);
if (idx==_num)
{ num_found=true; if (den_found) break; }
if (idx==_den)
{ den_found=true; if (num_found) break; }
}
if (!num_found)
{ ikeep.push_back(_num);
num=static_cast<int>(ikeep.size()-1); }
if (_den != -1 && !den_found)
{ ikeep.push_back(_den);
den=static_cast<int>(ikeep.size()-1); }
}
{ int n = static_cast<int>(ikeep.size());
iarr = IntVarArray(home, n);
for (;n--;) iarr[n]=ivars[ikeep[n]]; }
{ int n = static_cast<int>(bkeep.size());
barr = BoolVarArray(home, n);
for (;n--;) barr[n]=bvars[bkeep[n]]; }
{ int n = static_cast<int>(skeep.size());
sarr = SetVarArray(home, n);
for (;n--;) sarr[n]=svars[skeep[n]]; }
{ int n = static_cast<int>(fkeep.size());
farr = FloatVarArray(home, n);
for (;n--;) farr[n]=fvars[skeep[n]]; }
}
else
{
{ int n = static_cast<int>(ivars.size());
iarr = IntVarArray(home, n);
for (;n--;) iarr[n]=ivars[n]; }
{ int n = static_cast<int>(bvars.size());
barr = BoolVarArray(home, n);
for (;n--;) barr[n]=bvars[n]; }
{ int n = static_cast<int>(svars.size());
sarr = SetVarArray(home, n);
for (;n--;) sarr[n]=svars[n]; }
{ int n = static_cast<int>(fvars.size());
farr = FloatVarArray(home, n);
for (;n--;) farr[n]=fvars[n]; }
}
}
};
struct GenericSpace: Space
{
Optimizing optim;
IntVarArray ivars;
BoolVarArray bvars;
FloatVarArray fvars;
SetVarArray svars;
LoadingDock* dock;
bool keeping_some; // iff only SOME of the vars are kept
Space* space() { return this; }
GenericSpace(bool share, GenericSpace& s)
: Space(share, s), optim(s.optim), dock(NULL), keeping_some(s.keeping_some)
{
ivars.update(*this, share, s.ivars);
bvars.update(*this, share, s.bvars);
svars.update(*this, share, s.svars);
fvars.update(*this, share, s.fvars);
}
Space* copy(bool share)
{ freeze(); return new GenericSpace(share, *this); }
GenericSpace() : dock(new LoadingDock()), keeping_some(false) {}
~GenericSpace() { delete dock; }
// throw some C++ exception on behalf of glue code
void kaboom(const char* s)
{ throw Exception("gecode-python", s); }
int ikaboom(const char* s)
{ kaboom(s); return 0; }
// freeze the space before handing it off to a search engine
void freeze()
{
if (dock)
{
keeping_some = dock->keeping_some();
dock->freeze(*this, ivars, bvars, svars, fvars, optim.num, optim.den);
delete dock;
dock = NULL;
}
}
IntVar get_ivar(int i) const { return (dock)?dock->get_ivar(i):ivars[i]; }
BoolVar get_bvar(int i) const { return (dock)?dock->get_bvar(i):bvars[i]; }
SetVar get_svar(int i) const { return (dock)?dock->get_svar(i):svars[i]; }
FloatVar get_fvar(int i) const { return (dock)?dock->get_fvar(i):fvars[i]; }
int keep_ivar(int i)
{
if (dock) return dock->keep_ivar(i);
else return ikaboom("too late to keep");
}
int keep_bvar(int i)
{
if (dock) return dock->keep_bvar(i);
else return ikaboom("too late to keep");
}
int keep_svar(int i)
{
if (dock) return dock->keep_svar(i);
else return ikaboom("too late to keep");
}
int keep_fvar(int i)
{
if (dock) return dock->keep_fvar(i);
else return ikaboom("too late to keep");
}
bool frozen() const { return dock==NULL; }
bool has_keepers() const { return keeping_some; }
// when frozen and has_keepers: which is just has_keepers actually
bool use_keep_index() const { return has_keepers(); }
GenericEngine* new_engine(bool restart, Search::Options& opt)
{
freeze();
return (optim.what == Optimizing::OPT_NONE)
? ( restart
? static_cast<GenericEngine*>(new GenericRestartDFS(this,opt))
: static_cast<GenericEngine*>(new GenericDFS(this,opt)) )
: (restart
? static_cast<GenericEngine*>(new GenericRestartBAB(this,opt))
:
static_cast<GenericEngine*>(new GenericBAB(this,opt)) );
}
int _new_ivar(IntVar& v)
{
if (dock) return dock->enter_ivar(v);
else return ikaboom("too late to create vars");
}
int new_ivar(int lo, int hi)
{
IntVar v(*this, lo, hi);
return _new_ivar(v);
}
int new_ivar(IntSet& s)
{
IntVar v(*this, s);
return _new_ivar(v);
}
int _new_fvar(FloatVar& v)
{
if (dock) return dock->enter_fvar(v);
else return ikaboom("too late to create vars");
}
int new_fvar(double lo, double hi)
{
FloatVar v(*this, lo, hi);
return _new_fvar(v);
}
int _new_bvar(BoolVar& v)
{
if (dock) return dock->enter_bvar(v);
else return ikaboom("too late to create vars");
}
int new_bvar()
{
BoolVar v(*this, 0, 1);
return _new_bvar(v);
}
int _new_svar(SetVar& v)
{
if (dock) return dock->enter_svar(v);
else return ikaboom("too late to create vars");
}
int new_svar(int glbMin, int glbMax, int lubMin, int lubMax,
unsigned int cardMin=0,
unsigned int cardMax=Set::Limits::card)
{
SetVar v(*this, glbMin, glbMax, lubMin, lubMax, cardMin, cardMax);
return _new_svar(v);
}
int new_svar(IntSet glb, int lubMin, int lubMax,
unsigned int cardMin=0,
unsigned int cardMax=Set::Limits::card)
{
SetVar v(*this, glb, lubMin, lubMax, cardMin, cardMax);
return _new_svar(v);
}
int new_svar(int glbMin, int glbMax, IntSet lub,
unsigned int cardMin=0,
unsigned int cardMax=Set::Limits::card)
{
SetVar v(*this, glbMin, glbMax, lub, cardMin, cardMax);
return _new_svar(v);
}
int new_svar(IntSet glb, IntSet lub,
unsigned int cardMin=0,
unsigned int cardMax=Set::Limits::card)
{
SetVar v(*this, glb, lub, cardMin, cardMax);
return _new_svar(v);
}
void minimize(int i) { optim.minimize(i); }
void minimize(int i, int j) { optim.minimize(i,j); }
void maximize(int i) { optim.maximize(i); }
void maximize(int i, int j) { optim.maximize(i,j); }
virtual void constrain(const Space& s)
{
const GenericSpace& sol = static_cast<const GenericSpace&>(s);
switch (optim.what)
{
case Optimizing::OPT_NONE:
break;
case Optimizing::OPT_INT:
rel(*this, ivars[optim.num],
((optim.how==Optimizing::OPT_MIN) ? IRT_LE : IRT_GR),
sol.ivars[optim.num].val());
break;
case Optimizing::OPT_RATIO:
{
IntArgs c(2, sol.ivars[optim.den].val(),
- sol.ivars[optim.num].val());
IntVarArgs v(2);
v[0] = ivars[optim.num];
v[1] = ivars[optim.den];
linear(*this, c, v,
((optim.how==Optimizing::OPT_MIN) ? IRT_LE : IRT_GR), 0);
break;
}
}
}
};
}
#ifdef DISJUNCTOR
#include "disjunctor.icc"
#endif
#endif

View File

@ -0,0 +1,10 @@
/* just for program analysis */
:- module(gecode, [(:=)/2, op(500, xfx, ':='),
(+=)/2, op(500, xfx, '+=')]).
:- include(gecode5_yap_hand_written).
:- include('5.0.0/gecode_yap_auto_generated').

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff