00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "ppl.hh"
00024 #include "pwl.hh"
00025 #include <Yap/YapInterface.h>
00026 #include <cassert>
00027 #include <cassert>
00028 #include <climits>
00029
00030 typedef YAP_Term Prolog_term_ref;
00031 typedef YAP_Atom Prolog_atom;
00032 typedef YAP_Bool Prolog_foreign_return_type;
00033
00034 namespace {
00035
00036 const Prolog_foreign_return_type PROLOG_SUCCESS = TRUE;
00037 const Prolog_foreign_return_type PROLOG_FAILURE = FALSE;
00038
00039 }
00040
00041 #include "../exceptions.hh"
00042
00043 namespace PPL = Parma_Polyhedra_Library;
00044
00045 namespace {
00046
00047 Prolog_atom a_throw;
00048
00052 bool Prolog_has_unbounded_integers;
00053
00059 long Prolog_min_integer;
00060
00066 long Prolog_max_integer;
00067
00071 mpz_class tmp_mpz_class;
00072
00076 void
00077 ppl_Prolog_sysdep_init() {
00078 Prolog_has_unbounded_integers = true;
00079 Prolog_min_integer = 0;
00080 Prolog_max_integer = 0;
00081
00082 a_throw = YAP_LookupAtom("throw");
00083 }
00084
00088 void
00089 ppl_Prolog_sysdep_deinit() {
00090 }
00091
00095 inline Prolog_term_ref
00096 Prolog_new_term_ref() {
00097 return 0;
00098 }
00099
00104 inline int
00105 Prolog_put_term(Prolog_term_ref& t, Prolog_term_ref u) {
00106 t = u;
00107 return 1;
00108 }
00109
00113 inline int
00114 Prolog_put_long(Prolog_term_ref& t, long l) {
00115 t = YAP_MkIntTerm(l);
00116 return 1;
00117 }
00118
00122 inline int
00123 Prolog_put_ulong(Prolog_term_ref& t, unsigned long ul) {
00124 if (ul <= LONG_MAX)
00125 t = YAP_MkIntTerm(ul);
00126 else {
00127 tmp_mpz_class = ul;
00128 t = YAP_MkBigNumTerm(tmp_mpz_class.get_mpz_t());
00129 }
00130 return 1;
00131 }
00132
00137 inline int
00138 Prolog_put_atom_chars(Prolog_term_ref& t, const char* s) {
00139 t = YAP_MkAtomTerm(YAP_FullLookupAtom(s));
00140 return 1;
00141 }
00142
00146 inline int
00147 Prolog_put_atom(Prolog_term_ref& t, Prolog_atom a) {
00148 t = YAP_MkAtomTerm(a);
00149 return 1;
00150 }
00151
00155 inline int
00156 Prolog_put_address(Prolog_term_ref& t, void* p) {
00157 t = YAP_MkIntTerm(reinterpret_cast<long>(p));
00158 return 1;
00159 }
00160
00164 Prolog_atom
00165 Prolog_atom_from_string(const char* s) {
00166 return YAP_FullLookupAtom(s);
00167 }
00168
00169 Prolog_term_ref args[4];
00170
00175 inline int
00176 Prolog_construct_compound(Prolog_term_ref& t, Prolog_atom f,
00177 Prolog_term_ref a1) {
00178 args[0] = a1;
00179 t = YAP_MkApplTerm(YAP_MkFunctor(f, 1), 1, args);
00180 return 1;
00181 }
00182
00187 inline int
00188 Prolog_construct_compound(Prolog_term_ref& t, Prolog_atom f,
00189 Prolog_term_ref a1, Prolog_term_ref a2) {
00190 args[0] = a1;
00191 args[1] = a2;
00192 t = YAP_MkApplTerm(YAP_MkFunctor(f, 2), 2, args);
00193 return 1;
00194 }
00195
00200 inline int
00201 Prolog_construct_compound(Prolog_term_ref& t, Prolog_atom f,
00202 Prolog_term_ref a1, Prolog_term_ref a2,
00203 Prolog_term_ref a3) {
00204 args[0] = a1;
00205 args[1] = a2;
00206 args[2] = a3;
00207 t = YAP_MkApplTerm(YAP_MkFunctor(f, 3), 3, args);
00208 return 1;
00209 }
00210
00215 inline int
00216 Prolog_construct_compound(Prolog_term_ref& t, Prolog_atom f,
00217 Prolog_term_ref a1, Prolog_term_ref a2,
00218 Prolog_term_ref a3, Prolog_term_ref a4) {
00219 args[0] = a1;
00220 args[1] = a2;
00221 args[2] = a3;
00222 args[3] = a4;
00223 t = YAP_MkApplTerm(YAP_MkFunctor(f, 4), 4, args);
00224 return 1;
00225 }
00226
00230 inline int
00231 Prolog_construct_cons(Prolog_term_ref& c,
00232 Prolog_term_ref h, Prolog_term_ref t) {
00233 c = YAP_MkPairTerm(h, t);
00234 return 1;
00235 }
00236
00240 inline void
00241 Prolog_raise_exception(Prolog_term_ref t) {
00242 YAP_Throw(t);
00243 }
00244
00248 inline int
00249 Prolog_is_variable(Prolog_term_ref t) {
00250 return YAP_IsVarTerm(t) != FALSE;
00251 }
00252
00256 inline int
00257 Prolog_is_atom(Prolog_term_ref t) {
00258 return YAP_IsAtomTerm(t) != FALSE;
00259 }
00260
00264 inline int
00265 Prolog_is_integer(Prolog_term_ref t) {
00266 return YAP_IsIntTerm(t) != FALSE || YAP_IsBigNumTerm(t) != FALSE;
00267 }
00268
00272 inline int
00273 Prolog_is_address(Prolog_term_ref t) {
00274 return YAP_IsIntTerm(t) != FALSE;
00275 }
00276
00280 inline int
00281 Prolog_is_compound(Prolog_term_ref t) {
00282 return YAP_IsApplTerm(t) != FALSE;
00283 }
00284
00288 inline int
00289 Prolog_is_cons(Prolog_term_ref t) {
00290 return YAP_IsPairTerm(t) != FALSE;
00291 }
00292
00299 inline int
00300 Prolog_get_long(Prolog_term_ref t, long* lp) {
00301 assert(Prolog_is_integer(t));
00302 if (YAP_IsBigNumTerm(t) != FALSE) {
00303 YAP_BigNumOfTerm(t, tmp_mpz_class.get_mpz_t());
00304 if (tmp_mpz_class >= LONG_MIN && tmp_mpz_class <= LONG_MAX)
00305 PPL::assign_r(*lp, tmp_mpz_class, PPL::ROUND_NOT_NEEDED);
00306 else
00307 return 0;
00308 }
00309 else
00310 *lp = YAP_IntOfTerm(t);
00311 return 1;
00312 }
00313
00319 inline int
00320 Prolog_get_address(Prolog_term_ref t, void** vpp) {
00321 assert(Prolog_is_address(t));
00322 *vpp = reinterpret_cast<void*>(YAP_IntOfTerm(t));
00323 return 1;
00324 }
00325
00330 inline int
00331 Prolog_get_atom_name(Prolog_term_ref t, Prolog_atom* ap) {
00332 assert(Prolog_is_atom(t));
00333 *ap = YAP_AtomOfTerm(t);
00334 return 1;
00335 }
00336
00342 inline int
00343 Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, int* ip) {
00344 assert(Prolog_is_compound(t));
00345 YAP_Functor f = YAP_FunctorOfTerm(t);
00346 *ap = YAP_NameOfFunctor(f);
00347 *ip = YAP_ArityOfFunctor(f);
00348 return 1;
00349 }
00350
00357 inline int
00358 Prolog_get_arg(int i, Prolog_term_ref t, Prolog_term_ref& a) {
00359 assert(Prolog_is_compound(t));
00360 a = YAP_ArgOfTerm(i, t);
00361 return 1;
00362 }
00363
00369 inline int
00370 Prolog_get_cons(Prolog_term_ref c, Prolog_term_ref& h, Prolog_term_ref& t) {
00371 assert(Prolog_is_cons(c));
00372 h = YAP_HeadOfTerm(c);
00373 t = YAP_TailOfTerm(c);
00374 return 1;
00375 }
00376
00381 inline int
00382 Prolog_unify(Prolog_term_ref t, Prolog_term_ref u) {
00383 return YAP_Unify(t, u) != FALSE;
00384 }
00385
00386 PPL::Coefficient
00387 integer_term_to_Coefficient(Prolog_term_ref t) {
00388 PPL::Coefficient n;
00389 if (YAP_IsBigNumTerm(t) != FALSE) {
00390 YAP_BigNumOfTerm(t, tmp_mpz_class.get_mpz_t());
00391 n = tmp_mpz_class;
00392 }
00393 else
00394 n = YAP_IntOfTerm(t);
00395 return n;
00396 }
00397
00398 Prolog_term_ref
00399 Coefficient_to_integer_term(const PPL::Coefficient& n) {
00400 if (n >= LONG_MIN && n <= LONG_MAX) {
00401 long l = 0;
00402 PPL::assign_r(l, n, PPL::ROUND_NOT_NEEDED);
00403 return YAP_MkIntTerm(l);
00404 }
00405 else {
00406 PPL::assign_r(tmp_mpz_class, n, PPL::ROUND_NOT_NEEDED);
00407 return YAP_MkBigNumTerm(tmp_mpz_class.get_mpz_t());
00408 }
00409 }
00410
00411 }
00412
00413 #include "../ppl_prolog.icc"
00414
00415 #define YAP_STUB_0(name) \
00416 extern "C" Prolog_foreign_return_type \
00417 yap_stub_##name() { \
00418 return name(); \
00419 }
00420
00421 #define YAP_STUB_1(name) \
00422 extern "C" Prolog_foreign_return_type \
00423 yap_stub_##name() { \
00424 Prolog_term_ref arg1 = YAP_ARG1; \
00425 return name(arg1); \
00426 }
00427
00428 #define YAP_STUB_2(name) \
00429 extern "C" Prolog_foreign_return_type \
00430 yap_stub_##name() { \
00431 Prolog_term_ref arg1 = YAP_ARG1; \
00432 Prolog_term_ref arg2 = YAP_ARG2; \
00433 return name(arg1, arg2); \
00434 }
00435
00436 #define YAP_STUB_3(name) \
00437 extern "C" Prolog_foreign_return_type \
00438 yap_stub_##name() { \
00439 Prolog_term_ref arg1 = YAP_ARG1; \
00440 Prolog_term_ref arg2 = YAP_ARG2; \
00441 Prolog_term_ref arg3 = YAP_ARG3; \
00442 return name(arg1, arg2, arg3); \
00443 }
00444
00445 #define YAP_STUB_4(name) \
00446 extern "C" Prolog_foreign_return_type \
00447 yap_stub_##name() { \
00448 Prolog_term_ref arg1 = YAP_ARG1; \
00449 Prolog_term_ref arg2 = YAP_ARG2; \
00450 Prolog_term_ref arg3 = YAP_ARG3; \
00451 Prolog_term_ref arg4 = YAP_ARG4; \
00452 return name(arg1, arg2, arg3, arg4); \
00453 }
00454
00455 #define YAP_STUB_5(name) \
00456 extern "C" Prolog_foreign_return_type \
00457 yap_stub_##name() { \
00458 Prolog_term_ref arg1 = YAP_ARG1; \
00459 Prolog_term_ref arg2 = YAP_ARG2; \
00460 Prolog_term_ref arg3 = YAP_ARG3; \
00461 Prolog_term_ref arg4 = YAP_ARG4; \
00462 Prolog_term_ref arg5 = YAP_ARG5; \
00463 return name(arg1, arg2, arg3, arg4, arg5); \
00464 }
00465
00466 #define YAP_STUB_6(name) \
00467 extern "C" Prolog_foreign_return_type \
00468 yap_stub_##name() { \
00469 Prolog_term_ref arg1 = YAP_ARG1; \
00470 Prolog_term_ref arg2 = YAP_ARG2; \
00471 Prolog_term_ref arg3 = YAP_ARG3; \
00472 Prolog_term_ref arg4 = YAP_ARG4; \
00473 Prolog_term_ref arg5 = YAP_ARG5; \
00474 Prolog_term_ref arg6 = YAP_ARG6; \
00475 return name(arg1, arg2, arg3, arg4, arg5, arg6); \
00476 }
00477
00478 YAP_STUB_1(ppl_version_major)
00479 YAP_STUB_1(ppl_version_minor)
00480 YAP_STUB_1(ppl_version_revision)
00481 YAP_STUB_1(ppl_version_beta)
00482 YAP_STUB_1(ppl_version)
00483 YAP_STUB_1(ppl_banner)
00484 YAP_STUB_1(ppl_max_space_dimension)
00485 YAP_STUB_0(ppl_Coefficient_is_bounded)
00486 YAP_STUB_1(ppl_Coefficient_max)
00487 YAP_STUB_1(ppl_Coefficient_min)
00488 YAP_STUB_0(ppl_initialize)
00489 YAP_STUB_0(ppl_finalize)
00490 YAP_STUB_1(ppl_set_timeout_exception_atom)
00491 YAP_STUB_1(ppl_timeout_exception_atom)
00492 YAP_STUB_1(ppl_set_timeout)
00493 YAP_STUB_0(ppl_reset_timeout)
00494 YAP_STUB_3(ppl_new_C_Polyhedron_from_space_dimension)
00495 YAP_STUB_3(ppl_new_NNC_Polyhedron_from_space_dimension)
00496 YAP_STUB_2(ppl_new_C_Polyhedron_from_C_Polyhedron)
00497 YAP_STUB_2(ppl_new_C_Polyhedron_from_NNC_Polyhedron)
00498 YAP_STUB_2(ppl_new_NNC_Polyhedron_from_C_Polyhedron)
00499 YAP_STUB_2(ppl_new_NNC_Polyhedron_from_NNC_Polyhedron)
00500 YAP_STUB_2(ppl_new_C_Polyhedron_from_constraints)
00501 YAP_STUB_2(ppl_new_NNC_Polyhedron_from_constraints)
00502 YAP_STUB_2(ppl_new_C_Polyhedron_from_generators)
00503 YAP_STUB_2(ppl_new_NNC_Polyhedron_from_generators)
00504 YAP_STUB_2(ppl_new_C_Polyhedron_from_bounding_box)
00505 YAP_STUB_2(ppl_new_NNC_Polyhedron_from_bounding_box)
00506 YAP_STUB_2(ppl_Polyhedron_swap)
00507 YAP_STUB_1(ppl_delete_Polyhedron)
00508 YAP_STUB_2(ppl_Polyhedron_space_dimension)
00509 YAP_STUB_2(ppl_Polyhedron_affine_dimension)
00510 YAP_STUB_2(ppl_Polyhedron_get_constraints)
00511 YAP_STUB_2(ppl_Polyhedron_get_minimized_constraints)
00512 YAP_STUB_2(ppl_Polyhedron_get_generators)
00513 YAP_STUB_2(ppl_Polyhedron_get_minimized_generators)
00514 YAP_STUB_3(ppl_Polyhedron_relation_with_constraint)
00515 YAP_STUB_3(ppl_Polyhedron_relation_with_generator)
00516 YAP_STUB_3(ppl_Polyhedron_get_bounding_box)
00517 YAP_STUB_1(ppl_Polyhedron_is_empty)
00518 YAP_STUB_1(ppl_Polyhedron_is_universe)
00519 YAP_STUB_1(ppl_Polyhedron_is_bounded)
00520 YAP_STUB_2(ppl_Polyhedron_bounds_from_above)
00521 YAP_STUB_2(ppl_Polyhedron_bounds_from_below)
00522 YAP_STUB_5(ppl_Polyhedron_maximize)
00523 YAP_STUB_6(ppl_Polyhedron_maximize_with_point)
00524 YAP_STUB_5(ppl_Polyhedron_minimize)
00525 YAP_STUB_6(ppl_Polyhedron_minimize_with_point)
00526 YAP_STUB_1(ppl_Polyhedron_is_topologically_closed)
00527 YAP_STUB_2(ppl_Polyhedron_contains_Polyhedron)
00528 YAP_STUB_2(ppl_Polyhedron_strictly_contains_Polyhedron)
00529 YAP_STUB_2(ppl_Polyhedron_is_disjoint_from_Polyhedron)
00530 YAP_STUB_2(ppl_Polyhedron_equals_Polyhedron)
00531 YAP_STUB_1(ppl_Polyhedron_OK)
00532 YAP_STUB_2(ppl_Polyhedron_add_constraint)
00533 YAP_STUB_2(ppl_Polyhedron_add_constraint_and_minimize)
00534 YAP_STUB_2(ppl_Polyhedron_add_generator)
00535 YAP_STUB_2(ppl_Polyhedron_add_generator_and_minimize)
00536 YAP_STUB_2(ppl_Polyhedron_add_constraints)
00537 YAP_STUB_2(ppl_Polyhedron_add_constraints_and_minimize)
00538 YAP_STUB_2(ppl_Polyhedron_add_generators)
00539 YAP_STUB_2(ppl_Polyhedron_add_generators_and_minimize)
00540 YAP_STUB_2(ppl_Polyhedron_intersection_assign)
00541 YAP_STUB_2(ppl_Polyhedron_intersection_assign_and_minimize)
00542 YAP_STUB_2(ppl_Polyhedron_poly_hull_assign)
00543 YAP_STUB_2(ppl_Polyhedron_poly_hull_assign_and_minimize)
00544 YAP_STUB_2(ppl_Polyhedron_poly_difference_assign)
00545 YAP_STUB_4(ppl_Polyhedron_affine_image)
00546 YAP_STUB_4(ppl_Polyhedron_affine_preimage)
00547 YAP_STUB_5(ppl_Polyhedron_bounded_affine_image)
00548 YAP_STUB_5(ppl_Polyhedron_bounded_affine_preimage)
00549 YAP_STUB_5(ppl_Polyhedron_generalized_affine_image)
00550 YAP_STUB_5(ppl_Polyhedron_generalized_affine_preimage)
00551 YAP_STUB_4(ppl_Polyhedron_generalized_affine_image_lhs_rhs)
00552 YAP_STUB_4(ppl_Polyhedron_generalized_affine_preimage_lhs_rhs)
00553 YAP_STUB_2(ppl_Polyhedron_time_elapse_assign)
00554 YAP_STUB_1(ppl_Polyhedron_topological_closure_assign)
00555 YAP_STUB_4(ppl_Polyhedron_BHRZ03_widening_assign_with_tokens)
00556 YAP_STUB_2(ppl_Polyhedron_BHRZ03_widening_assign)
00557 YAP_STUB_5(ppl_Polyhedron_limited_BHRZ03_extrapolation_assign_with_tokens)
00558 YAP_STUB_3(ppl_Polyhedron_limited_BHRZ03_extrapolation_assign)
00559 YAP_STUB_5(ppl_Polyhedron_bounded_BHRZ03_extrapolation_assign_with_tokens)
00560 YAP_STUB_3(ppl_Polyhedron_bounded_BHRZ03_extrapolation_assign)
00561 YAP_STUB_4(ppl_Polyhedron_H79_widening_assign_with_tokens)
00562 YAP_STUB_2(ppl_Polyhedron_H79_widening_assign)
00563 YAP_STUB_5(ppl_Polyhedron_limited_H79_extrapolation_assign_with_tokens)
00564 YAP_STUB_3(ppl_Polyhedron_limited_H79_extrapolation_assign)
00565 YAP_STUB_5(ppl_Polyhedron_bounded_H79_extrapolation_assign_with_tokens)
00566 YAP_STUB_3(ppl_Polyhedron_bounded_H79_extrapolation_assign)
00567 YAP_STUB_2(ppl_Polyhedron_add_space_dimensions_and_project)
00568 YAP_STUB_2(ppl_Polyhedron_add_space_dimensions_and_embed)
00569 YAP_STUB_2(ppl_Polyhedron_concatenate_assign)
00570 YAP_STUB_2(ppl_Polyhedron_remove_space_dimensions)
00571 YAP_STUB_2(ppl_Polyhedron_remove_higher_space_dimensions)
00572 YAP_STUB_3(ppl_Polyhedron_expand_space_dimension)
00573 YAP_STUB_3(ppl_Polyhedron_fold_space_dimensions)
00574 YAP_STUB_2(ppl_Polyhedron_map_space_dimensions)
00575 YAP_STUB_1(ppl_new_LP_Problem_trivial)
00576 YAP_STUB_4(ppl_new_LP_Problem)
00577 YAP_STUB_2(ppl_new_LP_Problem_from_LP_Problem)
00578 YAP_STUB_2(ppl_LP_Problem_swap)
00579 YAP_STUB_1(ppl_delete_LP_Problem)
00580 YAP_STUB_2(ppl_LP_Problem_space_dimension)
00581 YAP_STUB_2(ppl_LP_Problem_constraints)
00582 YAP_STUB_2(ppl_LP_Problem_objective_function)
00583 YAP_STUB_2(ppl_LP_Problem_optimization_mode)
00584 YAP_STUB_1(ppl_LP_Problem_clear)
00585 YAP_STUB_2(ppl_LP_Problem_add_constraint)
00586 YAP_STUB_2(ppl_LP_Problem_add_constraints)
00587 YAP_STUB_2(ppl_LP_Problem_set_objective_function)
00588 YAP_STUB_2(ppl_LP_Problem_set_optimization_mode)
00589 YAP_STUB_1(ppl_LP_Problem_is_satisfiable)
00590 YAP_STUB_2(ppl_LP_Problem_solve)
00591 YAP_STUB_2(ppl_LP_Problem_feasible_point)
00592 YAP_STUB_2(ppl_LP_Problem_optimizing_point)
00593 YAP_STUB_3(ppl_LP_Problem_optimal_value)
00594 YAP_STUB_4(ppl_LP_Problem_evaluate_objective_function)
00595 YAP_STUB_1(ppl_LP_Problem_OK)
00596
00597 #define YAP_USER_C_PREDICATE(name, arity) \
00598 YAP_UserCPredicate(#name, reinterpret_cast<int(*)()>(yap_stub_##name), arity)
00599
00600 extern "C" void
00601 init() {
00602 ppl_initialize();
00603 YAP_USER_C_PREDICATE(ppl_version_major, 1);
00604 YAP_USER_C_PREDICATE(ppl_version_minor, 1);
00605 YAP_USER_C_PREDICATE(ppl_version_revision, 1);
00606 YAP_USER_C_PREDICATE(ppl_version_beta, 1);
00607 YAP_USER_C_PREDICATE(ppl_version, 1);
00608 YAP_USER_C_PREDICATE(ppl_banner, 1);
00609 YAP_USER_C_PREDICATE(ppl_max_space_dimension, 1);
00610 YAP_USER_C_PREDICATE(ppl_Coefficient_is_bounded, 0);
00611 YAP_USER_C_PREDICATE(ppl_Coefficient_max, 1);
00612 YAP_USER_C_PREDICATE(ppl_Coefficient_min, 1);
00613 YAP_USER_C_PREDICATE(ppl_initialize, 0);
00614 YAP_USER_C_PREDICATE(ppl_finalize, 0);
00615 YAP_USER_C_PREDICATE(ppl_set_timeout_exception_atom, 1);
00616 YAP_USER_C_PREDICATE(ppl_timeout_exception_atom, 1);
00617 YAP_USER_C_PREDICATE(ppl_set_timeout, 1);
00618 YAP_USER_C_PREDICATE(ppl_reset_timeout, 0);
00619 YAP_USER_C_PREDICATE(ppl_new_C_Polyhedron_from_space_dimension, 3);
00620 YAP_USER_C_PREDICATE(ppl_new_NNC_Polyhedron_from_space_dimension, 3);
00621 YAP_USER_C_PREDICATE(ppl_new_C_Polyhedron_from_C_Polyhedron, 2);
00622 YAP_USER_C_PREDICATE(ppl_new_C_Polyhedron_from_NNC_Polyhedron, 2);
00623 YAP_USER_C_PREDICATE(ppl_new_NNC_Polyhedron_from_C_Polyhedron, 2);
00624 YAP_USER_C_PREDICATE(ppl_new_NNC_Polyhedron_from_NNC_Polyhedron, 2);
00625 YAP_USER_C_PREDICATE(ppl_new_C_Polyhedron_from_constraints, 2);
00626 YAP_USER_C_PREDICATE(ppl_new_NNC_Polyhedron_from_constraints, 2);
00627 YAP_USER_C_PREDICATE(ppl_new_C_Polyhedron_from_generators, 2);
00628 YAP_USER_C_PREDICATE(ppl_new_NNC_Polyhedron_from_generators, 2);
00629 YAP_USER_C_PREDICATE(ppl_new_C_Polyhedron_from_bounding_box, 2);
00630 YAP_USER_C_PREDICATE(ppl_new_NNC_Polyhedron_from_bounding_box, 2);
00631 YAP_USER_C_PREDICATE(ppl_Polyhedron_swap, 2);
00632 YAP_USER_C_PREDICATE(ppl_delete_Polyhedron, 1);
00633 YAP_USER_C_PREDICATE(ppl_Polyhedron_space_dimension, 2);
00634 YAP_USER_C_PREDICATE(ppl_Polyhedron_affine_dimension, 2);
00635 YAP_USER_C_PREDICATE(ppl_Polyhedron_get_constraints, 2);
00636 YAP_USER_C_PREDICATE(ppl_Polyhedron_get_minimized_constraints, 2);
00637 YAP_USER_C_PREDICATE(ppl_Polyhedron_get_generators, 2);
00638 YAP_USER_C_PREDICATE(ppl_Polyhedron_get_minimized_generators, 2);
00639 YAP_USER_C_PREDICATE(ppl_Polyhedron_relation_with_constraint, 3);
00640 YAP_USER_C_PREDICATE(ppl_Polyhedron_relation_with_generator, 3);
00641 YAP_USER_C_PREDICATE(ppl_Polyhedron_get_bounding_box, 3);
00642 YAP_USER_C_PREDICATE(ppl_Polyhedron_is_empty, 1);
00643 YAP_USER_C_PREDICATE(ppl_Polyhedron_is_universe, 1);
00644 YAP_USER_C_PREDICATE(ppl_Polyhedron_is_bounded, 1);
00645 YAP_USER_C_PREDICATE(ppl_Polyhedron_bounds_from_above, 2);
00646 YAP_USER_C_PREDICATE(ppl_Polyhedron_bounds_from_below, 2);
00647 YAP_USER_C_PREDICATE(ppl_Polyhedron_maximize, 5);
00648 YAP_USER_C_PREDICATE(ppl_Polyhedron_maximize_with_point, 6);
00649 YAP_USER_C_PREDICATE(ppl_Polyhedron_minimize, 5);
00650 YAP_USER_C_PREDICATE(ppl_Polyhedron_minimize_with_point, 6);
00651 YAP_USER_C_PREDICATE(ppl_Polyhedron_is_topologically_closed, 1);
00652 YAP_USER_C_PREDICATE(ppl_Polyhedron_contains_Polyhedron, 2);
00653 YAP_USER_C_PREDICATE(ppl_Polyhedron_strictly_contains_Polyhedron, 2);
00654 YAP_USER_C_PREDICATE(ppl_Polyhedron_is_disjoint_from_Polyhedron, 2);
00655 YAP_USER_C_PREDICATE(ppl_Polyhedron_equals_Polyhedron, 2);
00656 YAP_USER_C_PREDICATE(ppl_Polyhedron_OK, 1);
00657 YAP_USER_C_PREDICATE(ppl_Polyhedron_add_constraint, 2);
00658 YAP_USER_C_PREDICATE(ppl_Polyhedron_add_constraint_and_minimize, 2);
00659 YAP_USER_C_PREDICATE(ppl_Polyhedron_add_generator, 2);
00660 YAP_USER_C_PREDICATE(ppl_Polyhedron_add_generator_and_minimize, 2);
00661 YAP_USER_C_PREDICATE(ppl_Polyhedron_add_constraints, 2);
00662 YAP_USER_C_PREDICATE(ppl_Polyhedron_add_constraints_and_minimize, 2);
00663 YAP_USER_C_PREDICATE(ppl_Polyhedron_add_generators, 2);
00664 YAP_USER_C_PREDICATE(ppl_Polyhedron_add_generators_and_minimize, 2);
00665 YAP_USER_C_PREDICATE(ppl_Polyhedron_intersection_assign, 2);
00666 YAP_USER_C_PREDICATE(ppl_Polyhedron_intersection_assign_and_minimize, 2);
00667 YAP_USER_C_PREDICATE(ppl_Polyhedron_poly_hull_assign, 2);
00668 YAP_USER_C_PREDICATE(ppl_Polyhedron_poly_hull_assign_and_minimize, 2);
00669 YAP_USER_C_PREDICATE(ppl_Polyhedron_poly_difference_assign, 2);
00670 YAP_USER_C_PREDICATE(ppl_Polyhedron_affine_image, 4);
00671 YAP_USER_C_PREDICATE(ppl_Polyhedron_affine_preimage, 4);
00672 YAP_USER_C_PREDICATE(ppl_Polyhedron_bounded_affine_image, 5);
00673 YAP_USER_C_PREDICATE(ppl_Polyhedron_bounded_affine_preimage, 5);
00674 YAP_USER_C_PREDICATE(ppl_Polyhedron_generalized_affine_image, 5);
00675 YAP_USER_C_PREDICATE(ppl_Polyhedron_generalized_affine_preimage, 5);
00676 YAP_USER_C_PREDICATE(ppl_Polyhedron_generalized_affine_image_lhs_rhs, 4);
00677 YAP_USER_C_PREDICATE(ppl_Polyhedron_generalized_affine_preimage_lhs_rhs, 4);
00678 YAP_USER_C_PREDICATE(ppl_Polyhedron_time_elapse_assign, 2);
00679 YAP_USER_C_PREDICATE(ppl_Polyhedron_topological_closure_assign, 1);
00680 YAP_USER_C_PREDICATE(ppl_Polyhedron_BHRZ03_widening_assign_with_tokens, 4);
00681 YAP_USER_C_PREDICATE(ppl_Polyhedron_BHRZ03_widening_assign, 2);
00682 YAP_USER_C_PREDICATE(
00683 ppl_Polyhedron_limited_BHRZ03_extrapolation_assign_with_tokens, 5);
00684 YAP_USER_C_PREDICATE(ppl_Polyhedron_limited_BHRZ03_extrapolation_assign, 3);
00685 YAP_USER_C_PREDICATE(
00686 ppl_Polyhedron_bounded_BHRZ03_extrapolation_assign_with_tokens, 5);
00687 YAP_USER_C_PREDICATE(ppl_Polyhedron_bounded_BHRZ03_extrapolation_assign, 3);
00688 YAP_USER_C_PREDICATE(ppl_Polyhedron_H79_widening_assign_with_tokens, 4);
00689 YAP_USER_C_PREDICATE(ppl_Polyhedron_H79_widening_assign, 2);
00690 YAP_USER_C_PREDICATE(
00691 ppl_Polyhedron_limited_H79_extrapolation_assign_with_tokens, 5);
00692 YAP_USER_C_PREDICATE(ppl_Polyhedron_limited_H79_extrapolation_assign, 3);
00693 YAP_USER_C_PREDICATE(
00694 ppl_Polyhedron_bounded_H79_extrapolation_assign_with_tokens, 5);
00695 YAP_USER_C_PREDICATE(ppl_Polyhedron_bounded_H79_extrapolation_assign, 3);
00696 YAP_USER_C_PREDICATE(ppl_Polyhedron_add_space_dimensions_and_project, 2);
00697 YAP_USER_C_PREDICATE(ppl_Polyhedron_add_space_dimensions_and_embed, 2);
00698 YAP_USER_C_PREDICATE(ppl_Polyhedron_concatenate_assign, 2);
00699 YAP_USER_C_PREDICATE(ppl_Polyhedron_remove_space_dimensions, 2);
00700 YAP_USER_C_PREDICATE(ppl_Polyhedron_remove_higher_space_dimensions, 2);
00701 YAP_USER_C_PREDICATE(ppl_Polyhedron_expand_space_dimension, 3);
00702 YAP_USER_C_PREDICATE(ppl_Polyhedron_fold_space_dimensions, 3);
00703 YAP_USER_C_PREDICATE(ppl_Polyhedron_map_space_dimensions, 2);
00704 YAP_USER_C_PREDICATE(ppl_new_LP_Problem_trivial, 1);
00705 YAP_USER_C_PREDICATE(ppl_new_LP_Problem, 4);
00706 YAP_USER_C_PREDICATE(ppl_new_LP_Problem_from_LP_Problem, 2);
00707 YAP_USER_C_PREDICATE(ppl_LP_Problem_swap, 2);
00708 YAP_USER_C_PREDICATE(ppl_delete_LP_Problem, 1);
00709 YAP_USER_C_PREDICATE(ppl_LP_Problem_space_dimension, 2);
00710 YAP_USER_C_PREDICATE(ppl_LP_Problem_constraints, 2);
00711 YAP_USER_C_PREDICATE(ppl_LP_Problem_objective_function, 2);
00712 YAP_USER_C_PREDICATE(ppl_LP_Problem_optimization_mode, 2);
00713 YAP_USER_C_PREDICATE(ppl_LP_Problem_clear, 1);
00714 YAP_USER_C_PREDICATE(ppl_LP_Problem_add_constraint, 2);
00715 YAP_USER_C_PREDICATE(ppl_LP_Problem_add_constraints, 2);
00716 YAP_USER_C_PREDICATE(ppl_LP_Problem_set_objective_function, 2);
00717 YAP_USER_C_PREDICATE(ppl_LP_Problem_set_optimization_mode, 2);
00718 YAP_USER_C_PREDICATE(ppl_LP_Problem_is_satisfiable, 1);
00719 YAP_USER_C_PREDICATE(ppl_LP_Problem_solve, 2);
00720 YAP_USER_C_PREDICATE(ppl_LP_Problem_feasible_point, 2);
00721 YAP_USER_C_PREDICATE(ppl_LP_Problem_optimizing_point, 2);
00722 YAP_USER_C_PREDICATE(ppl_LP_Problem_optimal_value, 3);
00723 YAP_USER_C_PREDICATE(ppl_LP_Problem_evaluate_objective_function, 4);
00724 YAP_USER_C_PREDICATE(ppl_LP_Problem_OK, 1);
00725 }