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 "sicstus_cfli.h"
00026 #include "../exceptions.hh"
00027 #include <cassert>
00028 #include <sstream>
00029
00030 namespace PPL = Parma_Polyhedra_Library;
00031
00032 namespace {
00033
00037 bool Prolog_has_unbounded_integers;
00038
00044 long Prolog_min_integer;
00045
00051 long Prolog_max_integer;
00052
00056 void
00057 ppl_Prolog_sysdep_init() {
00058 Prolog_has_unbounded_integers = true;
00059 Prolog_min_integer = 0;
00060 Prolog_max_integer = 0;
00061 }
00062
00066 void
00067 ppl_Prolog_sysdep_deinit() {
00068 }
00069
00070 PPL::Coefficient
00071 integer_term_to_Coefficient(Prolog_term_ref t) {
00072 assert(SP_is_integer(t));
00073 long v;
00074 if (SP_get_integer(t, &v) != 0)
00075 return PPL::Coefficient(v);
00076 else {
00077 char* s;
00078 if (SP_get_number_chars(t, &s) != 0)
00079 return PPL::Coefficient(s);
00080 else
00081 throw unknown_interface_error("integer_term_to_Coefficient");
00082 }
00083 }
00084
00085 Prolog_term_ref
00086 Coefficient_to_integer_term(const PPL::Coefficient& n) {
00087 Prolog_term_ref t = Prolog_new_term_ref();
00088 long l = 0;
00089 if (PPL::assign_r(l, n, PPL::ROUND_NOT_NEEDED) == PPL::V_EQ) {
00090 if (SP_put_integer(t, l) == 0)
00091 throw unknown_interface_error("Coefficient_to_integer_term()");
00092 } else {
00093 std::ostringstream s;
00094 s << n;
00095 if (SP_put_number_chars(t, s.str().c_str()) == 0)
00096 throw unknown_interface_error("Coefficient_to_integer_term()");
00097 }
00098 return t;
00099 }
00100
00101 }
00102
00103 #include "../ppl_prolog.icc"
00104
00105 #define SP_STUB_0(name) \
00106 extern "C" Prolog_foreign_return_type \
00107 sp_stub_##name(Prolog_term_ref , void*) { \
00108 return name(); \
00109 }
00110
00111 #define SP_STUB_1(name) \
00112 extern "C" Prolog_foreign_return_type \
00113 sp_stub_##name(Prolog_term_ref goal, void*) { \
00114 Prolog_term_ref arg1 = Prolog_new_term_ref(); \
00115 if (!Prolog_get_arg(1, goal, arg1)) \
00116 return PROLOG_FAILURE; \
00117 return name(arg1); \
00118 }
00119
00120 #define SP_STUB_2(name) \
00121 extern "C" Prolog_foreign_return_type \
00122 sp_stub_##name(Prolog_term_ref goal, void*) { \
00123 Prolog_term_ref arg1 = Prolog_new_term_ref(); \
00124 if (!Prolog_get_arg(1, goal, arg1)) \
00125 return PROLOG_FAILURE; \
00126 Prolog_term_ref arg2 = Prolog_new_term_ref(); \
00127 if (!Prolog_get_arg(2, goal, arg2)) \
00128 return PROLOG_FAILURE; \
00129 return name(arg1, arg2); \
00130 }
00131
00132 #define SP_STUB_3(name) \
00133 extern "C" Prolog_foreign_return_type \
00134 sp_stub_##name(Prolog_term_ref goal, void*) { \
00135 Prolog_term_ref arg1 = Prolog_new_term_ref(); \
00136 if (!Prolog_get_arg(1, goal, arg1)) \
00137 return PROLOG_FAILURE; \
00138 Prolog_term_ref arg2 = Prolog_new_term_ref(); \
00139 if (!Prolog_get_arg(2, goal, arg2)) \
00140 return PROLOG_FAILURE; \
00141 Prolog_term_ref arg3 = Prolog_new_term_ref(); \
00142 if (!Prolog_get_arg(3, goal, arg3)) \
00143 return PROLOG_FAILURE; \
00144 return name(arg1, arg2, arg3); \
00145 }
00146
00147 #define SP_STUB_4(name) \
00148 extern "C" Prolog_foreign_return_type \
00149 sp_stub_##name(Prolog_term_ref goal, void*) { \
00150 Prolog_term_ref arg1 = Prolog_new_term_ref(); \
00151 if (!Prolog_get_arg(1, goal, arg1)) \
00152 return PROLOG_FAILURE; \
00153 Prolog_term_ref arg2 = Prolog_new_term_ref(); \
00154 if (!Prolog_get_arg(2, goal, arg2)) \
00155 return PROLOG_FAILURE; \
00156 Prolog_term_ref arg3 = Prolog_new_term_ref(); \
00157 if (!Prolog_get_arg(3, goal, arg3)) \
00158 return PROLOG_FAILURE; \
00159 Prolog_term_ref arg4 = Prolog_new_term_ref(); \
00160 if (!Prolog_get_arg(4, goal, arg4)) \
00161 return PROLOG_FAILURE; \
00162 return name(arg1, arg2, arg3, arg4); \
00163 }
00164
00165 #define SP_STUB_5(name) \
00166 extern "C" Prolog_foreign_return_type \
00167 sp_stub_##name(Prolog_term_ref goal, void*) { \
00168 Prolog_term_ref arg1 = Prolog_new_term_ref(); \
00169 if (!Prolog_get_arg(1, goal, arg1)) \
00170 return PROLOG_FAILURE; \
00171 Prolog_term_ref arg2 = Prolog_new_term_ref(); \
00172 if (!Prolog_get_arg(2, goal, arg2)) \
00173 return PROLOG_FAILURE; \
00174 Prolog_term_ref arg3 = Prolog_new_term_ref(); \
00175 if (!Prolog_get_arg(3, goal, arg3)) \
00176 return PROLOG_FAILURE; \
00177 Prolog_term_ref arg4 = Prolog_new_term_ref(); \
00178 if (!Prolog_get_arg(4, goal, arg4)) \
00179 return PROLOG_FAILURE; \
00180 Prolog_term_ref arg5 = Prolog_new_term_ref(); \
00181 if (!Prolog_get_arg(5, goal, arg5)) \
00182 return PROLOG_FAILURE; \
00183 return name(arg1, arg2, arg3, arg4, arg5); \
00184 }
00185
00186 #define SP_STUB_6(name) \
00187 extern "C" Prolog_foreign_return_type \
00188 sp_stub_##name(Prolog_term_ref goal, void*) { \
00189 Prolog_term_ref arg1 = Prolog_new_term_ref(); \
00190 if (!Prolog_get_arg(1, goal, arg1)) \
00191 return PROLOG_FAILURE; \
00192 Prolog_term_ref arg2 = Prolog_new_term_ref(); \
00193 if (!Prolog_get_arg(2, goal, arg2)) \
00194 return PROLOG_FAILURE; \
00195 Prolog_term_ref arg3 = Prolog_new_term_ref(); \
00196 if (!Prolog_get_arg(3, goal, arg3)) \
00197 return PROLOG_FAILURE; \
00198 Prolog_term_ref arg4 = Prolog_new_term_ref(); \
00199 if (!Prolog_get_arg(4, goal, arg4)) \
00200 return PROLOG_FAILURE; \
00201 Prolog_term_ref arg5 = Prolog_new_term_ref(); \
00202 if (!Prolog_get_arg(5, goal, arg5)) \
00203 return PROLOG_FAILURE; \
00204 Prolog_term_ref arg6 = Prolog_new_term_ref(); \
00205 if (!Prolog_get_arg(6, goal, arg6)) \
00206 return PROLOG_FAILURE; \
00207 return name(arg1, arg2, arg3, arg4, arg5, arg6); \
00208 }
00209
00210 SP_STUB_1(ppl_version_major)
00211 SP_STUB_1(ppl_version_minor)
00212 SP_STUB_1(ppl_version_revision)
00213 SP_STUB_1(ppl_version_beta)
00214 SP_STUB_1(ppl_version)
00215 SP_STUB_1(ppl_banner)
00216 SP_STUB_1(ppl_max_space_dimension)
00217 SP_STUB_0(ppl_Coefficient_is_bounded)
00218 SP_STUB_1(ppl_Coefficient_max)
00219 SP_STUB_1(ppl_Coefficient_min)
00220 SP_STUB_0(ppl_initialize)
00221 SP_STUB_0(ppl_finalize)
00222 SP_STUB_1(ppl_set_timeout_exception_atom)
00223 SP_STUB_1(ppl_timeout_exception_atom)
00224 SP_STUB_1(ppl_set_timeout)
00225 SP_STUB_0(ppl_reset_timeout)
00226 SP_STUB_3(ppl_new_C_Polyhedron_from_space_dimension)
00227 SP_STUB_3(ppl_new_NNC_Polyhedron_from_space_dimension)
00228 SP_STUB_2(ppl_new_C_Polyhedron_from_C_Polyhedron)
00229 SP_STUB_2(ppl_new_C_Polyhedron_from_NNC_Polyhedron)
00230 SP_STUB_2(ppl_new_NNC_Polyhedron_from_C_Polyhedron)
00231 SP_STUB_2(ppl_new_NNC_Polyhedron_from_NNC_Polyhedron)
00232 SP_STUB_2(ppl_new_C_Polyhedron_from_constraints)
00233 SP_STUB_2(ppl_new_NNC_Polyhedron_from_constraints)
00234 SP_STUB_2(ppl_new_C_Polyhedron_from_generators)
00235 SP_STUB_2(ppl_new_NNC_Polyhedron_from_generators)
00236 SP_STUB_2(ppl_new_C_Polyhedron_from_bounding_box)
00237 SP_STUB_2(ppl_new_NNC_Polyhedron_from_bounding_box)
00238 SP_STUB_2(ppl_Polyhedron_swap)
00239 SP_STUB_1(ppl_delete_Polyhedron)
00240 SP_STUB_2(ppl_Polyhedron_space_dimension)
00241 SP_STUB_2(ppl_Polyhedron_affine_dimension)
00242 SP_STUB_2(ppl_Polyhedron_get_constraints)
00243 SP_STUB_2(ppl_Polyhedron_get_minimized_constraints)
00244 SP_STUB_2(ppl_Polyhedron_get_generators)
00245 SP_STUB_2(ppl_Polyhedron_get_minimized_generators)
00246 SP_STUB_3(ppl_Polyhedron_relation_with_constraint)
00247 SP_STUB_3(ppl_Polyhedron_relation_with_generator)
00248 SP_STUB_3(ppl_Polyhedron_get_bounding_box)
00249 SP_STUB_1(ppl_Polyhedron_is_empty)
00250 SP_STUB_1(ppl_Polyhedron_is_universe)
00251 SP_STUB_1(ppl_Polyhedron_is_bounded)
00252 SP_STUB_2(ppl_Polyhedron_bounds_from_above)
00253 SP_STUB_2(ppl_Polyhedron_bounds_from_below)
00254 SP_STUB_5(ppl_Polyhedron_maximize)
00255 SP_STUB_6(ppl_Polyhedron_maximize_with_point)
00256 SP_STUB_5(ppl_Polyhedron_minimize)
00257 SP_STUB_6(ppl_Polyhedron_minimize_with_point)
00258 SP_STUB_1(ppl_Polyhedron_is_topologically_closed)
00259 SP_STUB_2(ppl_Polyhedron_contains_Polyhedron)
00260 SP_STUB_2(ppl_Polyhedron_strictly_contains_Polyhedron)
00261 SP_STUB_2(ppl_Polyhedron_is_disjoint_from_Polyhedron)
00262 SP_STUB_2(ppl_Polyhedron_equals_Polyhedron)
00263 SP_STUB_1(ppl_Polyhedron_OK)
00264 SP_STUB_2(ppl_Polyhedron_add_constraint)
00265 SP_STUB_2(ppl_Polyhedron_add_constraint_and_minimize)
00266 SP_STUB_2(ppl_Polyhedron_add_generator)
00267 SP_STUB_2(ppl_Polyhedron_add_generator_and_minimize)
00268 SP_STUB_2(ppl_Polyhedron_add_constraints)
00269 SP_STUB_2(ppl_Polyhedron_add_constraints_and_minimize)
00270 SP_STUB_2(ppl_Polyhedron_add_generators)
00271 SP_STUB_2(ppl_Polyhedron_add_generators_and_minimize)
00272 SP_STUB_2(ppl_Polyhedron_intersection_assign)
00273 SP_STUB_2(ppl_Polyhedron_intersection_assign_and_minimize)
00274 SP_STUB_2(ppl_Polyhedron_poly_hull_assign)
00275 SP_STUB_2(ppl_Polyhedron_poly_hull_assign_and_minimize)
00276 SP_STUB_2(ppl_Polyhedron_poly_difference_assign)
00277 SP_STUB_4(ppl_Polyhedron_affine_image)
00278 SP_STUB_4(ppl_Polyhedron_affine_preimage)
00279 SP_STUB_5(ppl_Polyhedron_bounded_affine_image)
00280 SP_STUB_5(ppl_Polyhedron_bounded_affine_preimage)
00281 SP_STUB_5(ppl_Polyhedron_generalized_affine_image)
00282 SP_STUB_5(ppl_Polyhedron_generalized_affine_preimage)
00283 SP_STUB_4(ppl_Polyhedron_generalized_affine_image_lhs_rhs)
00284 SP_STUB_4(ppl_Polyhedron_generalized_affine_preimage_lhs_rhs)
00285 SP_STUB_2(ppl_Polyhedron_time_elapse_assign)
00286 SP_STUB_1(ppl_Polyhedron_topological_closure_assign)
00287 SP_STUB_4(ppl_Polyhedron_BHRZ03_widening_assign_with_tokens)
00288 SP_STUB_2(ppl_Polyhedron_BHRZ03_widening_assign)
00289 SP_STUB_5(ppl_Polyhedron_limited_BHRZ03_extrapolation_assign_with_tokens)
00290 SP_STUB_3(ppl_Polyhedron_limited_BHRZ03_extrapolation_assign)
00291 SP_STUB_5(ppl_Polyhedron_bounded_BHRZ03_extrapolation_assign_with_tokens)
00292 SP_STUB_3(ppl_Polyhedron_bounded_BHRZ03_extrapolation_assign)
00293 SP_STUB_4(ppl_Polyhedron_H79_widening_assign_with_tokens)
00294 SP_STUB_2(ppl_Polyhedron_H79_widening_assign)
00295 SP_STUB_5(ppl_Polyhedron_limited_H79_extrapolation_assign_with_tokens)
00296 SP_STUB_3(ppl_Polyhedron_limited_H79_extrapolation_assign)
00297 SP_STUB_5(ppl_Polyhedron_bounded_H79_extrapolation_assign_with_tokens)
00298 SP_STUB_3(ppl_Polyhedron_bounded_H79_extrapolation_assign)
00299 SP_STUB_2(ppl_Polyhedron_add_space_dimensions_and_project)
00300 SP_STUB_2(ppl_Polyhedron_add_space_dimensions_and_embed)
00301 SP_STUB_2(ppl_Polyhedron_concatenate_assign)
00302 SP_STUB_2(ppl_Polyhedron_remove_space_dimensions)
00303 SP_STUB_2(ppl_Polyhedron_remove_higher_space_dimensions)
00304 SP_STUB_3(ppl_Polyhedron_expand_space_dimension)
00305 SP_STUB_3(ppl_Polyhedron_fold_space_dimensions)
00306 SP_STUB_2(ppl_Polyhedron_map_space_dimensions)
00307 SP_STUB_1(ppl_new_LP_Problem_trivial)
00308 SP_STUB_4(ppl_new_LP_Problem)
00309 SP_STUB_2(ppl_new_LP_Problem_from_LP_Problem)
00310 SP_STUB_2(ppl_LP_Problem_swap)
00311 SP_STUB_1(ppl_delete_LP_Problem)
00312 SP_STUB_2(ppl_LP_Problem_space_dimension)
00313 SP_STUB_2(ppl_LP_Problem_constraints)
00314 SP_STUB_2(ppl_LP_Problem_objective_function)
00315 SP_STUB_2(ppl_LP_Problem_optimization_mode)
00316 SP_STUB_1(ppl_LP_Problem_clear)
00317 SP_STUB_2(ppl_LP_Problem_add_constraint)
00318 SP_STUB_2(ppl_LP_Problem_add_constraints)
00319 SP_STUB_2(ppl_LP_Problem_set_objective_function)
00320 SP_STUB_2(ppl_LP_Problem_set_optimization_mode)
00321 SP_STUB_1(ppl_LP_Problem_is_satisfiable)
00322 SP_STUB_2(ppl_LP_Problem_solve)
00323 SP_STUB_2(ppl_LP_Problem_feasible_point)
00324 SP_STUB_2(ppl_LP_Problem_optimizing_point)
00325 SP_STUB_3(ppl_LP_Problem_optimal_value)
00326 SP_STUB_4(ppl_LP_Problem_evaluate_objective_function)
00327 SP_STUB_1(ppl_LP_Problem_OK)
00328
00329 #define SP_DEFINE_C_PREDICATE(name, arity) \
00330 SP_define_c_predicate(#name, arity, "user", sp_stub_##name, NULL)
00331
00332 extern "C" void
00333 ppl_sicstus_init(int ) {
00334 ppl_initialize();
00335 for (size_t i = 0; i < sizeof(prolog_atoms)/sizeof(prolog_atoms[0]); ++i) {
00336 if (SP_register_atom(*prolog_atoms[i].p_atom) == 0) {
00337 Prolog_term_ref et = Prolog_new_term_ref();
00338 Prolog_put_atom_chars(et, "Cannot initialize the PPL interface");
00339 Prolog_raise_exception(et);
00340 return;
00341 }
00342 }
00343 SP_DEFINE_C_PREDICATE(ppl_version_major, 1);
00344 SP_DEFINE_C_PREDICATE(ppl_version_minor, 1);
00345 SP_DEFINE_C_PREDICATE(ppl_version_revision, 1);
00346 SP_DEFINE_C_PREDICATE(ppl_version_beta, 1);
00347 SP_DEFINE_C_PREDICATE(ppl_version, 1);
00348 SP_DEFINE_C_PREDICATE(ppl_banner, 1);
00349 SP_DEFINE_C_PREDICATE(ppl_max_space_dimension, 1);
00350 SP_DEFINE_C_PREDICATE(ppl_Coefficient_is_bounded, 0);
00351 SP_DEFINE_C_PREDICATE(ppl_Coefficient_max, 1);
00352 SP_DEFINE_C_PREDICATE(ppl_Coefficient_min, 1);
00353 SP_DEFINE_C_PREDICATE(ppl_initialize, 0);
00354 SP_DEFINE_C_PREDICATE(ppl_finalize, 0);
00355 SP_DEFINE_C_PREDICATE(ppl_set_timeout_exception_atom, 1);
00356 SP_DEFINE_C_PREDICATE(ppl_timeout_exception_atom, 1);
00357 SP_DEFINE_C_PREDICATE(ppl_set_timeout, 1);
00358 SP_DEFINE_C_PREDICATE(ppl_reset_timeout, 0);
00359 SP_DEFINE_C_PREDICATE(ppl_new_C_Polyhedron_from_space_dimension, 3);
00360 SP_DEFINE_C_PREDICATE(ppl_new_NNC_Polyhedron_from_space_dimension, 3);
00361 SP_DEFINE_C_PREDICATE(ppl_new_C_Polyhedron_from_C_Polyhedron, 2);
00362 SP_DEFINE_C_PREDICATE(ppl_new_C_Polyhedron_from_NNC_Polyhedron, 2);
00363 SP_DEFINE_C_PREDICATE(ppl_new_NNC_Polyhedron_from_C_Polyhedron, 2);
00364 SP_DEFINE_C_PREDICATE(ppl_new_NNC_Polyhedron_from_NNC_Polyhedron, 2);
00365 SP_DEFINE_C_PREDICATE(ppl_new_C_Polyhedron_from_constraints, 2);
00366 SP_DEFINE_C_PREDICATE(ppl_new_NNC_Polyhedron_from_constraints, 2);
00367 SP_DEFINE_C_PREDICATE(ppl_new_C_Polyhedron_from_generators, 2);
00368 SP_DEFINE_C_PREDICATE(ppl_new_NNC_Polyhedron_from_generators, 2);
00369 SP_DEFINE_C_PREDICATE(ppl_new_C_Polyhedron_from_bounding_box, 2);
00370 SP_DEFINE_C_PREDICATE(ppl_new_NNC_Polyhedron_from_bounding_box, 2);
00371 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_swap, 2);
00372 SP_DEFINE_C_PREDICATE(ppl_delete_Polyhedron, 1);
00373 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_space_dimension, 2);
00374 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_affine_dimension, 2);
00375 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_get_constraints, 2);
00376 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_get_minimized_constraints, 2);
00377 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_get_generators, 2);
00378 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_get_minimized_generators, 2);
00379 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_relation_with_constraint, 3);
00380 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_relation_with_generator, 3);
00381 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_get_bounding_box, 3);
00382 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_is_empty, 1);
00383 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_is_universe, 1);
00384 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_is_bounded, 1);
00385 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_bounds_from_above, 2);
00386 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_bounds_from_below, 2);
00387 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_maximize, 5);
00388 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_maximize_with_point, 6);
00389 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_minimize, 5);
00390 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_minimize_with_point, 6);
00391 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_is_topologically_closed, 1);
00392 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_contains_Polyhedron, 2);
00393 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_strictly_contains_Polyhedron, 2);
00394 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_is_disjoint_from_Polyhedron, 2);
00395 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_equals_Polyhedron, 2);
00396 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_OK, 1);
00397 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_add_constraint, 2);
00398 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_add_constraint_and_minimize, 2);
00399 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_add_generator, 2);
00400 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_add_generator_and_minimize, 2);
00401 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_add_constraints, 2);
00402 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_add_constraints_and_minimize, 2);
00403 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_add_generators, 2);
00404 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_add_generators_and_minimize, 2);
00405 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_intersection_assign, 2);
00406 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_intersection_assign_and_minimize, 2);
00407 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_poly_hull_assign, 2);
00408 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_poly_hull_assign_and_minimize, 2);
00409 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_poly_difference_assign, 2);
00410 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_affine_image, 4);
00411 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_affine_preimage, 4);
00412 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_bounded_affine_image, 5);
00413 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_bounded_affine_preimage, 5);
00414 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_generalized_affine_image, 5);
00415 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_generalized_affine_preimage, 5);
00416 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_generalized_affine_image_lhs_rhs, 4);
00417 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_generalized_affine_preimage_lhs_rhs, 4);
00418 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_time_elapse_assign, 2);
00419 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_topological_closure_assign, 1);
00420 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_BHRZ03_widening_assign_with_tokens, 4);
00421 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_BHRZ03_widening_assign, 2);
00422 SP_DEFINE_C_PREDICATE(
00423 ppl_Polyhedron_limited_BHRZ03_extrapolation_assign_with_tokens, 5);
00424 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_limited_BHRZ03_extrapolation_assign, 3);
00425 SP_DEFINE_C_PREDICATE(
00426 ppl_Polyhedron_bounded_BHRZ03_extrapolation_assign_with_tokens, 5);
00427 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_bounded_BHRZ03_extrapolation_assign, 3);
00428 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_H79_widening_assign_with_tokens, 4);
00429 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_H79_widening_assign, 2);
00430 SP_DEFINE_C_PREDICATE(
00431 ppl_Polyhedron_limited_H79_extrapolation_assign_with_tokens, 5);
00432 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_limited_H79_extrapolation_assign, 3);
00433 SP_DEFINE_C_PREDICATE(
00434 ppl_Polyhedron_bounded_H79_extrapolation_assign_with_tokens, 5);
00435 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_bounded_H79_extrapolation_assign, 3);
00436 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_add_space_dimensions_and_project, 2);
00437 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_add_space_dimensions_and_embed, 2);
00438 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_concatenate_assign, 2);
00439 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_remove_space_dimensions, 2);
00440 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_remove_higher_space_dimensions, 2);
00441 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_expand_space_dimension, 3);
00442 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_fold_space_dimensions, 3);
00443 SP_DEFINE_C_PREDICATE(ppl_Polyhedron_map_space_dimensions, 2);
00444 SP_DEFINE_C_PREDICATE(ppl_new_LP_Problem_trivial, 1);
00445 SP_DEFINE_C_PREDICATE(ppl_new_LP_Problem, 4);
00446 SP_DEFINE_C_PREDICATE(ppl_new_LP_Problem_from_LP_Problem, 2);
00447 SP_DEFINE_C_PREDICATE(ppl_LP_Problem_swap, 2);
00448 SP_DEFINE_C_PREDICATE(ppl_delete_LP_Problem, 1);
00449 SP_DEFINE_C_PREDICATE(ppl_LP_Problem_space_dimension, 2);
00450 SP_DEFINE_C_PREDICATE(ppl_LP_Problem_constraints, 2);
00451 SP_DEFINE_C_PREDICATE(ppl_LP_Problem_objective_function, 2);
00452 SP_DEFINE_C_PREDICATE(ppl_LP_Problem_optimization_mode, 2);
00453 SP_DEFINE_C_PREDICATE(ppl_LP_Problem_clear, 1);
00454 SP_DEFINE_C_PREDICATE(ppl_LP_Problem_add_constraint, 2);
00455 SP_DEFINE_C_PREDICATE(ppl_LP_Problem_add_constraints, 2);
00456 SP_DEFINE_C_PREDICATE(ppl_LP_Problem_set_objective_function, 2);
00457 SP_DEFINE_C_PREDICATE(ppl_LP_Problem_set_optimization_mode, 2);
00458 SP_DEFINE_C_PREDICATE(ppl_LP_Problem_is_satisfiable, 1);
00459 SP_DEFINE_C_PREDICATE(ppl_LP_Problem_solve, 2);
00460 SP_DEFINE_C_PREDICATE(ppl_LP_Problem_feasible_point, 2);
00461 SP_DEFINE_C_PREDICATE(ppl_LP_Problem_optimizing_point, 2);
00462 SP_DEFINE_C_PREDICATE(ppl_LP_Problem_optimal_value, 3);
00463 SP_DEFINE_C_PREDICATE(ppl_LP_Problem_evaluate_objective_function, 4);
00464 SP_DEFINE_C_PREDICATE(ppl_LP_Problem_OK, 1);
00465 }
00466
00467 extern "C" void
00468 ppl_sicstus_deinit(int ) {
00469 for (size_t i = 0; i < sizeof(prolog_atoms)/sizeof(prolog_atoms[0]); ++i)
00470
00471
00472 (void) SP_unregister_atom(*prolog_atoms[i].p_atom);
00473 ppl_finalize();
00474 }