00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef PPL_ppl_prolog_common_defs_hh
00025 #define PPL_ppl_prolog_common_defs_hh 1
00026
00027 #define PPL_NO_AUTOMATIC_INITIALIZATION
00028 #include "ppl.hh"
00029 #ifdef PPL_WATCHDOG_LIBRARY_ENABLED
00030 #include "pwl.hh"
00031 #endif
00032 #include "ppl_prolog_sysdep.hh"
00033 #include "interfaced_boxes.hh"
00034 #include <set>
00035 #include <vector>
00036 #include <exception>
00037 #include <stdexcept>
00038 #include <iostream>
00039
00040 #ifndef PROLOG_TRACK_ALLOCATION
00041 #define PROLOG_TRACK_ALLOCATION 0
00042 #endif
00043 #ifndef NOISY_PROLOG_TRACK_ALLOCATION
00044 #define NOISY_PROLOG_TRACK_ALLOCATION 0
00045 #endif
00046
00047 namespace Parma_Polyhedra_Library {
00048
00049 namespace Interfaces {
00050
00051 namespace Prolog {
00052
00053 #if PROLOG_TRACK_ALLOCATION || NOISY_PROLOG_TRACK_ALLOCATION
00054
00055 class Allocation_Tracker {
00056 public:
00058 Allocation_Tracker();
00059
00064 template <typename T>
00065 void insert(const T* p);
00066
00071 template <typename T>
00072 void weak_insert(const T* p);
00073
00075 template <typename T>
00076 void check(const T* p) const;
00077
00082 template <typename T>
00083 void remove(const T* p);
00084
00090 ~Allocation_Tracker();
00091
00092 private:
00094 typedef std::set<const void*, std::less<const void*> > Set;
00095
00101 Set s;
00102
00108 Set weak_s;
00109 };
00110
00111 extern Allocation_Tracker allocation_tracker;
00112
00113 #define PPL_REGISTER(x) \
00114 Parma_Polyhedra_Library::Interfaces::Prolog \
00115 ::allocation_tracker.insert(x)
00116 #define PPL_WEAK_REGISTER(x) \
00117 Parma_Polyhedra_Library::Interfaces::Prolog \
00118 ::allocation_tracker.weak_insert(x)
00119 #define PPL_UNREGISTER(x) \
00120 Parma_Polyhedra_Library::Interfaces::Prolog \
00121 ::allocation_tracker.remove(x)
00122 #define PPL_CHECK(x) \
00123 Parma_Polyhedra_Library::Interfaces::Prolog \
00124 ::allocation_tracker.check(x)
00125
00126 #else // !PROLOG_TRACK_ALLOCATION && !NOISY_PROLOG_TRACK_ALLOCATION
00127
00128 #define PPL_REGISTER(x)
00129 #define PPL_WEAK_REGISTER(x)
00130 #define PPL_UNREGISTER(x)
00131 #define PPL_CHECK(x)
00132
00133 #endif // !PROLOG_TRACK_ALLOCATION && !NOISY_PROLOG_TRACK_ALLOCATION
00134
00135 class internal_exception {
00136 private:
00137 Prolog_term_ref t;
00138 const char* w;
00139
00140 public:
00141 internal_exception(Prolog_term_ref term, const char* where)
00142 : t(term),
00143 w(where) {
00144 }
00145
00146 virtual ~internal_exception() {
00147 }
00148
00149 virtual Prolog_term_ref term() const {
00150 return t;
00151 }
00152
00153 virtual const char* where() const {
00154 return w;
00155 }
00156 };
00157
00158 class Prolog_unsigned_out_of_range : public internal_exception {
00159 private:
00160 unsigned long m;
00161
00162 public:
00163 Prolog_unsigned_out_of_range(Prolog_term_ref term,
00164 const char* where,
00165 unsigned long max)
00166 : internal_exception(term, where),
00167 m(max) {
00168 }
00169
00170 unsigned long max() const {
00171 return m;
00172 }
00173 };
00174
00175 class non_linear : public internal_exception {
00176 public:
00177 non_linear(Prolog_term_ref term, const char* where)
00178 : internal_exception(term, where) {
00179 }
00180 };
00181
00182 class not_an_integer : public internal_exception {
00183 public:
00184 not_an_integer(Prolog_term_ref term, const char* where)
00185 : internal_exception(term, where) {
00186 }
00187 };
00188
00189 class not_unsigned_integer : public internal_exception {
00190 public:
00191 not_unsigned_integer(Prolog_term_ref term, const char* where)
00192 : internal_exception(term, where) {
00193 }
00194 };
00195
00196 class not_a_boolean : public internal_exception {
00197 public:
00198 not_a_boolean(Prolog_term_ref term, const char* where)
00199 : internal_exception(term, where) {
00200 }
00201 };
00202
00203 class not_a_variable : public internal_exception {
00204 public:
00205 not_a_variable(Prolog_term_ref term, const char* where)
00206 : internal_exception(term, where) {
00207 }
00208 };
00209
00210 class not_an_optimization_mode : public internal_exception {
00211 public:
00212 not_an_optimization_mode(Prolog_term_ref term, const char* where)
00213 : internal_exception(term, where) {
00214 }
00215 };
00216
00217 class not_a_bounded_integer_type_width : public internal_exception {
00218 public:
00219 not_a_bounded_integer_type_width(Prolog_term_ref term, const char* where)
00220 : internal_exception(term, where) {
00221 }
00222 };
00223
00224 class not_a_bounded_integer_type_representation : public internal_exception {
00225 public:
00226 not_a_bounded_integer_type_representation(Prolog_term_ref term,
00227 const char* where)
00228 : internal_exception(term, where) {
00229 }
00230 };
00231
00232 class not_a_bounded_integer_type_overflow : public internal_exception {
00233 public:
00234 not_a_bounded_integer_type_overflow(Prolog_term_ref term, const char* where)
00235 : internal_exception(term, where) {
00236 }
00237 };
00238
00239 class not_a_complexity_class : public internal_exception {
00240 public:
00241 not_a_complexity_class(Prolog_term_ref term, const char* where)
00242 : internal_exception(term, where) {
00243 }
00244 };
00245
00246 class not_a_control_parameter_name : public internal_exception {
00247 public:
00248 not_a_control_parameter_name(Prolog_term_ref term, const char* where)
00249 : internal_exception(term, where) {
00250 }
00251 };
00252
00253 class not_a_control_parameter_value : public internal_exception {
00254 public:
00255 not_a_control_parameter_value(Prolog_term_ref term, const char* where)
00256 : internal_exception(term, where) {
00257 }
00258 };
00259
00260 class not_a_pip_problem_control_parameter_name : public internal_exception {
00261 public:
00262 not_a_pip_problem_control_parameter_name(Prolog_term_ref term, const char* where)
00263 : internal_exception(term, where) {
00264 }
00265 };
00266
00267 class not_a_pip_problem_control_parameter_value : public internal_exception {
00268 public:
00269 not_a_pip_problem_control_parameter_value(Prolog_term_ref term, const char* where)
00270 : internal_exception(term, where) {
00271 }
00272 };
00273
00274 class not_universe_or_empty : public internal_exception {
00275 public:
00276 not_universe_or_empty(Prolog_term_ref term, const char* where)
00277 : internal_exception(term, where) {
00278 }
00279 };
00280
00281 class not_a_relation : public internal_exception {
00282 public:
00283 not_a_relation(Prolog_term_ref term, const char* where)
00284 : internal_exception(term, where) {
00285 }
00286 };
00287
00288 class not_a_nil_terminated_list : public internal_exception {
00289 public:
00290 not_a_nil_terminated_list(Prolog_term_ref term, const char* where)
00291 : internal_exception(term, where) {
00292 }
00293 };
00294
00295 class PPL_integer_out_of_range {
00296 private:
00297 Parma_Polyhedra_Library::Coefficient n;
00298
00299 public:
00300 PPL_integer_out_of_range(const Parma_Polyhedra_Library::Coefficient& value)
00301 : n(value) {
00302 }
00303
00304 const Parma_Polyhedra_Library::Coefficient value() const {
00305 return n;
00306 }
00307 };
00308
00309 class ppl_handle_mismatch : public internal_exception {
00310 public:
00311 ppl_handle_mismatch(Prolog_term_ref term, const char* where)
00312 : internal_exception(term, where) {
00313 }
00314 };
00315
00316 class unknown_interface_error {
00317 private:
00318 const char* w;
00319
00320 public:
00321 unknown_interface_error(const char* s)
00322 : w(s) {
00323 }
00324
00325 const char* where() const {
00326 return w;
00327 }
00328 };
00329
00330
00331 extern Prolog_atom a_nil;
00332
00333
00334 extern Prolog_atom a_dollar_VAR;
00335
00336
00337 extern Prolog_atom a_plus;
00338 extern Prolog_atom a_minus;
00339 extern Prolog_atom a_asterisk;
00340
00341
00342 extern Prolog_atom a_slash;
00343
00344
00345 extern Prolog_atom a_less_than;
00346 extern Prolog_atom a_equal_less_than;
00347 extern Prolog_atom a_equal;
00348 extern Prolog_atom a_greater_than_equal;
00349 extern Prolog_atom a_greater_than;
00350
00351
00352 extern Prolog_atom a_is_congruent_to;
00353 extern Prolog_atom a_modulo;
00354
00355
00356 extern Prolog_atom a_line;
00357 extern Prolog_atom a_ray;
00358 extern Prolog_atom a_point;
00359 extern Prolog_atom a_closure_point;
00360
00361
00362 extern Prolog_atom a_grid_line;
00363 extern Prolog_atom a_parameter;
00364 extern Prolog_atom a_grid_point;
00365
00366
00367 extern Prolog_atom a_is_disjoint;
00368 extern Prolog_atom a_strictly_intersects;
00369 extern Prolog_atom a_is_included;
00370 extern Prolog_atom a_saturates;
00371
00372
00373 extern Prolog_atom a_subsumes;
00374
00375
00376 extern Prolog_atom a_c;
00377
00378
00379 extern Prolog_atom a_empty;
00380
00381
00382 extern Prolog_atom a_o;
00383
00384
00385 extern Prolog_atom a_i;
00386
00387
00388 extern Prolog_atom a_minf;
00389 extern Prolog_atom a_pinf;
00390
00391
00392 extern Prolog_atom a_polynomial;
00393 extern Prolog_atom a_simplex;
00394 extern Prolog_atom a_any;
00395
00396
00397 extern Prolog_atom a_bits_8;
00398 extern Prolog_atom a_bits_16;
00399 extern Prolog_atom a_bits_32;
00400 extern Prolog_atom a_bits_64;
00401 extern Prolog_atom a_bits_128;
00402
00403
00404 extern Prolog_atom a_unsigned;
00405 extern Prolog_atom a_signed_2_complement;
00406
00407
00408 extern Prolog_atom a_overflow_wraps;
00409 extern Prolog_atom a_overflow_undefined;
00410 extern Prolog_atom a_overflow_impossible;
00411
00412
00413 extern Prolog_atom a_true;
00414 extern Prolog_atom a_false;
00415
00416
00417 struct Prolog_Interface_Atom {
00418 Prolog_atom* p_atom;
00419 const char* name;
00420 };
00421
00422 extern const Prolog_Interface_Atom prolog_interface_atoms[];
00423
00424 void
00425 handle_exception(const Prolog_unsigned_out_of_range& e);
00426
00427 void
00428 handle_exception(const not_unsigned_integer& e);
00429
00430 void
00431 handle_exception(const not_a_boolean& e);
00432
00433 void
00434 handle_exception(const non_linear& e);
00435
00436 void
00437 handle_exception(const not_a_variable& e);
00438
00439 void
00440 handle_exception(const not_an_integer& e);
00441
00442 void
00443 handle_exception(const ppl_handle_mismatch& e);
00444
00445 void
00446 handle_exception(const not_an_optimization_mode& e);
00447
00448 void
00449 handle_exception(const not_a_complexity_class& e);
00450
00451 void
00452 handle_exception(const not_a_bounded_integer_type_width& e);
00453
00454 void
00455 handle_exception(const not_a_bounded_integer_type_representation& e);
00456
00457 void
00458 handle_exception(const not_a_bounded_integer_type_overflow& e);
00459
00460 void
00461 handle_exception(const not_a_control_parameter_name& e);
00462
00463 void
00464 handle_exception(const not_a_control_parameter_value& e);
00465
00466 void
00467 handle_exception(const not_a_pip_problem_control_parameter_name& e);
00468
00469 void
00470 handle_exception(const not_a_pip_problem_control_parameter_value& e);
00471
00472 void
00473 handle_exception(const not_universe_or_empty& e);
00474
00475 void
00476 handle_exception(const not_a_relation& e);
00477
00478 void
00479 handle_exception(const not_a_nil_terminated_list& e);
00480
00481 void
00482 handle_exception(const PPL_integer_out_of_range& e);
00483
00484 void
00485 handle_exception(const unknown_interface_error& e);
00486
00487 void
00488 handle_exception(const std::overflow_error& e);
00489
00490 void
00491 handle_exception(const std::domain_error& e);
00492
00493 void
00494 handle_exception(const std::length_error& e);
00495
00496 void
00497 handle_exception(const std::invalid_argument& e);
00498
00499 void
00500 handle_exception(const std::logic_error& e);
00501
00502 void
00503 handle_exception(const std::bad_alloc&);
00504
00505 void
00506 handle_exception(const std::exception& e);
00507
00508 void
00509 handle_exception();
00510
00511 class timeout_exception
00512 : public Parma_Polyhedra_Library::Throwable {
00513 public:
00514 void throw_me() const {
00515 throw *this;
00516 }
00517 int priority() const {
00518 return 0;
00519 }
00520 };
00521
00522 void
00523 handle_exception(const timeout_exception&);
00524
00525 class deterministic_timeout_exception
00526 : public Parma_Polyhedra_Library::Throwable {
00527 public:
00528 void throw_me() const {
00529 throw *this;
00530 }
00531 int priority() const {
00532 return 0;
00533 }
00534 };
00535
00536 void
00537 handle_exception(const deterministic_timeout_exception&);
00538
00539 #define CATCH_ALL \
00540 catch (const Prolog_unsigned_out_of_range& e) { \
00541 handle_exception(e); \
00542 } \
00543 catch (const not_unsigned_integer& e) { \
00544 handle_exception(e); \
00545 } \
00546 catch (const non_linear& e) { \
00547 handle_exception(e); \
00548 } \
00549 catch (const not_a_variable& e) { \
00550 handle_exception(e); \
00551 } \
00552 catch (const not_an_integer& e) { \
00553 handle_exception(e); \
00554 } \
00555 catch (const ppl_handle_mismatch& e) { \
00556 handle_exception(e); \
00557 } \
00558 catch (const not_an_optimization_mode& e) { \
00559 handle_exception(e); \
00560 } \
00561 catch (const not_a_complexity_class& e) { \
00562 handle_exception(e); \
00563 } \
00564 catch (const not_a_bounded_integer_type_width& e) { \
00565 handle_exception(e); \
00566 } \
00567 catch (const not_a_bounded_integer_type_representation& e) { \
00568 handle_exception(e); \
00569 } \
00570 catch (const not_a_bounded_integer_type_overflow& e) { \
00571 handle_exception(e); \
00572 } \
00573 catch (const not_a_control_parameter_name& e) { \
00574 handle_exception(e); \
00575 } \
00576 catch (const not_a_control_parameter_value& e) { \
00577 handle_exception(e); \
00578 } \
00579 catch (const not_a_pip_problem_control_parameter_name& e) { \
00580 handle_exception(e); \
00581 } \
00582 catch (const not_a_pip_problem_control_parameter_value& e) { \
00583 handle_exception(e); \
00584 } \
00585 catch (const not_universe_or_empty& e) { \
00586 handle_exception(e); \
00587 } \
00588 catch (const not_a_relation& e) { \
00589 handle_exception(e); \
00590 } \
00591 catch (const not_a_nil_terminated_list& e) { \
00592 handle_exception(e); \
00593 } \
00594 catch (const PPL_integer_out_of_range& e) { \
00595 handle_exception(e); \
00596 } \
00597 catch (const unknown_interface_error& e) { \
00598 handle_exception(e); \
00599 } \
00600 catch (const timeout_exception& e) { \
00601 handle_exception(e); \
00602 } \
00603 catch (const deterministic_timeout_exception& e) { \
00604 handle_exception(e); \
00605 } \
00606 catch(const std::overflow_error& e) { \
00607 handle_exception(e); \
00608 } \
00609 catch(const std::domain_error& e) { \
00610 handle_exception(e); \
00611 } \
00612 catch(const std::length_error& e) { \
00613 handle_exception(e); \
00614 } \
00615 catch(const std::invalid_argument& e) { \
00616 handle_exception(e); \
00617 } \
00618 catch (const std::logic_error& e) { \
00619 handle_exception(e); \
00620 } \
00621 catch (const std::bad_alloc& e) { \
00622 handle_exception(e); \
00623 } \
00624 catch (const std::exception& e) { \
00625 handle_exception(e); \
00626 } \
00627 catch (...) { \
00628 handle_exception(); \
00629 } \
00630 return PROLOG_FAILURE
00631
00632
00633 Prolog_term_ref
00634 variable_term(dimension_type varid);
00635
00636 template <typename U>
00637 U
00638 term_to_unsigned(Prolog_term_ref t, const char* where) {
00639 using namespace Parma_Polyhedra_Library;
00640 using namespace Parma_Polyhedra_Library::Interfaces::Prolog;
00641 if (!Prolog_is_integer(t))
00642 throw not_unsigned_integer(t, where);
00643
00644 U d = 0;
00645 long l;
00646 if (Prolog_get_long(t, &l))
00647 if (l < 0)
00648 throw not_unsigned_integer(t, where);
00649 else if (static_cast<unsigned long>(l) > std::numeric_limits<U>::max())
00650 throw Prolog_unsigned_out_of_range(t, where,
00651 std::numeric_limits<U>::max());
00652 else
00653 d = l;
00654 else {
00655 PPL_DIRTY_TEMP_COEFFICIENT(v);
00656 Prolog_get_Coefficient(t, v);
00657 if (v < 0)
00658 throw not_unsigned_integer(t, where);
00659 Result r = assign_r(d, raw_value(v), ROUND_IGNORE);
00660 if (result_overflow(r))
00661 throw Prolog_unsigned_out_of_range(t, where,
00662 std::numeric_limits<U>::max());
00663 }
00664 return d;
00665 }
00666
00667 Prolog_atom
00668 term_to_boolean(Prolog_term_ref t, const char* where);
00669
00670 Prolog_atom
00671 term_to_universe_or_empty(Prolog_term_ref t, const char* where);
00672
00673 Prolog_term_ref
00674 interval_term(const Parma_Polyhedra_Library::Rational_Box::interval_type& i);
00675
00676 Prolog_atom
00677 term_to_complexity_class(Prolog_term_ref t, const char* where);
00678
00679 Prolog_atom
00680 term_to_bounded_integer_type_width(Prolog_term_ref t, const char* where);
00681
00682 Prolog_atom
00683 term_to_bounded_integer_type_representation(Prolog_term_ref t,
00684 const char* where);
00685
00686 Prolog_atom
00687 term_to_bounded_integer_type_overflow(Prolog_term_ref t, const char* where);
00688
00689 template <typename T>
00690 T*
00691 term_to_handle(Prolog_term_ref t, const char* where) {
00692 if (Prolog_is_address(t)) {
00693 void* p;
00694 if (Prolog_get_address(t, &p))
00695 return static_cast<T*>(p);
00696 }
00697 throw ppl_handle_mismatch(t, where);
00698 }
00699
00700 enum Boundary_Kind {
00701 LOWER_BOUNDARY,
00702 UPPER_BOUNDARY
00703 };
00704
00705 bool
00706 term_to_boundary(Prolog_term_ref t_b, Boundary_Kind kind,
00707 bool& finite, bool& closed,
00708 Parma_Polyhedra_Library::Coefficient& n, Parma_Polyhedra_Library::Coefficient& d);
00709
00710 Parma_Polyhedra_Library::Relation_Symbol
00711 term_to_relation_symbol(Prolog_term_ref t_r, const char* where);
00712
00713 Parma_Polyhedra_Library::Coefficient
00714 integer_term_to_Coefficient(Prolog_term_ref t);
00715
00716 Prolog_term_ref
00717 Coefficient_to_integer_term(const Parma_Polyhedra_Library::Coefficient& n);
00718
00719 bool
00720 unify_long(Prolog_term_ref t, long l);
00721
00722 bool
00723 unify_ulong(Prolog_term_ref t, unsigned long l);
00724
00725 Parma_Polyhedra_Library::Linear_Expression
00726 build_linear_expression(Prolog_term_ref t, const char* where);
00727
00728 Parma_Polyhedra_Library::Constraint
00729 build_constraint(Prolog_term_ref t, const char* where);
00730
00731 Parma_Polyhedra_Library::Congruence
00732 build_congruence(Prolog_term_ref t, const char* where);
00733
00734 Parma_Polyhedra_Library::Generator
00735 build_generator(Prolog_term_ref t, const char* where);
00736
00737 Parma_Polyhedra_Library::Grid_Generator
00738 build_grid_generator(Prolog_term_ref t, const char* where);
00739
00740 Prolog_term_ref
00741 get_linear_expression(const Parma_Polyhedra_Library::Linear_Expression& le);
00742
00743 Prolog_term_ref
00744 constraint_term(const Parma_Polyhedra_Library::Constraint& c);
00745
00746 Prolog_term_ref
00747 congruence_term(const Parma_Polyhedra_Library::Congruence& cg);
00748
00749 Prolog_term_ref
00750 generator_term(const Parma_Polyhedra_Library::Generator& g);
00751
00752 Prolog_term_ref
00753 grid_generator_term(const Parma_Polyhedra_Library::Grid_Generator& g);
00754
00755 Parma_Polyhedra_Library::Variable
00756 term_to_Variable(Prolog_term_ref t, const char* where);
00757
00758 Parma_Polyhedra_Library::Coefficient
00759 term_to_Coefficient(Prolog_term_ref t, const char* where);
00760
00761 Prolog_atom
00762 term_to_optimization_mode(Prolog_term_ref t, const char* where);
00763
00764 Prolog_atom
00765 term_to_control_parameter_name(Prolog_term_ref t, const char* where);
00766
00767 Prolog_atom
00768 term_to_control_parameter_value(Prolog_term_ref t, const char* where);
00769
00770 Prolog_atom
00771 term_to_pip_problem_control_parameter_name(Prolog_term_ref t, const char* where);
00772
00773 Prolog_atom
00774 term_to_pip_problem_control_parameter_value(Prolog_term_ref t, const char* where);
00775
00776 void
00777 check_nil_terminating(Prolog_term_ref t, const char* where);
00778
00779 }
00780
00781 }
00782
00783 }
00784
00785 extern "C" Prolog_foreign_return_type
00786 ppl_version_major(Prolog_term_ref t_v);
00787
00788 extern "C" Prolog_foreign_return_type
00789 ppl_version_minor(Prolog_term_ref t_v);
00790
00791 extern "C" Prolog_foreign_return_type
00792 ppl_version_revision(Prolog_term_ref t_v);
00793
00794 extern "C" Prolog_foreign_return_type
00795 ppl_version_beta(Prolog_term_ref t_v);
00796
00797 extern "C" Prolog_foreign_return_type
00798 ppl_version(Prolog_term_ref t_v);
00799
00800 extern "C" Prolog_foreign_return_type
00801 ppl_banner(Prolog_term_ref t_b);
00802
00803 extern "C" Prolog_foreign_return_type
00804 ppl_max_space_dimension(Prolog_term_ref t_msd);
00805
00806 extern "C" Prolog_foreign_return_type
00807 ppl_initialize();
00808
00809 extern "C" Prolog_foreign_return_type
00810 ppl_finalize();
00811
00812 extern "C" Prolog_foreign_return_type
00813 ppl_set_rounding_for_PPL();
00814
00815 extern "C" Prolog_foreign_return_type
00816 ppl_restore_pre_PPL_rounding();
00817
00818 extern "C" Prolog_foreign_return_type
00819 ppl_irrational_precision(Prolog_term_ref t_p);
00820
00821 extern "C" Prolog_foreign_return_type
00822 ppl_set_irrational_precision(Prolog_term_ref t_p);
00823
00824 extern "C" Prolog_foreign_return_type
00825 ppl_set_timeout_exception_atom(Prolog_term_ref t_tea);
00826
00827 extern "C" Prolog_foreign_return_type
00828 ppl_timeout_exception_atom(Prolog_term_ref t);
00829
00830 extern "C" Prolog_foreign_return_type
00831 ppl_set_timeout(Prolog_term_ref t_time);
00832
00833 extern "C" Prolog_foreign_return_type
00834 ppl_reset_timeout();
00835
00836 extern "C" Prolog_foreign_return_type
00837 ppl_set_deterministic_timeout(Prolog_term_ref t_weight);
00838
00839 extern "C" Prolog_foreign_return_type
00840 ppl_reset_deterministic_timeout();
00841
00842 extern "C" Prolog_foreign_return_type
00843 ppl_Coefficient_bits(Prolog_term_ref t_bits);
00844
00845 extern "C" Prolog_foreign_return_type
00846 ppl_Coefficient_is_bounded();
00847
00848 extern "C" Prolog_foreign_return_type
00849 ppl_Coefficient_min(Prolog_term_ref t_min);
00850
00851 extern "C" Prolog_foreign_return_type
00852 ppl_Coefficient_max(Prolog_term_ref t_max);
00853
00854 extern "C" Prolog_foreign_return_type
00855 ppl_new_MIP_Problem_from_space_dimension
00856 (Prolog_term_ref t_nd, Prolog_term_ref t_mip);
00857
00858 extern "C" Prolog_foreign_return_type
00859 ppl_new_MIP_Problem(Prolog_term_ref t_nd,
00860 Prolog_term_ref t_clist,
00861 Prolog_term_ref t_le_expr,
00862 Prolog_term_ref t_opt,
00863 Prolog_term_ref t_mip);
00864
00865 extern "C" Prolog_foreign_return_type
00866 ppl_new_MIP_Problem_from_MIP_Problem(Prolog_term_ref t_mip_source,
00867 Prolog_term_ref t_mip);
00868
00869 extern "C" Prolog_foreign_return_type
00870 ppl_MIP_Problem_swap(Prolog_term_ref t_lhs, Prolog_term_ref t_rhs);
00871
00872 extern "C" Prolog_foreign_return_type
00873 ppl_delete_MIP_Problem(Prolog_term_ref t_mip);
00874
00875 extern "C" Prolog_foreign_return_type
00876 ppl_MIP_Problem_space_dimension(Prolog_term_ref t_mip, Prolog_term_ref t_sd);
00877
00878 extern "C" Prolog_foreign_return_type
00879 ppl_MIP_Problem_integer_space_dimensions(Prolog_term_ref t_mip,
00880 Prolog_term_ref t_vlist);
00881
00882 extern "C" Prolog_foreign_return_type
00883 ppl_MIP_Problem_constraints(Prolog_term_ref t_mip,
00884 Prolog_term_ref t_clist);
00885
00886 extern "C" Prolog_foreign_return_type
00887 ppl_MIP_Problem_objective_function(Prolog_term_ref t_mip,
00888 Prolog_term_ref t_le_expr);
00889
00890 extern "C" Prolog_foreign_return_type
00891 ppl_MIP_Problem_optimization_mode(Prolog_term_ref t_mip,
00892 Prolog_term_ref t_opt);
00893
00894 extern "C" Prolog_foreign_return_type
00895 ppl_MIP_Problem_get_control_parameter(Prolog_term_ref t_mip,
00896 Prolog_term_ref t_cp_name,
00897 Prolog_term_ref t_cp_value);
00898
00899 extern "C" Prolog_foreign_return_type
00900 ppl_MIP_Problem_clear(Prolog_term_ref t_mip);
00901
00902 extern "C" Prolog_foreign_return_type
00903 ppl_MIP_Problem_add_space_dimensions_and_embed
00904 (Prolog_term_ref t_mip, Prolog_term_ref t_nnd);
00905
00906 extern "C" Prolog_foreign_return_type
00907 ppl_MIP_Problem_add_to_integer_space_dimensions(Prolog_term_ref t_mip,
00908 Prolog_term_ref t_vlist);
00909
00910 extern "C" Prolog_foreign_return_type
00911 ppl_MIP_Problem_add_constraint(Prolog_term_ref t_mip, Prolog_term_ref t_c);
00912
00913 extern "C" Prolog_foreign_return_type
00914 ppl_MIP_Problem_add_constraints(Prolog_term_ref t_mip,
00915 Prolog_term_ref t_clist);
00916
00917 extern "C" Prolog_foreign_return_type
00918 ppl_MIP_Problem_set_objective_function(Prolog_term_ref t_mip,
00919 Prolog_term_ref t_le_expr);
00920
00921 extern "C" Prolog_foreign_return_type
00922 ppl_MIP_Problem_set_optimization_mode(Prolog_term_ref t_mip,
00923 Prolog_term_ref t_opt);
00924
00925 extern "C" Prolog_foreign_return_type
00926 ppl_MIP_Problem_set_control_parameter(Prolog_term_ref t_mip,
00927 Prolog_term_ref t_cp_value);
00928
00929 extern "C" Prolog_foreign_return_type
00930 ppl_MIP_Problem_is_satisfiable(Prolog_term_ref t_mip);
00931
00932 extern "C" Prolog_foreign_return_type
00933 ppl_MIP_Problem_solve(Prolog_term_ref t_mip, Prolog_term_ref t_status);
00934
00935 extern "C" Prolog_foreign_return_type
00936 ppl_MIP_Problem_feasible_point(Prolog_term_ref t_mip,
00937 Prolog_term_ref t_g);
00938
00939 extern "C" Prolog_foreign_return_type
00940 ppl_MIP_Problem_optimizing_point(Prolog_term_ref t_mip,
00941 Prolog_term_ref t_g);
00942
00943 extern "C" Prolog_foreign_return_type
00944 ppl_MIP_Problem_optimal_value(Prolog_term_ref t_mip,
00945 Prolog_term_ref t_n,
00946 Prolog_term_ref t_d);
00947
00948 extern "C" Prolog_foreign_return_type
00949 ppl_MIP_Problem_evaluate_objective_function(Prolog_term_ref t_mip,
00950 Prolog_term_ref t_g,
00951 Prolog_term_ref t_n,
00952 Prolog_term_ref t_d);
00953
00954 extern "C" Prolog_foreign_return_type
00955 ppl_MIP_Problem_OK(Prolog_term_ref t_mip);
00956
00957 extern "C" Prolog_foreign_return_type
00958 ppl_MIP_Problem_ascii_dump(Prolog_term_ref t_mip);
00959
00960
00961 extern "C" Prolog_foreign_return_type
00962 ppl_new_PIP_Problem_from_space_dimension(Prolog_term_ref t_nd,
00963 Prolog_term_ref t_pip);
00964
00965 extern "C" Prolog_foreign_return_type
00966 ppl_new_PIP_Problem_from_PIP_Problem(Prolog_term_ref t_pip_source,
00967 Prolog_term_ref t_pip);
00968
00969 extern "C" Prolog_foreign_return_type
00970 ppl_new_PIP_Problem(Prolog_term_ref t_dim,
00971 Prolog_term_ref t_cs,
00972 Prolog_term_ref t_params,
00973 Prolog_term_ref t_pip);
00974
00975 extern "C" Prolog_foreign_return_type
00976 ppl_PIP_Problem_swap(Prolog_term_ref t_lhs, Prolog_term_ref t_rhs);
00977
00978 extern "C" Prolog_foreign_return_type
00979 ppl_delete_PIP_Problem(Prolog_term_ref t_pip);
00980
00981 extern "C" Prolog_foreign_return_type
00982 ppl_PIP_Problem_space_dimension(Prolog_term_ref t_pip, Prolog_term_ref t_sd);
00983
00984 extern "C" Prolog_foreign_return_type
00985 ppl_PIP_Problem_parameter_space_dimensions(Prolog_term_ref t_pip,
00986 Prolog_term_ref t_vlist);
00987
00988 extern "C" Prolog_foreign_return_type
00989 ppl_PIP_Problem_constraints(Prolog_term_ref t_pip, Prolog_term_ref t_cs);
00990
00991 extern "C" Prolog_foreign_return_type
00992 ppl_PIP_Problem_get_control_parameter(Prolog_term_ref t_pip,
00993 Prolog_term_ref t_cp_name,
00994 Prolog_term_ref t_cp_value);
00995
00996 extern "C" Prolog_foreign_return_type
00997 ppl_PIP_Problem_clear(Prolog_term_ref t_pip);
00998
00999 extern "C" Prolog_foreign_return_type
01000 ppl_PIP_Problem_add_space_dimensions_and_embed
01001 (Prolog_term_ref t_pip,
01002 Prolog_term_ref t_num_vars,
01003 Prolog_term_ref t_num_params);
01004
01005 extern "C" Prolog_foreign_return_type
01006 ppl_PIP_Problem_add_to_parameter_space_dimensions(Prolog_term_ref t_pip,
01007 Prolog_term_ref t_vlist);
01008
01009 extern "C" Prolog_foreign_return_type
01010 ppl_PIP_Problem_add_constraint(Prolog_term_ref t_pip, Prolog_term_ref t_c);
01011
01012 extern "C" Prolog_foreign_return_type
01013 ppl_PIP_Problem_add_constraints(Prolog_term_ref t_pip,
01014 Prolog_term_ref t_clist);
01015
01016 extern "C" Prolog_foreign_return_type
01017 ppl_PIP_Problem_set_control_parameter(Prolog_term_ref t_pip,
01018 Prolog_term_ref t_cp_value);
01019
01020 extern "C" Prolog_foreign_return_type
01021 ppl_PIP_Problem_is_satisfiable(Prolog_term_ref t_pip);
01022
01023 extern "C" Prolog_foreign_return_type
01024 ppl_PIP_Problem_solve(Prolog_term_ref t_pip, Prolog_term_ref t_status);
01025
01026 extern "C" Prolog_foreign_return_type
01027 ppl_PIP_Problem_solution(Prolog_term_ref t_pip,
01028 Prolog_term_ref t_pip_tree);
01029
01030 extern "C" Prolog_foreign_return_type
01031 ppl_PIP_Problem_optimizing_solution(Prolog_term_ref t_pip,
01032 Prolog_term_ref t_pip_tree);
01033
01034 extern "C" Prolog_foreign_return_type
01035 ppl_PIP_Problem_has_big_parameter_dimension(Prolog_term_ref t_pip,
01036 Prolog_term_ref t_d);
01037
01038 extern "C" Prolog_foreign_return_type
01039 ppl_PIP_Problem_set_big_parameter_dimension(Prolog_term_ref t_pip,
01040 Prolog_term_ref t_d);
01041
01042 extern "C" Prolog_foreign_return_type
01043 ppl_PIP_Problem_OK(Prolog_term_ref t_pip);
01044
01045 extern "C" Prolog_foreign_return_type
01046 ppl_PIP_Problem_ascii_dump(Prolog_term_ref t_pip);
01047
01048 extern "C" Prolog_foreign_return_type
01049 ppl_PIP_Tree_Node_constraints(Prolog_term_ref t_tree_node,
01050 Prolog_term_ref t_clist);
01051
01052 extern "C" Prolog_foreign_return_type
01053 ppl_PIP_Tree_Node_is_solution(Prolog_term_ref t_tree_node);
01054
01055 extern "C" Prolog_foreign_return_type
01056 ppl_PIP_Tree_Node_is_decision(Prolog_term_ref t_tree_node);
01057
01058 extern "C" Prolog_foreign_return_type
01059 ppl_PIP_Tree_Node_is_bottom(Prolog_term_ref t_tree_node);
01060
01061 extern "C" Prolog_foreign_return_type
01062 ppl_PIP_Tree_Node_artificials(Prolog_term_ref t_tree_node,
01063 Prolog_term_ref t_artlist);
01064
01065 extern "C" Prolog_foreign_return_type
01066 ppl_PIP_Tree_Node_OK(Prolog_term_ref t_pip_tree);
01067
01068 extern "C" Prolog_foreign_return_type
01069 ppl_PIP_Tree_Node_parametric_values(Prolog_term_ref t_pip_sol,
01070 Prolog_term_ref t_var,
01071 Prolog_term_ref t_pvalue_list);
01072
01073 extern "C" Prolog_foreign_return_type
01074 ppl_PIP_Tree_Node_true_child(Prolog_term_ref t_pip_dec,
01075 Prolog_term_ref t_pip_tree);
01076
01077 extern "C" Prolog_foreign_return_type
01078 ppl_PIP_Tree_Node_false_child(Prolog_term_ref t_pip_dec,
01079 Prolog_term_ref t_pip_tree);
01080
01081 using namespace Parma_Polyhedra_Library;
01082 using namespace Parma_Polyhedra_Library::Interfaces::Prolog;
01083
01084 #include "ppl_prolog_common.inlines.hh"
01085
01086 #endif // !defined(PPL_ppl_prolog_common_defs_hh)