ppl_prolog.icc File Reference

#include "ppl.hh"
#include "pwl.hh"
#include "track_allocation.hh"
#include <set>
#include <vector>
#include <exception>
#include <stdexcept>
#include <sstream>
#include <climits>

Include dependency graph for ppl_prolog.icc:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define CATCH_ALL

Enumerations

enum  Boundary_Kind { LOWER, UPPER }

Functions

Prolog_term_ref Prolog_atom_term_from_string (const char *s)
void handle_exception (const Prolog_unsigned_out_of_range &e)
void handle_exception (const not_unsigned_integer &e)
void handle_exception (const non_linear &e)
void handle_exception (const not_a_variable &e)
void handle_exception (const not_an_integer &e)
void handle_exception (const not_a_polyhedron_handle &e)
void handle_exception (const not_an_optimization_mode &e)
void handle_exception (const not_an_lp_problem_handle &e)
void handle_exception (const not_a_complexity_class &e)
void handle_exception (const not_universe_or_empty &e)
void handle_exception (const not_a_relation &e)
void handle_exception (const not_a_nil_terminated_list &e)
void handle_exception (const PPL_integer_out_of_range &e)
void handle_exception (const unknown_interface_error &e)
void handle_exception (const std::overflow_error &e)
void handle_exception (const std::length_error &e)
void handle_exception (const std::bad_alloc &)
void handle_exception (const std::exception &e)
void handle_exception ()
void reset_timeout ()
void handle_exception (const timeout_exception &)
Prolog_term_ref variable_term (dimension_type varid)
template<typename U>
term_to_unsigned (Prolog_term_ref t)
Prolog_atom term_to_universe_or_empty (Prolog_term_ref t)
Linear_Expression build_linear_expression (Prolog_term_ref t)
Constraint build_constraint (Prolog_term_ref t)
Generator build_generator (Prolog_term_ref t)
template<typename R>
Prolog_term_ref get_linear_expression (const R &r)
Prolog_term_ref constraint_term (const Constraint &c)
Prolog_term_ref generator_term (const Generator &g)
Variable term_to_Variable (Prolog_term_ref t)
Coefficient term_to_Coefficient (Prolog_term_ref t)
Polyhedronterm_to_polyhedron_handle (Prolog_term_ref t_ph)
LP_Problemterm_to_lp_problem_handle (Prolog_term_ref t_lp)
Prolog_atom term_to_optimization_mode (Prolog_term_ref t)
bool unify_long (Prolog_term_ref t, long l)
bool unify_ulong (Prolog_term_ref t, unsigned long l)
void check_nil_terminating (Prolog_term_ref t)
Prolog_foreign_return_type ppl_version_major (Prolog_term_ref t_v)
Prolog_foreign_return_type ppl_version_minor (Prolog_term_ref t_v)
Prolog_foreign_return_type ppl_version_revision (Prolog_term_ref t_v)
Prolog_foreign_return_type ppl_version_beta (Prolog_term_ref t_v)
Prolog_foreign_return_type ppl_version (Prolog_term_ref t_v)
Prolog_foreign_return_type ppl_banner (Prolog_term_ref t_b)
dimension_type max_representable_dimension (dimension_type d)
Prolog_foreign_return_type ppl_max_space_dimension (Prolog_term_ref t_msd)
Prolog_foreign_return_type ppl_initialize ()
 Initializes the Parma Polyhedra Library. This function must be called before any other function.
Prolog_foreign_return_type ppl_finalize ()
 Finalizes the Parma Polyhedra Library. This function must be called after any other function.
Prolog_foreign_return_type ppl_set_timeout_exception_atom (Prolog_term_ref t_tea)
Prolog_foreign_return_type ppl_timeout_exception_atom (Prolog_term_ref t)
Prolog_foreign_return_type ppl_set_timeout (Prolog_term_ref t_time)
Prolog_foreign_return_type ppl_reset_timeout ()
Prolog_foreign_return_type ppl_Coefficient_is_bounded ()
 Returns a positive integer if coefficients are bounded; returns 0 otherwise.
Prolog_foreign_return_type ppl_Coefficient_min (Prolog_term_ref t_min)
Prolog_foreign_return_type ppl_Coefficient_max (Prolog_term_ref t_max)
Prolog_foreign_return_type ppl_new_C_Polyhedron_from_space_dimension (Prolog_term_ref t_nd, Prolog_term_ref t_uoe, Prolog_term_ref t_ph)
Prolog_foreign_return_type ppl_new_NNC_Polyhedron_from_space_dimension (Prolog_term_ref t_nd, Prolog_term_ref t_uoe, Prolog_term_ref t_ph)
Prolog_foreign_return_type ppl_new_C_Polyhedron_from_C_Polyhedron (Prolog_term_ref t_ph_source, Prolog_term_ref t_ph)
Prolog_foreign_return_type ppl_new_NNC_Polyhedron_from_C_Polyhedron (Prolog_term_ref t_ph_source, Prolog_term_ref t_ph)
Prolog_foreign_return_type ppl_new_C_Polyhedron_from_NNC_Polyhedron (Prolog_term_ref t_ph_source, Prolog_term_ref t_ph)
Prolog_foreign_return_type ppl_new_NNC_Polyhedron_from_NNC_Polyhedron (Prolog_term_ref t_ph_source, Prolog_term_ref t_ph)
Prolog_foreign_return_type ppl_new_C_Polyhedron_from_constraints (Prolog_term_ref t_clist, Prolog_term_ref t_ph)
Prolog_foreign_return_type ppl_new_NNC_Polyhedron_from_constraints (Prolog_term_ref t_clist, Prolog_term_ref t_ph)
Prolog_foreign_return_type ppl_new_C_Polyhedron_from_generators (Prolog_term_ref t_glist, Prolog_term_ref t_ph)
Prolog_foreign_return_type ppl_new_NNC_Polyhedron_from_generators (Prolog_term_ref t_glist, Prolog_term_ref t_ph)
bool term_to_boundary (Prolog_term_ref t_b, Boundary_Kind kind, bool &finite, bool &closed, Coefficient &n, Coefficient &d)
Prolog_foreign_return_type ppl_new_C_Polyhedron_from_bounding_box (Prolog_term_ref t_bb, Prolog_term_ref t_ph)
Prolog_foreign_return_type ppl_new_NNC_Polyhedron_from_bounding_box (Prolog_term_ref t_bb, Prolog_term_ref t_ph)
Prolog_foreign_return_type ppl_Polyhedron_swap (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs)
Prolog_foreign_return_type ppl_delete_Polyhedron (Prolog_term_ref t_ph)
Prolog_foreign_return_type ppl_Polyhedron_space_dimension (Prolog_term_ref t_ph, Prolog_term_ref t_sd)
Prolog_foreign_return_type ppl_Polyhedron_affine_dimension (Prolog_term_ref t_ph, Prolog_term_ref t_sd)
Prolog_foreign_return_type ppl_Polyhedron_get_constraints (Prolog_term_ref t_ph, Prolog_term_ref t_clist)
Prolog_foreign_return_type ppl_Polyhedron_get_minimized_constraints (Prolog_term_ref t_ph, Prolog_term_ref t_clist)
Prolog_foreign_return_type ppl_Polyhedron_get_generators (Prolog_term_ref t_ph, Prolog_term_ref t_glist)
Prolog_foreign_return_type ppl_Polyhedron_get_minimized_generators (Prolog_term_ref t_ph, Prolog_term_ref t_glist)
Prolog_foreign_return_type ppl_Polyhedron_relation_with_constraint (Prolog_term_ref t_ph, Prolog_term_ref t_c, Prolog_term_ref t_r)
Prolog_foreign_return_type ppl_Polyhedron_relation_with_generator (Prolog_term_ref t_ph, Prolog_term_ref t_g, Prolog_term_ref t_r)
Prolog_term_ref extended_rational_term (const ERational &e)
Prolog_term_ref interval_term (const Interval &i)
Prolog_atom term_to_complexity_class (Prolog_term_ref t)
Prolog_foreign_return_type ppl_Polyhedron_get_bounding_box (Prolog_term_ref t_ph, Prolog_term_ref t_cc, Prolog_term_ref t_bb)
Prolog_foreign_return_type ppl_Polyhedron_is_empty (Prolog_term_ref t_ph)
Prolog_foreign_return_type ppl_Polyhedron_is_universe (Prolog_term_ref t_ph)
Prolog_foreign_return_type ppl_Polyhedron_is_bounded (Prolog_term_ref t_ph)
Prolog_foreign_return_type ppl_Polyhedron_bounds_from_above (Prolog_term_ref t_ph, Prolog_term_ref t_expr)
Prolog_foreign_return_type ppl_Polyhedron_bounds_from_below (Prolog_term_ref t_ph, Prolog_term_ref t_expr)
Prolog_foreign_return_type ppl_Polyhedron_maximize (Prolog_term_ref t_ph, Prolog_term_ref t_le_expr, Prolog_term_ref t_n, Prolog_term_ref t_d, Prolog_term_ref t_max)
Prolog_foreign_return_type ppl_Polyhedron_maximize_with_point (Prolog_term_ref t_ph, Prolog_term_ref t_le_expr, Prolog_term_ref t_n, Prolog_term_ref t_d, Prolog_term_ref t_max, Prolog_term_ref t_g)
Prolog_foreign_return_type ppl_Polyhedron_minimize (Prolog_term_ref t_ph, Prolog_term_ref t_le_expr, Prolog_term_ref t_n, Prolog_term_ref t_d, Prolog_term_ref t_min)
Prolog_foreign_return_type ppl_Polyhedron_minimize_with_point (Prolog_term_ref t_ph, Prolog_term_ref t_le_expr, Prolog_term_ref t_n, Prolog_term_ref t_d, Prolog_term_ref t_min, Prolog_term_ref t_g)
Prolog_foreign_return_type ppl_Polyhedron_is_topologically_closed (Prolog_term_ref t_ph)
Prolog_foreign_return_type ppl_Polyhedron_topological_closure_assign (Prolog_term_ref t_ph)
Prolog_foreign_return_type ppl_Polyhedron_contains_Polyhedron (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs)
Prolog_foreign_return_type ppl_Polyhedron_strictly_contains_Polyhedron (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs)
Prolog_foreign_return_type ppl_Polyhedron_is_disjoint_from_Polyhedron (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs)
Prolog_foreign_return_type ppl_Polyhedron_equals_Polyhedron (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs)
Prolog_foreign_return_type ppl_Polyhedron_OK (Prolog_term_ref t_ph)
Prolog_foreign_return_type ppl_Polyhedron_add_constraint (Prolog_term_ref t_ph, Prolog_term_ref t_c)
Prolog_foreign_return_type ppl_Polyhedron_add_constraint_and_minimize (Prolog_term_ref t_ph, Prolog_term_ref t_c)
Prolog_foreign_return_type ppl_Polyhedron_add_generator (Prolog_term_ref t_ph, Prolog_term_ref t_g)
Prolog_foreign_return_type ppl_Polyhedron_add_generator_and_minimize (Prolog_term_ref t_ph, Prolog_term_ref t_g)
Prolog_foreign_return_type ppl_Polyhedron_add_constraints (Prolog_term_ref t_ph, Prolog_term_ref t_clist)
Prolog_foreign_return_type ppl_Polyhedron_add_constraints_and_minimize (Prolog_term_ref t_ph, Prolog_term_ref t_clist)
Prolog_foreign_return_type ppl_Polyhedron_add_generators (Prolog_term_ref t_ph, Prolog_term_ref t_glist)
Prolog_foreign_return_type ppl_Polyhedron_add_generators_and_minimize (Prolog_term_ref t_ph, Prolog_term_ref t_glist)
Prolog_foreign_return_type bop_assign (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs, void(Polyhedron::*bop_assign)(const Polyhedron &))
Prolog_foreign_return_type bop_assign_and_minimize (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs, bool(Polyhedron::*bop_assign_and_minimize)(const Polyhedron &))
Prolog_foreign_return_type ppl_Polyhedron_intersection_assign (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs)
Prolog_foreign_return_type ppl_Polyhedron_intersection_assign_and_minimize (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs)
Prolog_foreign_return_type ppl_Polyhedron_poly_hull_assign (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs)
Prolog_foreign_return_type ppl_Polyhedron_poly_hull_assign_and_minimize (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs)
Prolog_foreign_return_type ppl_Polyhedron_poly_difference_assign (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs)
Prolog_foreign_return_type ppl_Polyhedron_time_elapse_assign (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs)
Prolog_foreign_return_type ppl_Polyhedron_affine_image (Prolog_term_ref t_ph, Prolog_term_ref t_v, Prolog_term_ref t_le, Prolog_term_ref t_d)
Prolog_foreign_return_type ppl_Polyhedron_affine_preimage (Prolog_term_ref t_ph, Prolog_term_ref t_v, Prolog_term_ref t_le, Prolog_term_ref t_d)
Prolog_atom term_to_relation (Prolog_term_ref t)
Relation_Symbol term_to_relation_symbol (Prolog_term_ref t_r)
Prolog_foreign_return_type ppl_Polyhedron_generalized_affine_image (Prolog_term_ref t_ph, Prolog_term_ref t_v, Prolog_term_ref t_r, Prolog_term_ref t_le, Prolog_term_ref t_d)
Prolog_foreign_return_type ppl_Polyhedron_generalized_affine_preimage (Prolog_term_ref t_ph, Prolog_term_ref t_v, Prolog_term_ref t_r, Prolog_term_ref t_le, Prolog_term_ref t_d)
Prolog_foreign_return_type ppl_Polyhedron_generalized_affine_image_lhs_rhs (Prolog_term_ref t_ph, Prolog_term_ref t_lhs, Prolog_term_ref t_r, Prolog_term_ref t_rhs)
Prolog_foreign_return_type ppl_Polyhedron_generalized_affine_preimage_lhs_rhs (Prolog_term_ref t_ph, Prolog_term_ref t_lhs, Prolog_term_ref t_r, Prolog_term_ref t_rhs)
Prolog_foreign_return_type ppl_Polyhedron_bounded_affine_image (Prolog_term_ref t_ph, Prolog_term_ref t_v, Prolog_term_ref t_lb_le, Prolog_term_ref t_ub_le, Prolog_term_ref t_d)
Prolog_foreign_return_type ppl_Polyhedron_bounded_affine_preimage (Prolog_term_ref t_ph, Prolog_term_ref t_v, Prolog_term_ref t_lb_le, Prolog_term_ref t_ub_le, Prolog_term_ref t_d)
Prolog_foreign_return_type widening_assign (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs, void(Polyhedron::*widening_assign)(const Polyhedron &, unsigned *tp))
Prolog_foreign_return_type widening_assign_with_tokens (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs, Prolog_term_ref t_ti, Prolog_term_ref t_to, void(Polyhedron::*widening_assign)(const Polyhedron &, unsigned *tp))
Prolog_foreign_return_type widening_assign_with_token (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs, Prolog_term_ref t_t, void(Polyhedron::*widening_assign)(const Polyhedron &, unsigned *tp))
Prolog_foreign_return_type limited_extrapolation_assign (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs, Prolog_term_ref t_clist, void(Polyhedron::*limited_extrap_assign)(const Polyhedron &, const Constraint_System &, unsigned *tp))
Prolog_foreign_return_type limited_extrapolation_assign_with_tokens (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs, Prolog_term_ref t_clist, Prolog_term_ref t_ti, Prolog_term_ref t_to, void(Polyhedron::*limited_extrap_assign)(const Polyhedron &, const Constraint_System &, unsigned *tp))
Prolog_foreign_return_type ppl_Polyhedron_BHRZ03_widening_assign_with_tokens (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs, Prolog_term_ref t_ti, Prolog_term_ref t_to)
Prolog_foreign_return_type ppl_Polyhedron_BHRZ03_widening_assign_with_token (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs, Prolog_term_ref t_t)
Prolog_foreign_return_type ppl_Polyhedron_BHRZ03_widening_assign (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs)
Prolog_foreign_return_type ppl_Polyhedron_limited_BHRZ03_extrapolation_assign_with_tokens (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs, Prolog_term_ref t_clist, Prolog_term_ref t_ti, Prolog_term_ref t_to)
Prolog_foreign_return_type ppl_Polyhedron_limited_BHRZ03_extrapolation_assign (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs, Prolog_term_ref t_clist)
Prolog_foreign_return_type ppl_Polyhedron_bounded_BHRZ03_extrapolation_assign_with_tokens (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs, Prolog_term_ref t_clist, Prolog_term_ref t_ti, Prolog_term_ref t_to)
Prolog_foreign_return_type ppl_Polyhedron_bounded_BHRZ03_extrapolation_assign (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs, Prolog_term_ref t_clist)
Prolog_foreign_return_type ppl_Polyhedron_H79_widening_assign_with_tokens (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs, Prolog_term_ref t_ti, Prolog_term_ref t_to)
Prolog_foreign_return_type ppl_Polyhedron_H79_widening_assign (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs)
Prolog_foreign_return_type ppl_Polyhedron_limited_H79_extrapolation_assign_with_tokens (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs, Prolog_term_ref t_clist, Prolog_term_ref t_ti, Prolog_term_ref t_to)
Prolog_foreign_return_type ppl_Polyhedron_limited_H79_extrapolation_assign (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs, Prolog_term_ref t_clist)
Prolog_foreign_return_type ppl_Polyhedron_bounded_H79_extrapolation_assign_with_tokens (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs, Prolog_term_ref t_clist, Prolog_term_ref t_ti, Prolog_term_ref t_to)
Prolog_foreign_return_type ppl_Polyhedron_bounded_H79_extrapolation_assign (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs, Prolog_term_ref t_clist)
Prolog_foreign_return_type ppl_Polyhedron_add_space_dimensions_and_project (Prolog_term_ref t_ph, Prolog_term_ref t_nnd)
Prolog_foreign_return_type ppl_Polyhedron_add_space_dimensions_and_embed (Prolog_term_ref t_ph, Prolog_term_ref t_nnd)
Prolog_foreign_return_type ppl_Polyhedron_concatenate_assign (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs)
Prolog_foreign_return_type ppl_Polyhedron_remove_space_dimensions (Prolog_term_ref t_ph, Prolog_term_ref t_vlist)
Prolog_foreign_return_type ppl_Polyhedron_remove_higher_space_dimensions (Prolog_term_ref t_ph, Prolog_term_ref t_nd)
Prolog_foreign_return_type ppl_Polyhedron_expand_space_dimension (Prolog_term_ref t_ph, Prolog_term_ref t_v, Prolog_term_ref t_nd)
Prolog_foreign_return_type ppl_Polyhedron_fold_space_dimensions (Prolog_term_ref t_ph, Prolog_term_ref t_vlist, Prolog_term_ref t_v)
Prolog_foreign_return_type ppl_Polyhedron_map_space_dimensions (Prolog_term_ref t_ph, Prolog_term_ref t_pfunc)
Prolog_foreign_return_type ppl_new_LP_Problem_trivial (Prolog_term_ref t_lp)
Prolog_foreign_return_type ppl_new_LP_Problem (Prolog_term_ref t_clist, Prolog_term_ref t_le_expr, Prolog_term_ref t_opt, Prolog_term_ref t_lp)
Prolog_foreign_return_type ppl_new_LP_Problem_from_LP_Problem (Prolog_term_ref t_lp_source, Prolog_term_ref t_lp)
Prolog_foreign_return_type ppl_LP_Problem_swap (Prolog_term_ref t_lhs, Prolog_term_ref t_rhs)
Prolog_foreign_return_type ppl_delete_LP_Problem (Prolog_term_ref t_lp)
Prolog_foreign_return_type ppl_LP_Problem_space_dimension (Prolog_term_ref t_lp, Prolog_term_ref t_sd)
Prolog_foreign_return_type ppl_LP_Problem_constraints (Prolog_term_ref t_lp, Prolog_term_ref t_clist)
Prolog_foreign_return_type ppl_LP_Problem_objective_function (Prolog_term_ref t_lp, Prolog_term_ref t_le_expr)
Prolog_foreign_return_type ppl_LP_Problem_optimization_mode (Prolog_term_ref t_lp, Prolog_term_ref t_opt)
Prolog_foreign_return_type ppl_LP_Problem_clear (Prolog_term_ref t_lp)
Prolog_foreign_return_type ppl_LP_Problem_add_constraint (Prolog_term_ref t_lp, Prolog_term_ref t_c)
Prolog_foreign_return_type ppl_LP_Problem_add_constraints (Prolog_term_ref t_lp, Prolog_term_ref t_clist)
Prolog_foreign_return_type ppl_LP_Problem_set_objective_function (Prolog_term_ref t_lp, Prolog_term_ref t_le_expr)
Prolog_foreign_return_type ppl_LP_Problem_set_optimization_mode (Prolog_term_ref t_lp, Prolog_term_ref t_opt)
Prolog_foreign_return_type ppl_LP_Problem_is_satisfiable (Prolog_term_ref t_lp)
Prolog_foreign_return_type ppl_LP_Problem_solve (Prolog_term_ref t_lp, Prolog_term_ref t_status)
Prolog_foreign_return_type ppl_LP_Problem_feasible_point (Prolog_term_ref t_lp, Prolog_term_ref t_g)
Prolog_foreign_return_type ppl_LP_Problem_optimizing_point (Prolog_term_ref t_lp, Prolog_term_ref t_g)
Prolog_foreign_return_type ppl_LP_Problem_optimal_value (Prolog_term_ref t_lp, Prolog_term_ref t_n, Prolog_term_ref t_d)
Prolog_foreign_return_type ppl_LP_Problem_evaluate_objective_function (Prolog_term_ref t_lp, Prolog_term_ref t_g, Prolog_term_ref t_n, Prolog_term_ref t_d)
Prolog_foreign_return_type ppl_LP_Problem_OK (Prolog_term_ref t_lp)

Variables

Prolog_atom out_of_memory_exception_atom
Prolog_atom a_nil
Prolog_atom a_dollar_VAR
Prolog_atom a_plus
Prolog_atom a_minus
Prolog_atom a_asterisk
Prolog_atom a_slash
Prolog_atom a_less_than
Prolog_atom a_equal_less_than
Prolog_atom a_equal
Prolog_atom a_greater_than_equal
Prolog_atom a_greater_than
Prolog_atom a_line
Prolog_atom a_ray
Prolog_atom a_point
Prolog_atom a_closure_point
Prolog_atom a_is_disjoint
Prolog_atom a_strictly_intersects
Prolog_atom a_is_included
Prolog_atom a_saturates
Prolog_atom a_subsumes
Prolog_atom a_c
Prolog_atom a_empty
Prolog_atom a_universe
Prolog_atom a_max
Prolog_atom a_min
Prolog_atom a_unfeasible
Prolog_atom a_unbounded
Prolog_atom a_optimized
Prolog_atom a_o
Prolog_atom a_i
Prolog_atom a_minf
Prolog_atom a_pinf
Prolog_atom a_polynomial
Prolog_atom a_simplex
Prolog_atom a_any
Prolog_atom a_time_out
Prolog_atom a_out_of_memory
Prolog_atom a_true
Prolog_atom a_false
Prolog_atom a_ppl_invalid_argument
Prolog_atom a_ppl_overflow_error
Prolog_atom a_ppl_domain_error
Prolog_atom a_ppl_length_error
Prolog_atom a_ppl_representation_error
Prolog_atom a_expected
Prolog_atom a_found
Prolog_atom a_where
struct { ... }  prolog_atoms []
Prolog_atom timeout_exception_atom
Parma_Watchdog_Library::Watchdog * p_timeout_object = 0
bool Prolog_interface_initialized = false


Define Documentation

#define CATCH_ALL

Definition at line 567 of file ppl_prolog.icc.


Enumeration Type Documentation

Enumerator:
LOWER 
UPPER 

Definition at line 1525 of file ppl_prolog.icc.

01525                    {
01526   LOWER,
01527   UPPER
01528 };


Function Documentation

Prolog_foreign_return_type @198::bop_assign ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs,
void(Polyhedron::*)(const Polyhedron &)  bop_assign 
) [static]

Definition at line 2428 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, PROLOG_SUCCESS, and term_to_polyhedron_handle().

Referenced by ppl_Polyhedron_intersection_assign(), ppl_Polyhedron_poly_difference_assign(), ppl_Polyhedron_poly_hull_assign(), and ppl_Polyhedron_time_elapse_assign().

02430                                                              {
02431   try {
02432     Polyhedron* lhs = term_to_polyhedron_handle(t_lhs);
02433     const Polyhedron* rhs = term_to_polyhedron_handle(t_rhs);
02434     CHECK(lhs);
02435     CHECK(rhs);
02436     (lhs->*bop_assign)(*rhs);
02437     return PROLOG_SUCCESS;
02438   }
02439   CATCH_ALL;
02440 }

Prolog_foreign_return_type @198::bop_assign_and_minimize ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs,
bool(Polyhedron::*bop_assign_and_minimize)(const Polyhedron &)   
) [static]

Definition at line 2443 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, PROLOG_SUCCESS, and term_to_polyhedron_handle().

Referenced by ppl_Polyhedron_intersection_assign_and_minimize(), and ppl_Polyhedron_poly_hull_assign_and_minimize().

02446                                                                            {
02447   try {
02448     Polyhedron* lhs = term_to_polyhedron_handle(t_lhs);
02449     const Polyhedron* rhs = term_to_polyhedron_handle(t_rhs);
02450     CHECK(lhs);
02451     CHECK(rhs);
02452     if ((lhs->*bop_assign_and_minimize)(*rhs))
02453       return PROLOG_SUCCESS;
02454   }
02455   CATCH_ALL;
02456 }

Constraint @198::build_constraint ( Prolog_term_ref  t  )  [static]

Definition at line 754 of file ppl_prolog.icc.

References build_linear_expression(), integer_term_to_Coefficient(), Prolog_get_arg(), Prolog_get_compound_name_arity(), Prolog_is_compound(), Prolog_is_integer(), and Prolog_new_term_ref().

Referenced by limited_extrapolation_assign(), limited_extrapolation_assign_with_tokens(), ppl_LP_Problem_add_constraint(), ppl_LP_Problem_add_constraints(), ppl_new_C_Polyhedron_from_constraints(), ppl_new_LP_Problem(), ppl_new_NNC_Polyhedron_from_constraints(), ppl_Polyhedron_add_constraint(), ppl_Polyhedron_add_constraint_and_minimize(), ppl_Polyhedron_add_constraints(), ppl_Polyhedron_add_constraints_and_minimize(), and ppl_Polyhedron_relation_with_constraint().

00754                                     {
00755   if (Prolog_is_compound(t)) {
00756     Prolog_atom functor;
00757     int arity;
00758     Prolog_get_compound_name_arity(t, &functor, &arity);
00759     if (arity == 2) {
00760       Prolog_term_ref arg1 = Prolog_new_term_ref();
00761       Prolog_term_ref arg2 = Prolog_new_term_ref();
00762       Prolog_get_arg(1, t, arg1);
00763       Prolog_get_arg(2, t, arg2);
00764       if (functor == a_equal)
00765         // =
00766         if (Prolog_is_integer(arg1))
00767           return integer_term_to_Coefficient(arg1)
00768             == build_linear_expression(arg2);
00769         else if (Prolog_is_integer(arg2))
00770           return build_linear_expression(arg1)
00771             == integer_term_to_Coefficient(arg2);
00772         else
00773           return build_linear_expression(arg1)
00774             == build_linear_expression(arg2);
00775       else if (functor == a_equal_less_than)
00776         // =<
00777         if (Prolog_is_integer(arg1))
00778           return integer_term_to_Coefficient(arg1)
00779             <= build_linear_expression(arg2);
00780         else if (Prolog_is_integer(arg2))
00781           return build_linear_expression(arg1)
00782             <= integer_term_to_Coefficient(arg2);
00783         else
00784           return build_linear_expression(arg1)
00785             <= build_linear_expression(arg2);
00786       else if (functor == a_greater_than_equal)
00787         // >=
00788         if (Prolog_is_integer(arg1))
00789           return integer_term_to_Coefficient(arg1)
00790             >= build_linear_expression(arg2);
00791         else if (Prolog_is_integer(arg2))
00792           return build_linear_expression(arg1)
00793             >= integer_term_to_Coefficient(arg2);
00794         else
00795           return build_linear_expression(arg1)
00796             >= build_linear_expression(arg2);
00797       else if (functor == a_less_than)
00798         // <
00799         if (Prolog_is_integer(arg1))
00800           return integer_term_to_Coefficient(arg1)
00801             < build_linear_expression(arg2);
00802         else if (Prolog_is_integer(arg2))
00803           return build_linear_expression(arg1)
00804             < integer_term_to_Coefficient(arg2);
00805         else
00806           return build_linear_expression(arg1)
00807             < build_linear_expression(arg2);
00808       else if (functor == a_greater_than)
00809         // >
00810         if (Prolog_is_integer(arg1))
00811           return integer_term_to_Coefficient(arg1)
00812             > build_linear_expression(arg2);
00813         else if (Prolog_is_integer(arg2))
00814           return build_linear_expression(arg1)
00815             > integer_term_to_Coefficient(arg2);
00816         else
00817           return build_linear_expression(arg1)
00818             > build_linear_expression(arg2);
00819     }
00820   }
00821   // Invalid.
00822   throw non_linear("build_constraint", t);
00823 }

Generator @198::build_generator ( Prolog_term_ref  t  )  [static]

Definition at line 826 of file ppl_prolog.icc.

References build_linear_expression(), integer_term_to_Coefficient(), Prolog_get_arg(), Prolog_get_compound_name_arity(), Prolog_is_compound(), Prolog_is_integer(), and Prolog_new_term_ref().

Referenced by ppl_LP_Problem_evaluate_objective_function(), ppl_new_C_Polyhedron_from_generators(), ppl_new_NNC_Polyhedron_from_generators(), ppl_Polyhedron_add_generator(), ppl_Polyhedron_add_generator_and_minimize(), ppl_Polyhedron_add_generators(), ppl_Polyhedron_add_generators_and_minimize(), and ppl_Polyhedron_relation_with_generator().

00826                                    {
00827   if (Prolog_is_compound(t)) {
00828     Prolog_atom functor;
00829     int arity;
00830     Prolog_get_compound_name_arity(t, &functor, &arity);
00831     if (arity == 1) {
00832       Prolog_term_ref arg = Prolog_new_term_ref();
00833       Prolog_get_arg(1, t, arg);
00834       if (functor == a_line)
00835         return Generator::line(build_linear_expression(arg));
00836       else if (functor == a_ray)
00837         return Generator::ray(build_linear_expression(arg));
00838       else if (functor == a_point)
00839         return Generator::point(build_linear_expression(arg));
00840       else if (functor == a_closure_point)
00841         return Generator::closure_point(build_linear_expression(arg));
00842     }
00843     else if (arity == 2) {
00844       Prolog_term_ref arg1 = Prolog_new_term_ref();
00845       Prolog_term_ref arg2 = Prolog_new_term_ref();
00846       Prolog_get_arg(1, t, arg1);
00847       Prolog_get_arg(2, t, arg2);
00848       if (Prolog_is_integer(arg2)) {
00849         if (functor == a_point)
00850           return Generator::point(build_linear_expression(arg1),
00851                                   integer_term_to_Coefficient(arg2));
00852         else if (functor == a_closure_point)
00853           return Generator::closure_point(build_linear_expression(arg1),
00854                                           integer_term_to_Coefficient(arg2));
00855       }
00856     }
00857   }
00858   // Invalid.
00859   throw non_linear("build_generator", t);
00860 }

Linear_Expression @198::build_linear_expression ( Prolog_term_ref  t  )  [static]

Definition at line 689 of file ppl_prolog.icc.

References integer_term_to_Coefficient(), Parma_Polyhedra_Library::Linear_Expression::Linear_Expression(), Prolog_get_arg(), Prolog_get_compound_name_arity(), Prolog_is_compound(), Prolog_is_integer(), and Prolog_new_term_ref().

Referenced by build_constraint(), build_generator(), ppl_LP_Problem_set_objective_function(), ppl_new_LP_Problem(), ppl_Polyhedron_affine_image(), ppl_Polyhedron_affine_preimage(), ppl_Polyhedron_bounded_affine_image(), ppl_Polyhedron_bounded_affine_preimage(), ppl_Polyhedron_bounds_from_above(), ppl_Polyhedron_bounds_from_below(), ppl_Polyhedron_generalized_affine_image(), ppl_Polyhedron_generalized_affine_image_lhs_rhs(), ppl_Polyhedron_generalized_affine_preimage(), ppl_Polyhedron_generalized_affine_preimage_lhs_rhs(), ppl_Polyhedron_maximize(), ppl_Polyhedron_maximize_with_point(), ppl_Polyhedron_minimize(), and ppl_Polyhedron_minimize_with_point().

00689                                            {
00690   if (Prolog_is_integer(t))
00691     return Linear_Expression(integer_term_to_Coefficient(t));
00692   else if (Prolog_is_compound(t)) {
00693     Prolog_atom functor;
00694     int arity;
00695     Prolog_get_compound_name_arity(t, &functor, &arity);
00696     switch (arity) {
00697     case 1:
00698       {
00699         Prolog_term_ref arg = Prolog_new_term_ref();
00700         Prolog_get_arg(1, t, arg);
00701         if (functor == a_minus)
00702           // Unary minus.
00703           return -build_linear_expression(arg);
00704         else if (functor == a_dollar_VAR)
00705           // Variable.
00706           return Variable(term_to_unsigned<dimension_type>(arg));
00707       }
00708       break;
00709     case 2:
00710       {
00711         Prolog_term_ref arg1 = Prolog_new_term_ref();
00712         Prolog_term_ref arg2 = Prolog_new_term_ref();
00713         Prolog_get_arg(1, t, arg1);
00714         Prolog_get_arg(2, t, arg2);
00715         if (functor == a_plus)
00716           // Plus.
00717           if (Prolog_is_integer(arg1))
00718             return integer_term_to_Coefficient(arg1)
00719               + build_linear_expression(arg2);
00720           else if (Prolog_is_integer(arg2))
00721             return build_linear_expression(arg1)
00722               + integer_term_to_Coefficient(arg2);
00723           else
00724             return build_linear_expression(arg1)
00725               + build_linear_expression(arg2);
00726         else if (functor == a_minus)
00727           // Minus.
00728           if (Prolog_is_integer(arg1))
00729             return integer_term_to_Coefficient(arg1)
00730               - build_linear_expression(arg2);
00731           else if (Prolog_is_integer(arg2))
00732             return build_linear_expression(arg1)
00733               - integer_term_to_Coefficient(arg2);
00734           else
00735             return build_linear_expression(arg1)
00736               - build_linear_expression(arg2);
00737         else if (functor == a_asterisk)
00738           // Times.
00739           if (Prolog_is_integer(arg1))
00740             return integer_term_to_Coefficient(arg1)
00741               * build_linear_expression(arg2);
00742           else if (Prolog_is_integer(arg2))
00743             return build_linear_expression(arg1)
00744               * integer_term_to_Coefficient(arg2);
00745       }
00746     }
00747   }
00748   // Invalid.
00749   throw non_linear("build_linear_expression", t);
00750 }

void @198::check_nil_terminating ( Prolog_term_ref  t  )  [static]

Prolog_term_ref @198::constraint_term ( const Constraint c  )  [static]

Definition at line 902 of file ppl_prolog.icc.

References Coefficient_to_integer_term(), get_linear_expression(), Parma_Polyhedra_Library::Constraint::inhomogeneous_term(), Prolog_construct_compound(), Prolog_new_term_ref(), and Parma_Polyhedra_Library::Constraint::type().

Referenced by ppl_LP_Problem_constraints(), ppl_Polyhedron_get_constraints(), and ppl_Polyhedron_get_minimized_constraints().

00902                                      {
00903   Prolog_atom relation = 0;
00904   switch (c.type()) {
00905   case Constraint::EQUALITY:
00906     relation = a_equal;
00907     break;
00908   case Constraint::NONSTRICT_INEQUALITY:
00909     relation = a_greater_than_equal;
00910     break;
00911   case Constraint::STRICT_INEQUALITY:
00912     relation = a_greater_than;
00913     break;
00914   default:
00915     throw unknown_interface_error("generator_term()");
00916   }
00917   Prolog_term_ref t = Prolog_new_term_ref();
00918   Prolog_construct_compound
00919     (t,
00920      relation,
00921      get_linear_expression(c),
00922      Coefficient_to_integer_term(-c.inhomogeneous_term()));
00923   return t;
00924 }

Prolog_term_ref @198::extended_rational_term ( const ERational e  )  [static]

Definition at line 1940 of file ppl_prolog.icc.

References Coefficient_to_integer_term(), Parma_Polyhedra_Library::is_minus_infinity(), Parma_Polyhedra_Library::is_plus_infinity(), Prolog_construct_compound(), Prolog_new_term_ref(), Prolog_put_atom(), Prolog_put_term(), and Parma_Polyhedra_Library::Checked_Number< T, Policy >::raw_value().

Referenced by interval_term().

01940                                            {
01941   Prolog_term_ref t = Prolog_new_term_ref();
01942   if (is_plus_infinity(e))
01943     Prolog_put_atom(t, a_pinf);
01944   else if (is_minus_infinity(e))
01945     Prolog_put_atom(t, a_minf);
01946   else {
01947     Coefficient numerator = raw_value(e).get_num();
01948     Coefficient denominator = raw_value(e).get_den();
01949     if (denominator == 1)
01950       Prolog_put_term(t, Coefficient_to_integer_term(numerator));
01951     else
01952       Prolog_construct_compound(t, a_slash,
01953                                 Coefficient_to_integer_term(numerator),
01954                                 Coefficient_to_integer_term(denominator));
01955   }
01956   return t;
01957 }

Prolog_term_ref @198::generator_term ( const Generator g  )  [static]

Definition at line 927 of file ppl_prolog.icc.

References Coefficient_to_integer_term(), Parma_Polyhedra_Library::Generator::divisor(), get_linear_expression(), Prolog_construct_compound(), Prolog_new_term_ref(), and Parma_Polyhedra_Library::Generator::type().

Referenced by ppl_LP_Problem_feasible_point(), ppl_LP_Problem_optimizing_point(), ppl_Polyhedron_get_generators(), ppl_Polyhedron_get_minimized_generators(), ppl_Polyhedron_maximize_with_point(), and ppl_Polyhedron_minimize_with_point().

00927                                    {
00928   Prolog_term_ref t = Prolog_new_term_ref();
00929   Prolog_atom constructor = 0;
00930   switch (g.type()) {
00931   case Generator::LINE:
00932     constructor = a_line;
00933     break;
00934   case Generator::RAY:
00935     constructor = a_ray;
00936     break;
00937   case Generator::POINT:
00938     {
00939       constructor = a_point;
00940       const Coefficient& divisor = g.divisor();
00941       if (divisor == 1)
00942         break;
00943       else {
00944         Prolog_construct_compound(t, constructor,
00945                                   get_linear_expression(g),
00946                                   Coefficient_to_integer_term(divisor));
00947         return t;
00948       }
00949     }
00950   case Generator::CLOSURE_POINT:
00951     {
00952       constructor = a_closure_point;
00953       const Coefficient& divisor = g.divisor();
00954       if (divisor == 1)
00955         break;
00956       else {
00957         Prolog_construct_compound(t, constructor,
00958                                   get_linear_expression(g),
00959                                   Coefficient_to_integer_term(divisor));
00960         return t;
00961       }
00962     }
00963   default:
00964     throw unknown_interface_error("generator_term()");
00965   }
00966   Prolog_construct_compound(t, constructor, get_linear_expression(g));
00967   return t;
00968 }

template<typename R>
Prolog_term_ref @198::get_linear_expression ( const R &  r  )  [inline, static]

Definition at line 864 of file ppl_prolog.icc.

References Coefficient_to_integer_term(), Prolog_construct_compound(), Prolog_new_term_ref(), Prolog_put_long(), and variable_term().

Referenced by constraint_term(), generator_term(), and ppl_LP_Problem_objective_function().

00864                                   {
00865   Prolog_term_ref so_far = Prolog_new_term_ref();
00866   Coefficient coefficient;
00867   dimension_type varid = 0;
00868   dimension_type space_dimension = r.space_dimension();
00869   while (varid < space_dimension
00870          && (coefficient = r.coefficient(Variable(varid))) == 0)
00871     ++varid;
00872   if (varid >= space_dimension) {
00873     Prolog_put_long(so_far, 0);
00874   }
00875   else {
00876     Prolog_construct_compound(so_far, a_asterisk,
00877                               Coefficient_to_integer_term(coefficient),
00878                               variable_term(varid));
00879     while (true) {
00880       ++varid;
00881       while (varid < space_dimension
00882              && (coefficient = r.coefficient(Variable(varid))) == 0)
00883         ++varid;
00884       if (varid >= space_dimension)
00885         break;
00886       else {
00887         Prolog_term_ref addendum = Prolog_new_term_ref();
00888         Prolog_construct_compound(addendum, a_asterisk,
00889                                   Coefficient_to_integer_term(coefficient),
00890                                   variable_term(varid));
00891         Prolog_term_ref new_so_far = Prolog_new_term_ref();
00892         Prolog_construct_compound(new_so_far, a_plus,
00893                                   so_far, addendum);
00894         so_far = new_so_far;
00895       }
00896     }
00897   }
00898   return so_far;
00899 }

void @198::handle_exception ( const timeout_exception &   )  [static]

void @198::handle_exception (  )  [static]

Definition at line 527 of file ppl_prolog.icc.

References Prolog_new_term_ref(), Prolog_put_atom_chars(), and Prolog_raise_exception().

00527                    {
00528   Prolog_term_ref et = Prolog_new_term_ref();
00529   Prolog_put_atom_chars(et, "PPL bug: unknown exception raised");
00530   Prolog_raise_exception(et);
00531 }

void @198::handle_exception ( const std::exception &  e  )  [static]

Definition at line 520 of file ppl_prolog.icc.

References Prolog_new_term_ref(), Prolog_put_atom_chars(), and Prolog_raise_exception().

00520                                         {
00521   Prolog_term_ref et = Prolog_new_term_ref();
00522   Prolog_put_atom_chars(et, e.what());
00523   Prolog_raise_exception(et);
00524 }

void @198::handle_exception ( const std::bad_alloc &   )  [static]

void @198::handle_exception ( const std::length_error &  e  )  [static]

void @198::handle_exception ( const std::overflow_error &  e  )  [static]

void @198::handle_exception ( const unknown_interface_error e  )  [static]

void @198::handle_exception ( const PPL_integer_out_of_range e  )  [static]

Definition at line 474 of file ppl_prolog.icc.

References PPL_integer_out_of_range::i(), Prolog_atom_term_from_string(), Prolog_construct_compound(), Prolog_new_term_ref(), and Prolog_raise_exception().

00474                                                     {
00475   Prolog_term_ref where = Prolog_new_term_ref();
00476   Prolog_construct_compound(where, a_where,
00477                             Prolog_atom_term_from_string
00478                             ("Coefficient_to_integer_term"));
00479 
00480   Prolog_term_ref exception_term = Prolog_new_term_ref();
00481   std::ostringstream s;
00482   s << e.i();
00483   Prolog_construct_compound(exception_term, a_ppl_representation_error,
00484                             Prolog_atom_term_from_string(s.str().c_str()),
00485                             where);
00486   Prolog_raise_exception(exception_term);
00487 }

void @198::handle_exception ( const not_a_nil_terminated_list e  )  [static]

Definition at line 452 of file ppl_prolog.icc.

References Prolog_atom_term_from_string(), Prolog_construct_compound(), Prolog_construct_cons(), Prolog_new_term_ref(), Prolog_put_atom(), Prolog_raise_exception(), and internal_exception::term().

00452                                                      {
00453   Prolog_term_ref found = Prolog_new_term_ref();
00454   Prolog_construct_compound(found, a_found, e.term());
00455 
00456   Prolog_term_ref expected = Prolog_new_term_ref();
00457   Prolog_put_atom(expected, a_nil);
00458   Prolog_construct_cons(expected,
00459                         Prolog_atom_term_from_string
00460                         ("Prolog_list"), expected);
00461   Prolog_construct_compound(expected, a_expected, expected);
00462 
00463   Prolog_term_ref where = Prolog_new_term_ref();
00464   Prolog_construct_compound(where, a_where,
00465                             Prolog_atom_term_from_string
00466                             ("check_nil_terminating"));
00467   Prolog_term_ref exception_term = Prolog_new_term_ref();
00468   Prolog_construct_compound(exception_term, a_ppl_invalid_argument,
00469                             found, expected, where);
00470   Prolog_raise_exception(exception_term);
00471 }

void @198::handle_exception ( const not_a_relation e  )  [static]

Definition at line 423 of file ppl_prolog.icc.

References Prolog_atom_term_from_string(), Prolog_construct_compound(), Prolog_construct_cons(), Prolog_new_term_ref(), Prolog_put_atom(), Prolog_raise_exception(), and internal_exception::term().

00423                                           {
00424   Prolog_term_ref found = Prolog_new_term_ref();
00425   Prolog_construct_compound(found, a_found, e.term());
00426 
00427   Prolog_term_ref expected = Prolog_new_term_ref();
00428   Prolog_put_atom(expected, a_nil);
00429   Prolog_construct_cons(expected,
00430                         Prolog_atom_term_from_string("="), expected);
00431   Prolog_construct_cons(expected,
00432                         Prolog_atom_term_from_string(">="), expected);
00433   Prolog_construct_cons(expected,
00434                         Prolog_atom_term_from_string("=<"), expected);
00435   Prolog_construct_cons(expected,
00436                         Prolog_atom_term_from_string(">"), expected);
00437   Prolog_construct_cons(expected,
00438                         Prolog_atom_term_from_string("<"), expected);
00439   Prolog_construct_compound(expected, a_expected, expected);
00440 
00441   Prolog_term_ref where = Prolog_new_term_ref();
00442   Prolog_construct_compound(where, a_where,
00443                             Prolog_atom_term_from_string
00444                             ("term_to_relation"));
00445   Prolog_term_ref exception_term = Prolog_new_term_ref();
00446   Prolog_construct_compound(exception_term, a_ppl_invalid_argument,
00447                             found, expected, where);
00448   Prolog_raise_exception(exception_term);
00449 }

void @198::handle_exception ( const not_universe_or_empty e  )  [static]

Definition at line 400 of file ppl_prolog.icc.

References Prolog_atom_term_from_string(), Prolog_construct_compound(), Prolog_construct_cons(), Prolog_new_term_ref(), Prolog_put_atom(), Prolog_raise_exception(), and internal_exception::term().

00400                                                  {
00401   Prolog_term_ref found = Prolog_new_term_ref();
00402   Prolog_construct_compound(found, a_found, e.term());
00403 
00404   Prolog_term_ref expected = Prolog_new_term_ref();
00405   Prolog_put_atom(expected, a_nil);
00406   Prolog_construct_cons(expected,
00407                         Prolog_atom_term_from_string("universe"), expected);
00408   Prolog_construct_cons(expected,
00409                         Prolog_atom_term_from_string("empty"), expected);
00410   Prolog_construct_compound(expected, a_expected, expected);
00411 
00412   Prolog_term_ref where = Prolog_new_term_ref();
00413   Prolog_construct_compound(where, a_where,
00414                             Prolog_atom_term_from_string
00415                             ("term_to_universe_or_empty"));
00416   Prolog_term_ref exception_term = Prolog_new_term_ref();
00417   Prolog_construct_compound(exception_term, a_ppl_invalid_argument,
00418                             found, expected, where);
00419   Prolog_raise_exception(exception_term);
00420 }

void @198::handle_exception ( const not_a_complexity_class e  )  [static]

Definition at line 375 of file ppl_prolog.icc.

References Prolog_atom_term_from_string(), Prolog_construct_compound(), Prolog_construct_cons(), Prolog_new_term_ref(), Prolog_put_atom(), Prolog_raise_exception(), and internal_exception::term().

00375                                                   {
00376   Prolog_term_ref found = Prolog_new_term_ref();
00377   Prolog_construct_compound(found, a_found, e.term());
00378 
00379   Prolog_term_ref expected = Prolog_new_term_ref();
00380   Prolog_put_atom(expected, a_nil);
00381   Prolog_construct_cons(expected,
00382                         Prolog_atom_term_from_string("polynomial"), expected);
00383   Prolog_construct_cons(expected,
00384                         Prolog_atom_term_from_string("simplex"), expected);
00385   Prolog_construct_cons(expected,
00386                         Prolog_atom_term_from_string("any"), expected);
00387   Prolog_construct_compound(expected, a_expected, expected);
00388 
00389   Prolog_term_ref where = Prolog_new_term_ref();
00390   Prolog_construct_compound(where, a_where,
00391                             Prolog_atom_term_from_string
00392                             ("term_to_complexity_class"));
00393   Prolog_term_ref exception_term = Prolog_new_term_ref();
00394   Prolog_construct_compound(exception_term, a_ppl_invalid_argument,
00395                             found, expected, where);
00396   Prolog_raise_exception(exception_term);
00397 }

void @198::handle_exception ( const not_an_lp_problem_handle e  )  [static]

Definition at line 355 of file ppl_prolog.icc.

References Prolog_atom_term_from_string(), Prolog_construct_compound(), Prolog_new_term_ref(), Prolog_raise_exception(), and internal_exception::term().

00355                                                     {
00356   Prolog_term_ref found = Prolog_new_term_ref();
00357   Prolog_construct_compound(found, a_found, e.term());
00358 
00359   Prolog_term_ref expected = Prolog_new_term_ref();
00360   Prolog_construct_compound(expected, a_expected,
00361                             Prolog_atom_term_from_string("lp_problem_handle"));
00362 
00363   Prolog_term_ref where = Prolog_new_term_ref();
00364   Prolog_construct_compound(where, a_where,
00365                             Prolog_atom_term_from_string
00366                             ("term_to_lp_problem_handle"));
00367 
00368   Prolog_term_ref exception_term = Prolog_new_term_ref();
00369   Prolog_construct_compound(exception_term, a_ppl_invalid_argument,
00370                             found, expected, where);
00371   Prolog_raise_exception(exception_term);
00372 }

void @198::handle_exception ( const not_an_optimization_mode e  )  [static]

Definition at line 332 of file ppl_prolog.icc.

References Prolog_atom_term_from_string(), Prolog_construct_compound(), Prolog_construct_cons(), Prolog_new_term_ref(), Prolog_put_atom(), Prolog_raise_exception(), and internal_exception::term().

00332                                                     {
00333   Prolog_term_ref found = Prolog_new_term_ref();
00334   Prolog_construct_compound(found, a_found, e.term());
00335 
00336   Prolog_term_ref expected = Prolog_new_term_ref();
00337   Prolog_put_atom(expected, a_nil);
00338   Prolog_construct_cons(expected,
00339                         Prolog_atom_term_from_string("max"), expected);
00340   Prolog_construct_cons(expected,
00341                         Prolog_atom_term_from_string("min"), expected);
00342   Prolog_construct_compound(expected, a_expected, expected);
00343 
00344   Prolog_term_ref where = Prolog_new_term_ref();
00345   Prolog_construct_compound(where, a_where,
00346                             Prolog_atom_term_from_string
00347                             ("term_to_optimization_mode"));
00348   Prolog_term_ref exception_term = Prolog_new_term_ref();
00349   Prolog_construct_compound(exception_term, a_ppl_invalid_argument,
00350                             found, expected, where);
00351   Prolog_raise_exception(exception_term);
00352 }

void @198::handle_exception ( const not_a_polyhedron_handle e  )  [static]

Definition at line 312 of file ppl_prolog.icc.

References Prolog_atom_term_from_string(), Prolog_construct_compound(), Prolog_new_term_ref(), Prolog_raise_exception(), and internal_exception::term().

00312                                                    {
00313   Prolog_term_ref found = Prolog_new_term_ref();
00314   Prolog_construct_compound(found, a_found, e.term());
00315 
00316   Prolog_term_ref expected = Prolog_new_term_ref();
00317   Prolog_construct_compound(expected, a_expected,
00318                             Prolog_atom_term_from_string("polyhedron_handle"));
00319 
00320   Prolog_term_ref where = Prolog_new_term_ref();
00321   Prolog_construct_compound(where, a_where,
00322                             Prolog_atom_term_from_string
00323                             ("term_to_polyhedron_handle"));
00324 
00325   Prolog_term_ref exception_term = Prolog_new_term_ref();
00326   Prolog_construct_compound(exception_term, a_ppl_invalid_argument,
00327                             found, expected, where);
00328   Prolog_raise_exception(exception_term);
00329 }

void @198::handle_exception ( const not_an_integer e  )  [static]

Definition at line 292 of file ppl_prolog.icc.

References Prolog_atom_term_from_string(), Prolog_construct_compound(), Prolog_new_term_ref(), Prolog_raise_exception(), and internal_exception::term().

00292                                           {
00293   Prolog_term_ref found = Prolog_new_term_ref();
00294   Prolog_construct_compound(found, a_found, e.term());
00295 
00296   Prolog_term_ref expected = Prolog_new_term_ref();
00297   Prolog_construct_compound(expected, a_expected,
00298                             Prolog_atom_term_from_string("integer"));
00299 
00300   Prolog_term_ref where = Prolog_new_term_ref();
00301   Prolog_construct_compound(where, a_where,
00302                             Prolog_atom_term_from_string
00303                             ("term_to_Coefficient"));
00304 
00305   Prolog_term_ref exception_term = Prolog_new_term_ref();
00306   Prolog_construct_compound(exception_term, a_ppl_invalid_argument,
00307                             found, expected, where);
00308   Prolog_raise_exception(exception_term);
00309 }

void @198::handle_exception ( const not_a_variable e  )  [static]

Definition at line 271 of file ppl_prolog.icc.

References Prolog_atom_term_from_string(), Prolog_construct_compound(), Prolog_new_term_ref(), Prolog_raise_exception(), and internal_exception::term().

00271                                           {
00272   Prolog_term_ref found = Prolog_new_term_ref();
00273   Prolog_construct_compound(found, a_found,
00274                             e.term());
00275 
00276   Prolog_term_ref expected = Prolog_new_term_ref();
00277   Prolog_construct_compound(expected, a_expected,
00278                             Prolog_atom_term_from_string
00279                             ("$VAR(unsigned_integer)"));
00280 
00281   Prolog_term_ref where = Prolog_new_term_ref();
00282   Prolog_construct_compound(where, a_where,
00283                             Prolog_atom_term_from_string("term_to_Variable"));
00284 
00285   Prolog_term_ref exception_term = Prolog_new_term_ref();
00286   Prolog_construct_compound(exception_term, a_ppl_invalid_argument,
00287                             found, expected, where);
00288   Prolog_raise_exception(exception_term);
00289 }

void @198::handle_exception ( const non_linear e  )  [static]

Definition at line 251 of file ppl_prolog.icc.

References Prolog_atom_term_from_string(), Prolog_construct_compound(), Prolog_new_term_ref(), Prolog_raise_exception(), internal_exception::term(), and non_linear::where().

00251                                       {
00252   Prolog_term_ref found = Prolog_new_term_ref();
00253   Prolog_construct_compound(found, a_found, e.term());
00254 
00255   Prolog_term_ref expected = Prolog_new_term_ref();
00256   Prolog_construct_compound(expected, a_expected,
00257                             Prolog_atom_term_from_string
00258                             ("linear_expression_or_constraint"));
00259 
00260   Prolog_term_ref where = Prolog_new_term_ref();
00261   Prolog_construct_compound(where, a_where,
00262                             Prolog_atom_term_from_string(e.where()));
00263 
00264   Prolog_term_ref exception_term = Prolog_new_term_ref();
00265   Prolog_construct_compound(exception_term, a_ppl_invalid_argument,
00266                             found, expected, where);
00267   Prolog_raise_exception(exception_term);
00268 }

void @198::handle_exception ( const not_unsigned_integer e  )  [static]

Definition at line 232 of file ppl_prolog.icc.

References Prolog_atom_term_from_string(), Prolog_construct_compound(), Prolog_new_term_ref(), Prolog_raise_exception(), and internal_exception::term().

00232                                                 {
00233   Prolog_term_ref found = Prolog_new_term_ref();
00234   Prolog_construct_compound(found, a_found, e.term());
00235 
00236   Prolog_term_ref expected = Prolog_new_term_ref();
00237   Prolog_construct_compound(expected, a_expected,
00238                             Prolog_atom_term_from_string("unsigned_integer"));
00239 
00240   Prolog_term_ref where = Prolog_new_term_ref();
00241   Prolog_construct_compound(where, a_where,
00242                             Prolog_atom_term_from_string("term_to_unsigned"));
00243 
00244   Prolog_term_ref exception_term = Prolog_new_term_ref();
00245   Prolog_construct_compound(exception_term, a_ppl_invalid_argument,
00246                             found, expected, where);
00247   Prolog_raise_exception(exception_term);
00248 }

void @198::handle_exception ( const Prolog_unsigned_out_of_range e  )  [static]

Definition at line 208 of file ppl_prolog.icc.

References Prolog_unsigned_out_of_range::max(), Prolog_atom_from_string(), Prolog_atom_term_from_string(), Prolog_construct_compound(), Prolog_new_term_ref(), Prolog_put_ulong(), Prolog_raise_exception(), and internal_exception::term().

00208                                                         {
00209   Prolog_term_ref found = Prolog_new_term_ref();
00210   Prolog_construct_compound(found, a_found, e.term());
00211 
00212   Prolog_term_ref max = Prolog_new_term_ref();
00213   Prolog_put_ulong(max, e.max());
00214   Prolog_construct_compound(max,
00215                             Prolog_atom_from_string("unsigned_integer"
00216                                                     "_less_than_or_equal_to"),
00217                             max);
00218   Prolog_term_ref expected = Prolog_new_term_ref();
00219   Prolog_construct_compound(expected, a_expected, max);
00220 
00221   Prolog_term_ref where = Prolog_new_term_ref();
00222   Prolog_construct_compound(where, a_where,
00223                             Prolog_atom_term_from_string("term_to_unsigned"));
00224 
00225   Prolog_term_ref exception_term = Prolog_new_term_ref();
00226   Prolog_construct_compound(exception_term, a_ppl_invalid_argument,
00227                             found, expected, where);
00228   Prolog_raise_exception(exception_term);
00229 }

Prolog_term_ref @198::interval_term ( const Interval i  )  [static]

Prolog_foreign_return_type @198::limited_extrapolation_assign ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs,
Prolog_term_ref  t_clist,
void(Polyhedron::*limited_extrap_assign)(const Polyhedron &,const Constraint_System &,unsigned *tp)   
) [static]

Definition at line 2732 of file ppl_prolog.icc.

References build_constraint(), CATCH_ALL, CHECK, check_nil_terminating(), Parma_Polyhedra_Library::Constraint_System::insert(), Prolog_get_cons(), Prolog_is_cons(), Prolog_new_term_ref(), PROLOG_SUCCESS, and term_to_polyhedron_handle().

Referenced by ppl_Polyhedron_bounded_BHRZ03_extrapolation_assign(), ppl_Polyhedron_bounded_H79_extrapolation_assign(), ppl_Polyhedron_limited_BHRZ03_extrapolation_assign(), and ppl_Polyhedron_limited_H79_extrapolation_assign().

02738                                                                      {
02739   try {
02740     Polyhedron* lhs = term_to_polyhedron_handle(t_lhs);
02741     const Polyhedron* rhs = term_to_polyhedron_handle(t_rhs);
02742     CHECK(lhs);
02743     CHECK(rhs);
02744     Constraint_System cs;
02745     Prolog_term_ref c = Prolog_new_term_ref();
02746 
02747     while (Prolog_is_cons(t_clist)) {
02748       Prolog_get_cons(t_clist, c, t_clist);
02749       cs.insert(build_constraint(c));
02750     }
02751 
02752     // Check the list is properly terminated.
02753     check_nil_terminating(t_clist);
02754 
02755     (lhs->*limited_extrap_assign)(*rhs, cs, 0);
02756     return PROLOG_SUCCESS;
02757   }
02758   CATCH_ALL;
02759 }

Prolog_foreign_return_type @198::limited_extrapolation_assign_with_tokens ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs,
Prolog_term_ref  t_clist,
Prolog_term_ref  t_ti,
Prolog_term_ref  t_to,
void(Polyhedron::*limited_extrap_assign)(const Polyhedron &,const Constraint_System &,unsigned *tp)   
) [static]

Definition at line 2762 of file ppl_prolog.icc.

References build_constraint(), CATCH_ALL, CHECK, check_nil_terminating(), Parma_Polyhedra_Library::Constraint_System::insert(), Prolog_get_cons(), Prolog_is_cons(), Prolog_new_term_ref(), PROLOG_SUCCESS, term_to_polyhedron_handle(), and unify_long().

Referenced by ppl_Polyhedron_bounded_BHRZ03_extrapolation_assign_with_tokens(), ppl_Polyhedron_bounded_H79_extrapolation_assign_with_tokens(), ppl_Polyhedron_limited_BHRZ03_extrapolation_assign_with_tokens(), and ppl_Polyhedron_limited_H79_extrapolation_assign_with_tokens().

02770                                                                      {
02771   try {
02772     Polyhedron* lhs = term_to_polyhedron_handle(t_lhs);
02773     const Polyhedron* rhs = term_to_polyhedron_handle(t_rhs);
02774     CHECK(lhs);
02775     CHECK(rhs);
02776     Constraint_System cs;
02777     Prolog_term_ref c = Prolog_new_term_ref();
02778 
02779     while (Prolog_is_cons(t_clist)) {
02780       Prolog_get_cons(t_clist, c, t_clist);
02781       cs.insert(build_constraint(c));
02782     }
02783 
02784     // Check the list is properly terminated.
02785     check_nil_terminating(t_clist);
02786 
02787     unsigned t = term_to_unsigned<unsigned>(t_ti);
02788    (lhs->*limited_extrap_assign)(*rhs, cs, &t);
02789       if (unify_long(t_to, t))
02790       return PROLOG_SUCCESS;
02791   }
02792   CATCH_ALL;
02793 }

dimension_type @198::max_representable_dimension ( dimension_type  d  )  [inline, static]

Definition at line 1112 of file ppl_prolog.icc.

References Prolog_has_unbounded_integers, and Prolog_max_integer.

Referenced by ppl_max_space_dimension().

01112                                               {
01113   return
01114     Prolog_has_unbounded_integers
01115     ? d
01116     : std::min(d, static_cast<dimension_type>(Prolog_max_integer));
01117 }

Prolog_foreign_return_type ppl_banner ( Prolog_term_ref  t_b  ) 

Definition at line 1099 of file ppl_prolog.icc.

References Parma_Polyhedra_Library::banner(), CATCH_ALL, Prolog_new_term_ref(), Prolog_put_atom_chars(), PROLOG_SUCCESS, and Prolog_unify().

01099                                 {
01100   try {
01101     Prolog_term_ref tmp = Prolog_new_term_ref();
01102     Prolog_put_atom_chars(tmp, banner());
01103     if (Prolog_unify(t_b, tmp))
01104       return PROLOG_SUCCESS;
01105   }
01106   CATCH_ALL;
01107 }

Prolog_foreign_return_type ppl_Coefficient_max ( Prolog_term_ref  t_max  ) 

Definition at line 1253 of file ppl_prolog.icc.

References CATCH_ALL, Coefficient_to_integer_term(), Prolog_has_unbounded_integers, Prolog_min_integer, and Prolog_unify().

01253                                            {
01254   try {
01255     if (std::numeric_limits<Coefficient>::is_bounded) {
01256       Coefficient max = std::numeric_limits<Coefficient>::max();
01257       if (Prolog_has_unbounded_integers
01258           || (max >= Prolog_min_integer && max <= Prolog_min_integer))
01259         return Prolog_unify(t_max, Coefficient_to_integer_term(max));
01260     }
01261   }
01262   CATCH_ALL;
01263 }

Prolog_foreign_return_type ppl_Coefficient_min ( Prolog_term_ref  t_min  ) 

Definition at line 1240 of file ppl_prolog.icc.

References CATCH_ALL, Coefficient_to_integer_term(), Prolog_has_unbounded_integers, Prolog_min_integer, and Prolog_unify().

01240                                            {
01241   try {
01242     if (std::numeric_limits<Coefficient>::is_bounded) {
01243       Coefficient min = std::numeric_limits<Coefficient>::min();
01244       if (Prolog_has_unbounded_integers
01245           || (min >= Prolog_min_integer && min <= Prolog_min_integer))
01246         return Prolog_unify(t_min, Coefficient_to_integer_term(min));
01247     }
01248   }
01249   CATCH_ALL;
01250 }

Prolog_foreign_return_type ppl_delete_LP_Problem ( Prolog_term_ref  t_lp  ) 

Definition at line 3228 of file ppl_prolog.icc.

References CATCH_ALL, PROLOG_SUCCESS, term_to_lp_problem_handle(), and UNREGISTER.

03228                                             {
03229   try {
03230     const LP_Problem* lp = term_to_lp_problem_handle(t_lp);
03231     UNREGISTER(lp);
03232     delete lp;
03233     return PROLOG_SUCCESS;
03234   }
03235   CATCH_ALL;
03236 }

Prolog_foreign_return_type ppl_delete_Polyhedron ( Prolog_term_ref  t_ph  ) 

Definition at line 1757 of file ppl_prolog.icc.

References CATCH_ALL, PROLOG_SUCCESS, term_to_polyhedron_handle(), and UNREGISTER.

01757                                             {
01758   try {
01759     const Polyhedron* ph = term_to_polyhedron_handle(t_ph);
01760     UNREGISTER(ph);
01761     delete ph;
01762     return PROLOG_SUCCESS;
01763   }
01764   CATCH_ALL;
01765 }

Prolog_foreign_return_type ppl_LP_Problem_add_constraint ( Prolog_term_ref  t_lp,
Prolog_term_ref  t_c 
)

Definition at line 3314 of file ppl_prolog.icc.

References Parma_Polyhedra_Library::LP_Problem::add_constraint(), build_constraint(), CATCH_ALL, CHECK, PROLOG_SUCCESS, and term_to_lp_problem_handle().

03314                                                                          {
03315   try {
03316     LP_Problem* lp = term_to_lp_problem_handle(t_lp);
03317     CHECK(lp);
03318     lp->add_constraint(build_constraint(t_c));
03319     return PROLOG_SUCCESS;
03320   }
03321   CATCH_ALL;
03322 }

Prolog_foreign_return_type ppl_LP_Problem_add_constraints ( Prolog_term_ref  t_lp,
Prolog_term_ref  t_clist 
)

Definition at line 3325 of file ppl_prolog.icc.

References Parma_Polyhedra_Library::LP_Problem::add_constraints(), build_constraint(), CATCH_ALL, CHECK, check_nil_terminating(), Parma_Polyhedra_Library::Constraint_System::insert(), Prolog_get_cons(), Prolog_is_cons(), Prolog_new_term_ref(), PROLOG_SUCCESS, and term_to_lp_problem_handle().

03326                                                         {
03327   try {
03328     LP_Problem* lp = term_to_lp_problem_handle(t_lp);
03329     CHECK(lp);
03330     Constraint_System cs;
03331     Prolog_term_ref c = Prolog_new_term_ref();
03332 
03333     while (Prolog_is_cons(t_clist)) {
03334       Prolog_get_cons(t_clist, c, t_clist);
03335       cs.insert(build_constraint(c));
03336     }
03337 
03338     // Check the list is properly terminated.
03339     check_nil_terminating(t_clist);
03340 
03341     lp->add_constraints(cs);
03342     return PROLOG_SUCCESS;
03343   }
03344   CATCH_ALL;
03345 }

Prolog_foreign_return_type ppl_LP_Problem_clear ( Prolog_term_ref  t_lp  ) 

Definition at line 3303 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, Parma_Polyhedra_Library::LP_Problem::clear(), PROLOG_SUCCESS, and term_to_lp_problem_handle().

03303                                            {
03304   try {
03305     LP_Problem* lp = term_to_lp_problem_handle(t_lp);
03306     CHECK(lp);
03307     lp->clear();
03308     return PROLOG_SUCCESS;
03309   }
03310   CATCH_ALL;
03311 }

Prolog_foreign_return_type ppl_LP_Problem_constraints ( Prolog_term_ref  t_lp,
Prolog_term_ref  t_clist 
)

Prolog_foreign_return_type ppl_LP_Problem_evaluate_objective_function ( Prolog_term_ref  t_lp,
Prolog_term_ref  t_g,
Prolog_term_ref  t_n,
Prolog_term_ref  t_d 
)

Prolog_foreign_return_type ppl_LP_Problem_feasible_point ( Prolog_term_ref  t_lp,
Prolog_term_ref  t_g 
)

Definition at line 3414 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, Parma_Polyhedra_Library::LP_Problem::feasible_point(), generator_term(), PROLOG_SUCCESS, Prolog_unify(), and term_to_lp_problem_handle().

03415                                                    {
03416  try {
03417     const LP_Problem* lp = term_to_lp_problem_handle(t_lp);
03418     CHECK(lp);
03419     const Generator& g = lp->feasible_point();
03420     if (Prolog_unify(t_g, generator_term(g)))
03421       return PROLOG_SUCCESS;
03422  }
03423  CATCH_ALL;
03424 }

Prolog_foreign_return_type ppl_LP_Problem_is_satisfiable ( Prolog_term_ref  t_lp  ) 

Definition at line 3375 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, Parma_Polyhedra_Library::LP_Problem::is_satisfiable(), PROLOG_SUCCESS, and term_to_lp_problem_handle().

03375                                                     {
03376   try {
03377     const LP_Problem* lp = term_to_lp_problem_handle(t_lp);
03378     CHECK(lp);
03379     if (lp->is_satisfiable())
03380       return PROLOG_SUCCESS;
03381   }
03382   CATCH_ALL;
03383 }

Prolog_foreign_return_type ppl_LP_Problem_objective_function ( Prolog_term_ref  t_lp,
Prolog_term_ref  t_le_expr 
)

Definition at line 3270 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, get_linear_expression(), Parma_Polyhedra_Library::LP_Problem::objective_function(), PROLOG_SUCCESS, Prolog_unify(), and term_to_lp_problem_handle().

03271                                                              {
03272   try {
03273     const LP_Problem* lp = term_to_lp_problem_handle(t_lp);
03274     CHECK(lp);
03275 
03276     const Linear_Expression& le = lp->objective_function();
03277     Prolog_term_ref t = get_linear_expression(le);
03278 
03279     if (Prolog_unify(t_le_expr, t))
03280       return PROLOG_SUCCESS;
03281   }
03282   CATCH_ALL;
03283 }

Prolog_foreign_return_type ppl_LP_Problem_OK ( Prolog_term_ref  t_lp  ) 

Definition at line 3475 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, Parma_Polyhedra_Library::LP_Problem::OK(), PROLOG_SUCCESS, and term_to_lp_problem_handle().

03475                                         {
03476   try {
03477     const LP_Problem* lp = term_to_lp_problem_handle(t_lp);
03478     CHECK(lp);
03479     if (lp->OK())
03480       return PROLOG_SUCCESS;
03481   }
03482   CATCH_ALL;
03483 }

Prolog_foreign_return_type ppl_LP_Problem_optimal_value ( Prolog_term_ref  t_lp,
Prolog_term_ref  t_n,
Prolog_term_ref  t_d 
)

Definition at line 3440 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, Coefficient_to_integer_term(), Parma_Polyhedra_Library::LP_Problem::optimal_value(), PROLOG_SUCCESS, Prolog_unify(), and term_to_lp_problem_handle().

03442                                                   {
03443  try {
03444     const LP_Problem* lp = term_to_lp_problem_handle(t_lp);
03445     CHECK(lp);
03446     Coefficient n;
03447     Coefficient d;
03448     lp->optimal_value(n, d);
03449     if (Prolog_unify(t_n, Coefficient_to_integer_term(n))
03450         && Prolog_unify(t_d, Coefficient_to_integer_term(d)))
03451       return PROLOG_SUCCESS;
03452  }
03453  CATCH_ALL;
03454 }

Prolog_foreign_return_type ppl_LP_Problem_optimization_mode ( Prolog_term_ref  t_lp,
Prolog_term_ref  t_opt 
)

Prolog_foreign_return_type ppl_LP_Problem_optimizing_point ( Prolog_term_ref  t_lp,
Prolog_term_ref  t_g 
)

Definition at line 3427 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, generator_term(), Parma_Polyhedra_Library::LP_Problem::optimizing_point(), PROLOG_SUCCESS, Prolog_unify(), and term_to_lp_problem_handle().

03428                                                      {
03429  try {
03430     const LP_Problem* lp = term_to_lp_problem_handle(t_lp);
03431     CHECK(lp);
03432     const Generator& g = lp->optimizing_point();
03433     if (Prolog_unify(t_g, generator_term(g)))
03434       return PROLOG_SUCCESS;
03435  }
03436  CATCH_ALL;
03437 }

Prolog_foreign_return_type ppl_LP_Problem_set_objective_function ( Prolog_term_ref  t_lp,
Prolog_term_ref  t_le_expr 
)

Prolog_foreign_return_type ppl_LP_Problem_set_optimization_mode ( Prolog_term_ref  t_lp,
Prolog_term_ref  t_opt 
)

Prolog_foreign_return_type ppl_LP_Problem_solve ( Prolog_term_ref  t_lp,
Prolog_term_ref  t_status 
)

Definition at line 3386 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, Parma_Polyhedra_Library::OPTIMIZED_LP_PROBLEM, Prolog_new_term_ref(), Prolog_put_atom(), PROLOG_SUCCESS, Prolog_unify(), Parma_Polyhedra_Library::LP_Problem::solve(), term_to_lp_problem_handle(), Parma_Polyhedra_Library::UNBOUNDED_LP_PROBLEM, and Parma_Polyhedra_Library::UNFEASIBLE_LP_PROBLEM.

03386                                                                      {
03387   try {
03388     const LP_Problem* lp = term_to_lp_problem_handle(t_lp);
03389     CHECK(lp);
03390 
03391     Prolog_atom a;
03392     switch (lp->solve()) {
03393     case UNFEASIBLE_LP_PROBLEM:
03394       a = a_unfeasible;
03395       break;
03396     case UNBOUNDED_LP_PROBLEM:
03397       a = a_unbounded;
03398       break;
03399     case OPTIMIZED_LP_PROBLEM:
03400       a = a_optimized;
03401       break;
03402     default:
03403       throw unknown_interface_error("ppl_LP_Problem_solve()");
03404     }
03405     Prolog_term_ref t = Prolog_new_term_ref();
03406     Prolog_put_atom(t, a);
03407     if (Prolog_unify(t_status, t))
03408       return PROLOG_SUCCESS;
03409   }
03410   CATCH_ALL;
03411 }

Prolog_foreign_return_type ppl_LP_Problem_space_dimension ( Prolog_term_ref  t_lp,
Prolog_term_ref  t_sd 
)

Definition at line 3239 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, PROLOG_SUCCESS, Parma_Polyhedra_Library::LP_Problem::space_dimension(), term_to_lp_problem_handle(), and unify_ulong().

03239                                                                            {
03240   try {
03241     const LP_Problem* lp = term_to_lp_problem_handle(t_lp);
03242     CHECK(lp);
03243     if (unify_ulong(t_sd, lp->space_dimension()))
03244       return PROLOG_SUCCESS;
03245   }
03246   CATCH_ALL;
03247 }

Prolog_foreign_return_type ppl_LP_Problem_swap ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs 
)

Definition at line 3215 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, PROLOG_SUCCESS, Parma_Polyhedra_Library::LP_Problem::swap(), and term_to_lp_problem_handle().

Referenced by init(), and ppl_sicstus_init().

03215                                                                   {
03216   try {
03217     LP_Problem* lhs = term_to_lp_problem_handle(t_lhs);
03218     LP_Problem* rhs = term_to_lp_problem_handle(t_rhs);
03219     CHECK(lhs);
03220     CHECK(rhs);
03221     lhs->swap(*rhs);
03222     return PROLOG_SUCCESS;
03223   }
03224   CATCH_ALL;
03225 }

Prolog_foreign_return_type ppl_max_space_dimension ( Prolog_term_ref  t_msd  ) 

Definition at line 1122 of file ppl_prolog.icc.

References CATCH_ALL, max_representable_dimension(), PROLOG_SUCCESS, and unify_ulong().

01122                                                {
01123   try {
01124     if (unify_ulong(t_msd, max_representable_dimension(max_space_dimension())))
01125       return PROLOG_SUCCESS;
01126   }
01127   CATCH_ALL;
01128 }

Prolog_foreign_return_type ppl_new_C_Polyhedron_from_bounding_box ( Prolog_term_ref  t_bb,
Prolog_term_ref  t_ph 
)

Definition at line 1594 of file ppl_prolog.icc.

References CATCH_ALL, check_nil_terminating(), LOWER, Parma_Polyhedra_Library::Bounding_Box::lower_upper_bound(), name, PROLOG_FAILURE, Prolog_get_arg(), Prolog_get_atom_name(), Prolog_get_compound_name_arity(), Prolog_get_cons(), Prolog_is_atom(), Prolog_is_compound(), Prolog_is_cons(), Prolog_new_term_ref(), Prolog_put_address(), Prolog_put_term(), PROLOG_SUCCESS, Prolog_unify(), Parma_Polyhedra_Library::Bounding_Box::raise_lower_bound(), REGISTER, Parma_Polyhedra_Library::Bounding_Box::set_empty(), term_to_boundary(), and UPPER.

01595                                                              {
01596   try {
01597     // Compute the space dimension.
01598     Prolog_term_ref t_l = Prolog_new_term_ref();
01599     Prolog_term_ref t_interval = Prolog_new_term_ref();
01600     Prolog_put_term(t_l, t_bb);
01601     dimension_type dimension;
01602     for (dimension = 0; Prolog_is_cons(t_l); ++dimension)
01603       Prolog_get_cons(t_l, t_interval, t_l);
01604 
01605     // Check the list is properly terminated.
01606     check_nil_terminating(t_l);
01607 
01608     Bounding_Box bbox(dimension);
01609     // Set bbox to reflect its Prolog representation.
01610     for (dimension_type i = 0; i < dimension; ++i) {
01611       Prolog_get_cons(t_bb, t_interval, t_bb);
01612       // An interval is either the atom empty or of the form
01613       // i(Lower_Bound, Upper_Bound).
01614       if (Prolog_is_atom(t_interval)) {
01615         Prolog_atom name;
01616         if (Prolog_get_atom_name(t_interval, &name) && name == a_empty) {
01617           bbox.set_empty();
01618           continue;
01619         }
01620         else
01621           return PROLOG_FAILURE;
01622       }
01623 
01624       if (!Prolog_is_compound(t_interval))
01625         return PROLOG_FAILURE;
01626 
01627       Prolog_atom functor;
01628       int arity;
01629       Prolog_get_compound_name_arity(t_interval, &functor, &arity);
01630       if (arity != 2 || functor != a_i)
01631         return PROLOG_FAILURE;
01632 
01633       bool finite;
01634       bool closed;
01635       Coefficient n;
01636       Coefficient d;
01637       Prolog_term_ref t_bound = Prolog_new_term_ref();
01638 
01639       // Get and raise the lower bound.
01640       Prolog_get_arg(1, t_interval, t_bound);
01641       if (!term_to_boundary(t_bound, LOWER, finite, closed, n, d))
01642         return PROLOG_FAILURE;
01643       if (finite)
01644         bbox.raise_lower_bound(i, closed, n, d);
01645 
01646       // Get and lower the upper bound.
01647       Prolog_get_arg(2, t_interval, t_bound);
01648       if (!term_to_boundary(t_bound, UPPER, finite, closed, n, d))
01649         return PROLOG_FAILURE;
01650       if (finite)
01651         bbox.lower_upper_bound(i, closed, n, d);
01652     }
01653 
01654     Polyhedron* ph;
01655     ph = new C_Polyhedron(bbox, From_Bounding_Box());
01656     Prolog_term_ref tmp = Prolog_new_term_ref();
01657     Prolog_put_address(tmp, ph);
01658     if (Prolog_unify(t_ph, tmp)) {
01659       REGISTER(ph);
01660       return PROLOG_SUCCESS;
01661     }
01662     else
01663       delete ph;
01664   }
01665   CATCH_ALL;
01666 }

Prolog_foreign_return_type ppl_new_C_Polyhedron_from_C_Polyhedron ( Prolog_term_ref  t_ph_source,
Prolog_term_ref  t_ph 
)

Definition at line 1320 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, Prolog_new_term_ref(), Prolog_put_address(), PROLOG_SUCCESS, Prolog_unify(), REGISTER, and term_to_polyhedron_handle().

01321                                                              {
01322   try {
01323     Polyhedron* ph;
01324     const C_Polyhedron* ph_source
01325         = static_cast<const C_Polyhedron*>
01326         (term_to_polyhedron_handle(t_ph_source));
01327     CHECK(ph_source);
01328         ph = new C_Polyhedron(*ph_source);
01329     Prolog_term_ref tmp = Prolog_new_term_ref();
01330     Prolog_put_address(tmp, ph);
01331     if (Prolog_unify(t_ph, tmp)) {
01332       REGISTER(ph);
01333       return PROLOG_SUCCESS;
01334     }
01335     else
01336       delete ph;
01337   }
01338   CATCH_ALL;
01339 }

Prolog_foreign_return_type ppl_new_C_Polyhedron_from_constraints ( Prolog_term_ref  t_clist,
Prolog_term_ref  t_ph 
)

Definition at line 1408 of file ppl_prolog.icc.

References build_constraint(), CATCH_ALL, check_nil_terminating(), Parma_Polyhedra_Library::Constraint_System::insert(), Prolog_get_cons(), Prolog_is_cons(), Prolog_new_term_ref(), Prolog_put_address(), PROLOG_SUCCESS, Prolog_unify(), and REGISTER.

Referenced by init(), and ppl_sicstus_init().

01409                                                             {
01410   try {
01411     Constraint_System cs;
01412     Prolog_term_ref c = Prolog_new_term_ref();
01413 
01414     while (Prolog_is_cons(t_clist)) {
01415       Prolog_get_cons(t_clist, c, t_clist);
01416       cs.insert(build_constraint(c));
01417     }
01418 
01419     // Check the list is properly terminated.
01420     check_nil_terminating(t_clist);
01421 
01422     Polyhedron* ph;
01423     ph = new C_Polyhedron(cs);
01424     Prolog_term_ref tmp = Prolog_new_term_ref();
01425     Prolog_put_address(tmp, ph);
01426     if (Prolog_unify(t_ph, tmp)) {
01427       REGISTER(ph);
01428       return PROLOG_SUCCESS;
01429     }
01430     else
01431       delete ph;
01432   }
01433   CATCH_ALL;
01434 }

Prolog_foreign_return_type ppl_new_C_Polyhedron_from_generators ( Prolog_term_ref  t_glist,
Prolog_term_ref  t_ph 
)

Definition at line 1466 of file ppl_prolog.icc.

References build_generator(), CATCH_ALL, check_nil_terminating(), Parma_Polyhedra_Library::Generator_System::insert(), Prolog_get_cons(), Prolog_is_cons(), Prolog_new_term_ref(), Prolog_put_address(), PROLOG_SUCCESS, Prolog_unify(), and REGISTER.

Referenced by init(), and ppl_sicstus_init().

01467                                                            {
01468   try {
01469     Generator_System gs;
01470     Prolog_term_ref g = Prolog_new_term_ref();
01471 
01472     while (Prolog_is_cons(t_glist)) {
01473       Prolog_get_cons(t_glist, g, t_glist);
01474       gs.insert(build_generator(g));
01475     }
01476 
01477     // Check the list is properly terminated.
01478     check_nil_terminating(t_glist);
01479 
01480     Polyhedron* ph;
01481     ph = new C_Polyhedron(gs);
01482     Prolog_term_ref tmp = Prolog_new_term_ref();
01483     Prolog_put_address(tmp, ph);
01484     if (Prolog_unify(t_ph, tmp)) {
01485       REGISTER(ph);
01486       return PROLOG_SUCCESS;
01487     }
01488     else
01489       delete ph;
01490   }
01491   CATCH_ALL;
01492 }

Prolog_foreign_return_type ppl_new_C_Polyhedron_from_NNC_Polyhedron ( Prolog_term_ref  t_ph_source,
Prolog_term_ref  t_ph 
)

Definition at line 1364 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, Prolog_new_term_ref(), Prolog_put_address(), PROLOG_SUCCESS, Prolog_unify(), REGISTER, and term_to_polyhedron_handle().

01365                                                                {
01366   try {
01367     Polyhedron* ph;
01368     const NNC_Polyhedron* ph_source
01369         = static_cast<const NNC_Polyhedron*>
01370         (term_to_polyhedron_handle(t_ph_source));
01371     CHECK(ph_source);
01372         ph = new C_Polyhedron(*ph_source);
01373     Prolog_term_ref tmp = Prolog_new_term_ref();
01374     Prolog_put_address(tmp, ph);
01375     if (Prolog_unify(t_ph, tmp)) {
01376       REGISTER(ph);
01377       return PROLOG_SUCCESS;
01378     }
01379     else
01380       delete ph;
01381   }
01382   CATCH_ALL;
01383 }

Prolog_foreign_return_type ppl_new_C_Polyhedron_from_space_dimension ( Prolog_term_ref  t_nd,
Prolog_term_ref  t_uoe,
Prolog_term_ref  t_ph 
)

Definition at line 1266 of file ppl_prolog.icc.

References CATCH_ALL, Parma_Polyhedra_Library::EMPTY, Prolog_new_term_ref(), Prolog_put_address(), PROLOG_SUCCESS, Prolog_unify(), REGISTER, and term_to_universe_or_empty().

Referenced by init(), and ppl_sicstus_init().

01268                                                                 {
01269   try {
01270     Polyhedron* ph;
01271     Prolog_atom uoe = term_to_universe_or_empty(t_uoe);
01272 
01273     if (uoe == a_empty)
01274         ph = new C_Polyhedron(term_to_unsigned<dimension_type>(t_nd),
01275                               EMPTY);
01276       else
01277         ph = new C_Polyhedron(term_to_unsigned<dimension_type>(t_nd));
01278 
01279 
01280     Prolog_term_ref tmp = Prolog_new_term_ref();
01281     Prolog_put_address(tmp, ph);
01282     if (Prolog_unify(t_ph, tmp)) {
01283       REGISTER(ph);
01284       return PROLOG_SUCCESS;
01285     }
01286     else
01287       delete ph;
01288   }
01289   CATCH_ALL;
01290 }

Prolog_foreign_return_type ppl_new_LP_Problem ( Prolog_term_ref  t_clist,
Prolog_term_ref  t_le_expr,
Prolog_term_ref  t_opt,
Prolog_term_ref  t_lp 
)

Definition at line 3162 of file ppl_prolog.icc.

References build_constraint(), build_linear_expression(), CATCH_ALL, check_nil_terminating(), Parma_Polyhedra_Library::Constraint_System::insert(), Parma_Polyhedra_Library::MAXIMIZATION, Parma_Polyhedra_Library::MINIMIZATION, Prolog_get_cons(), Prolog_is_cons(), Prolog_new_term_ref(), Prolog_put_address(), PROLOG_SUCCESS, Prolog_unify(), REGISTER, and term_to_optimization_mode().

03165                                          {
03166   try {
03167     Constraint_System cs;
03168     Prolog_term_ref c = Prolog_new_term_ref();
03169     while (Prolog_is_cons(t_clist)) {
03170       Prolog_get_cons(t_clist, c, t_clist);
03171       cs.insert(build_constraint(c));
03172     }
03173     // Check the list is properly terminated.
03174     check_nil_terminating(t_clist);
03175 
03176     const Linear_Expression le = build_linear_expression(t_le_expr);
03177     Prolog_atom opt = term_to_optimization_mode(t_opt);
03178     Optimization_Mode mode = (opt == a_max) ? MAXIMIZATION : MINIMIZATION;
03179 
03180     LP_Problem* lp = new LP_Problem(cs, le, mode);
03181     Prolog_term_ref tmp = Prolog_new_term_ref();
03182     Prolog_put_address(tmp, lp);
03183     if (Prolog_unify(t_lp, tmp)) {
03184       REGISTER(lp);
03185       return PROLOG_SUCCESS;
03186     }
03187     else
03188       delete lp;
03189   }
03190   CATCH_ALL;
03191 }

Prolog_foreign_return_type ppl_new_LP_Problem_from_LP_Problem ( Prolog_term_ref  t_lp_source,
Prolog_term_ref  t_lp 
)

Definition at line 3194 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, Prolog_new_term_ref(), Prolog_put_address(), PROLOG_SUCCESS, Prolog_unify(), REGISTER, and term_to_lp_problem_handle().

03195                                                          {
03196   try {
03197     const LP_Problem* lp_source
03198       = static_cast<const LP_Problem*>
03199         (term_to_lp_problem_handle(t_lp_source));
03200     CHECK(lp_source);
03201     LP_Problem* lp = new LP_Problem(*lp_source);
03202     Prolog_term_ref tmp = Prolog_new_term_ref();
03203     Prolog_put_address(tmp, lp);
03204     if (Prolog_unify(t_lp, tmp)) {
03205       REGISTER(lp);
03206       return PROLOG_SUCCESS;
03207     }
03208     else
03209       delete lp;
03210   }
03211   CATCH_ALL;
03212 }

Prolog_foreign_return_type ppl_new_LP_Problem_trivial ( Prolog_term_ref  t_lp  ) 

Definition at line 3146 of file ppl_prolog.icc.

References CATCH_ALL, Prolog_new_term_ref(), Prolog_put_address(), PROLOG_SUCCESS, Prolog_unify(), and REGISTER.

03146                                                  {
03147   try {
03148     LP_Problem* lp = new LP_Problem;
03149     Prolog_term_ref tmp = Prolog_new_term_ref();
03150     Prolog_put_address(tmp, lp);
03151     if (Prolog_unify(t_lp, tmp)) {
03152       REGISTER(lp);
03153       return PROLOG_SUCCESS;
03154     }
03155     else
03156       delete lp;
03157   }
03158   CATCH_ALL;
03159 }

Prolog_foreign_return_type ppl_new_NNC_Polyhedron_from_bounding_box ( Prolog_term_ref  t_bb,
Prolog_term_ref  t_ph 
)

Definition at line 1669 of file ppl_prolog.icc.

References CATCH_ALL, check_nil_terminating(), LOWER, Parma_Polyhedra_Library::Bounding_Box::lower_upper_bound(), name, PROLOG_FAILURE, Prolog_get_arg(), Prolog_get_atom_name(), Prolog_get_compound_name_arity(), Prolog_get_cons(), Prolog_is_atom(), Prolog_is_compound(), Prolog_is_cons(), Prolog_new_term_ref(), Prolog_put_address(), Prolog_put_term(), PROLOG_SUCCESS, Prolog_unify(), Parma_Polyhedra_Library::Bounding_Box::raise_lower_bound(), REGISTER, Parma_Polyhedra_Library::Bounding_Box::set_empty(), term_to_boundary(), and UPPER.

01670                                                                {
01671   try {
01672     // Compute the space dimension.
01673     Prolog_term_ref t_l = Prolog_new_term_ref();
01674     Prolog_term_ref t_interval = Prolog_new_term_ref();
01675     Prolog_put_term(t_l, t_bb);
01676     dimension_type dimension;
01677     for (dimension = 0; Prolog_is_cons(t_l); ++dimension)
01678       Prolog_get_cons(t_l, t_interval, t_l);
01679 
01680     // Check the list is properly terminated.
01681     check_nil_terminating(t_l);
01682 
01683     Bounding_Box bbox(dimension);
01684     // Set bbox to reflect its Prolog representation.
01685     for (dimension_type i = 0; i < dimension; ++i) {
01686       Prolog_get_cons(t_bb, t_interval, t_bb);
01687       // An interval is either the atom empty or of the form
01688       // i(Lower_Bound, Upper_Bound).
01689       if (Prolog_is_atom(t_interval)) {
01690         Prolog_atom name;
01691         if (Prolog_get_atom_name(t_interval, &name) && name == a_empty) {
01692           bbox.set_empty();
01693           continue;
01694         }
01695         else
01696           return PROLOG_FAILURE;
01697       }
01698 
01699       if (!Prolog_is_compound(t_interval))
01700         return PROLOG_FAILURE;
01701 
01702       Prolog_atom functor;
01703       int arity;
01704       Prolog_get_compound_name_arity(t_interval, &functor, &arity);
01705       if (arity != 2 || functor != a_i)
01706         return PROLOG_FAILURE;
01707 
01708       bool finite;
01709       bool closed;
01710       Coefficient n;
01711       Coefficient d;
01712       Prolog_term_ref t_bound = Prolog_new_term_ref();
01713 
01714       // Get and raise the lower bound.
01715       Prolog_get_arg(1, t_interval, t_bound);
01716       if (!term_to_boundary(t_bound, LOWER, finite, closed, n, d))
01717         return PROLOG_FAILURE;
01718       if (finite)
01719         bbox.raise_lower_bound(i, closed, n, d);
01720 
01721       // Get and lower the upper bound.
01722       Prolog_get_arg(2, t_interval, t_bound);
01723       if (!term_to_boundary(t_bound, UPPER, finite, closed, n, d))
01724         return PROLOG_FAILURE;
01725       if (finite)
01726         bbox.lower_upper_bound(i, closed, n, d);
01727     }
01728 
01729     Polyhedron* ph;
01730     ph = new NNC_Polyhedron(bbox, From_Bounding_Box());
01731     Prolog_term_ref tmp = Prolog_new_term_ref();
01732     Prolog_put_address(tmp, ph);
01733     if (Prolog_unify(t_ph, tmp)) {
01734       REGISTER(ph);
01735       return PROLOG_SUCCESS;
01736     }
01737     else
01738       delete ph;
01739   }
01740   CATCH_ALL;
01741 }

Prolog_foreign_return_type ppl_new_NNC_Polyhedron_from_C_Polyhedron ( Prolog_term_ref  t_ph_source,
Prolog_term_ref  t_ph 
)

Definition at line 1342 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, Prolog_new_term_ref(), Prolog_put_address(), PROLOG_SUCCESS, Prolog_unify(), REGISTER, and term_to_polyhedron_handle().

01343                                                                {
01344   try {
01345     Polyhedron* ph;
01346     const C_Polyhedron* ph_source
01347         = static_cast<const C_Polyhedron*>
01348         (term_to_polyhedron_handle(t_ph_source));
01349     CHECK(ph_source);
01350         ph = new NNC_Polyhedron(*ph_source);
01351     Prolog_term_ref tmp = Prolog_new_term_ref();
01352     Prolog_put_address(tmp, ph);
01353     if (Prolog_unify(t_ph, tmp)) {
01354       REGISTER(ph);
01355       return PROLOG_SUCCESS;
01356     }
01357     else
01358       delete ph;
01359   }
01360   CATCH_ALL;
01361 }

Prolog_foreign_return_type ppl_new_NNC_Polyhedron_from_constraints ( Prolog_term_ref  t_clist,
Prolog_term_ref  t_ph 
)

Definition at line 1437 of file ppl_prolog.icc.

References build_constraint(), CATCH_ALL, check_nil_terminating(), Parma_Polyhedra_Library::Constraint_System::insert(), Prolog_get_cons(), Prolog_is_cons(), Prolog_new_term_ref(), Prolog_put_address(), PROLOG_SUCCESS, Prolog_unify(), and REGISTER.

Referenced by init(), and ppl_sicstus_init().

01438                                                               {
01439   try {
01440     Constraint_System cs;
01441     Prolog_term_ref c = Prolog_new_term_ref();
01442 
01443     while (Prolog_is_cons(t_clist)) {
01444       Prolog_get_cons(t_clist, c, t_clist);
01445       cs.insert(build_constraint(c));
01446     }
01447 
01448     // Check the list is properly terminated.
01449     check_nil_terminating(t_clist);
01450 
01451     Polyhedron* ph;
01452     ph = new NNC_Polyhedron(cs);
01453     Prolog_term_ref tmp = Prolog_new_term_ref();
01454     Prolog_put_address(tmp, ph);
01455     if (Prolog_unify(t_ph, tmp)) {
01456       REGISTER(ph);
01457       return PROLOG_SUCCESS;
01458     }
01459     else
01460       delete ph;
01461   }
01462   CATCH_ALL;
01463 }

Prolog_foreign_return_type ppl_new_NNC_Polyhedron_from_generators ( Prolog_term_ref  t_glist,
Prolog_term_ref  t_ph 
)

Definition at line 1495 of file ppl_prolog.icc.

References build_generator(), CATCH_ALL, check_nil_terminating(), Parma_Polyhedra_Library::Generator_System::insert(), Prolog_get_cons(), Prolog_is_cons(), Prolog_new_term_ref(), Prolog_put_address(), PROLOG_SUCCESS, Prolog_unify(), and REGISTER.

Referenced by init(), and ppl_sicstus_init().

01496                                                              {
01497   try {
01498     Generator_System gs;
01499     Prolog_term_ref g = Prolog_new_term_ref();
01500 
01501     while (Prolog_is_cons(t_glist)) {
01502       Prolog_get_cons(t_glist, g, t_glist);
01503       gs.insert(build_generator(g));
01504     }
01505 
01506     // Check the list is properly terminated.
01507     check_nil_terminating(t_glist);
01508 
01509     Polyhedron* ph;
01510     ph = new NNC_Polyhedron(gs);
01511     Prolog_term_ref tmp = Prolog_new_term_ref();
01512     Prolog_put_address(tmp, ph);
01513     if (Prolog_unify(t_ph, tmp)) {
01514       REGISTER(ph);
01515       return PROLOG_SUCCESS;
01516     }
01517     else
01518       delete ph;
01519   }
01520   CATCH_ALL;
01521 }

Prolog_foreign_return_type ppl_new_NNC_Polyhedron_from_NNC_Polyhedron ( Prolog_term_ref  t_ph_source,
Prolog_term_ref  t_ph 
)

Definition at line 1386 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, Prolog_new_term_ref(), Prolog_put_address(), PROLOG_SUCCESS, Prolog_unify(), REGISTER, and term_to_polyhedron_handle().

01387                                                                  {
01388   try {
01389     Polyhedron* ph;
01390     const NNC_Polyhedron* ph_source
01391         = static_cast<const NNC_Polyhedron*>
01392         (term_to_polyhedron_handle(t_ph_source));
01393     CHECK(ph_source);
01394         ph = new NNC_Polyhedron(*ph_source);
01395     Prolog_term_ref tmp = Prolog_new_term_ref();
01396     Prolog_put_address(tmp, ph);
01397     if (Prolog_unify(t_ph, tmp)) {
01398       REGISTER(ph);
01399       return PROLOG_SUCCESS;
01400     }
01401     else
01402       delete ph;
01403   }
01404   CATCH_ALL;
01405 }

Prolog_foreign_return_type ppl_new_NNC_Polyhedron_from_space_dimension ( Prolog_term_ref  t_nd,
Prolog_term_ref  t_uoe,
Prolog_term_ref  t_ph 
)

Definition at line 1293 of file ppl_prolog.icc.

References CATCH_ALL, Parma_Polyhedra_Library::EMPTY, Prolog_new_term_ref(), Prolog_put_address(), PROLOG_SUCCESS, Prolog_unify(), REGISTER, and term_to_universe_or_empty().

Referenced by init(), and ppl_sicstus_init().

01295                                                                   {
01296   try {
01297     Polyhedron* ph;
01298     Prolog_atom uoe = term_to_universe_or_empty(t_uoe);
01299 
01300     if (uoe == a_empty)
01301         ph = new NNC_Polyhedron(term_to_unsigned<dimension_type>(t_nd),
01302                               EMPTY);
01303       else
01304         ph = new NNC_Polyhedron(term_to_unsigned<dimension_type>(t_nd));
01305 
01306 
01307     Prolog_term_ref tmp = Prolog_new_term_ref();
01308     Prolog_put_address(tmp, ph);
01309     if (Prolog_unify(t_ph, tmp)) {
01310       REGISTER(ph);
01311       return PROLOG_SUCCESS;
01312     }
01313     else
01314       delete ph;
01315   }
01316   CATCH_ALL;
01317 }

Prolog_foreign_return_type ppl_Polyhedron_add_constraint ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_c 
)

Definition at line 2288 of file ppl_prolog.icc.

References Parma_Polyhedra_Library::Polyhedron::add_constraint(), build_constraint(), CATCH_ALL, CHECK, PROLOG_SUCCESS, and term_to_polyhedron_handle().

02288                                                                          {
02289   try {
02290     Polyhedron* ph = term_to_polyhedron_handle(t_ph);
02291     CHECK(ph);
02292     ph->add_constraint(build_constraint(t_c));
02293     return PROLOG_SUCCESS;
02294   }
02295   CATCH_ALL;
02296 }

Prolog_foreign_return_type ppl_Polyhedron_add_constraint_and_minimize ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_c 
)

Prolog_foreign_return_type ppl_Polyhedron_add_constraints ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_clist 
)

Definition at line 2334 of file ppl_prolog.icc.

References Parma_Polyhedra_Library::Polyhedron::add_constraints(), build_constraint(), CATCH_ALL, CHECK, check_nil_terminating(), Parma_Polyhedra_Library::Constraint_System::insert(), Prolog_get_cons(), Prolog_is_cons(), Prolog_new_term_ref(), PROLOG_SUCCESS, and term_to_polyhedron_handle().

02335                                                         {
02336   try {
02337     Polyhedron* ph = term_to_polyhedron_handle(t_ph);
02338     CHECK(ph);
02339     Constraint_System cs;
02340     Prolog_term_ref c = Prolog_new_term_ref();
02341 
02342     while (Prolog_is_cons(t_clist)) {
02343       Prolog_get_cons(t_clist, c, t_clist);
02344       cs.insert(build_constraint(c));
02345     }
02346 
02347     // Check the list is properly terminated.
02348     check_nil_terminating(t_clist);
02349 
02350     ph->add_constraints(cs);
02351     return PROLOG_SUCCESS;
02352   }
02353   CATCH_ALL;
02354 }

Prolog_foreign_return_type ppl_Polyhedron_add_constraints_and_minimize ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_clist 
)

Definition at line 2357 of file ppl_prolog.icc.

References Parma_Polyhedra_Library::Polyhedron::add_constraints_and_minimize(), build_constraint(), CATCH_ALL, CHECK, check_nil_terminating(), Parma_Polyhedra_Library::Constraint_System::insert(), Prolog_get_cons(), Prolog_is_cons(), Prolog_new_term_ref(), PROLOG_SUCCESS, and term_to_polyhedron_handle().

02358                                                                      {
02359   try {
02360     Polyhedron* ph = term_to_polyhedron_handle(t_ph);
02361     CHECK(ph);
02362     Constraint_System cs;
02363     Prolog_term_ref c = Prolog_new_term_ref();
02364 
02365     while (Prolog_is_cons(t_clist)) {
02366       Prolog_get_cons(t_clist, c, t_clist);
02367       cs.insert(build_constraint(c));
02368     }
02369 
02370     // Check the list is properly terminated.
02371     check_nil_terminating(t_clist);
02372 
02373     if (ph->add_constraints_and_minimize(cs))
02374       return PROLOG_SUCCESS;
02375   }
02376   CATCH_ALL;
02377 }

Prolog_foreign_return_type ppl_Polyhedron_add_generator ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_g 
)

Definition at line 2311 of file ppl_prolog.icc.

References Parma_Polyhedra_Library::Polyhedron::add_generator(), build_generator(), CATCH_ALL, CHECK, PROLOG_SUCCESS, and term_to_polyhedron_handle().

02311                                                                         {
02312   try {
02313     Polyhedron* ph = term_to_polyhedron_handle(t_ph);
02314     CHECK(ph);
02315     ph->add_generator(build_generator(t_g));
02316     return PROLOG_SUCCESS;
02317   }
02318   CATCH_ALL;
02319 }

Prolog_foreign_return_type ppl_Polyhedron_add_generator_and_minimize ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_g 
)

Definition at line 2322 of file ppl_prolog.icc.

References Parma_Polyhedra_Library::Polyhedron::add_generator_and_minimize(), build_generator(), CATCH_ALL, CHECK, PROLOG_SUCCESS, and term_to_polyhedron_handle().

02323                                                                {
02324   try {
02325     Polyhedron* ph = term_to_polyhedron_handle(t_ph);
02326     CHECK(ph);
02327     if (ph->add_generator_and_minimize(build_generator(t_g)))
02328       return PROLOG_SUCCESS;
02329   }
02330   CATCH_ALL;
02331 }

Prolog_foreign_return_type ppl_Polyhedron_add_generators ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_glist 
)

Definition at line 2380 of file ppl_prolog.icc.

References Parma_Polyhedra_Library::Polyhedron::add_generators(), build_generator(), CATCH_ALL, CHECK, check_nil_terminating(), Parma_Polyhedra_Library::Generator_System::insert(), Prolog_get_cons(), Prolog_is_cons(), Prolog_new_term_ref(), PROLOG_SUCCESS, and term_to_polyhedron_handle().

02381                                                        {
02382   try {
02383     Polyhedron* ph = term_to_polyhedron_handle(t_ph);
02384     CHECK(ph);
02385     Generator_System gs;
02386     Prolog_term_ref g = Prolog_new_term_ref();
02387 
02388     while (Prolog_is_cons(t_glist)) {
02389       Prolog_get_cons(t_glist, g, t_glist);
02390       gs.insert(build_generator(g));
02391     }
02392 
02393     // Check the list is properly terminated.
02394     check_nil_terminating(t_glist);
02395 
02396     ph->add_generators(gs);
02397     return PROLOG_SUCCESS;
02398   }
02399   CATCH_ALL;
02400 }

Prolog_foreign_return_type ppl_Polyhedron_add_generators_and_minimize ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_glist 
)

Definition at line 2403 of file ppl_prolog.icc.

References Parma_Polyhedra_Library::Polyhedron::add_generators_and_minimize(), build_generator(), CATCH_ALL, CHECK, check_nil_terminating(), Parma_Polyhedra_Library::Generator_System::insert(), Prolog_get_cons(), Prolog_is_cons(), Prolog_new_term_ref(), PROLOG_SUCCESS, and term_to_polyhedron_handle().

02404                                                                     {
02405   try {
02406     Polyhedron* ph = term_to_polyhedron_handle(t_ph);
02407     CHECK(ph);
02408     Generator_System gs;
02409     Prolog_term_ref g = Prolog_new_term_ref();
02410 
02411     while (Prolog_is_cons(t_glist)) {
02412       Prolog_get_cons(t_glist, g, t_glist);
02413       gs.insert(build_generator(g));
02414     }
02415 
02416     // Check the list is properly terminated.
02417     check_nil_terminating(t_glist);
02418 
02419     if (ph->add_generators_and_minimize(gs))
02420       return PROLOG_SUCCESS;
02421   }
02422   CATCH_ALL;
02423 }

Prolog_foreign_return_type ppl_Polyhedron_add_space_dimensions_and_embed ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_nnd 
)

Definition at line 2957 of file ppl_prolog.icc.

References Parma_Polyhedra_Library::Polyhedron::add_space_dimensions_and_embed(), CATCH_ALL, CHECK, PROLOG_SUCCESS, and term_to_polyhedron_handle().

02958                                                                      {
02959   try {
02960     Polyhedron* ph = term_to_polyhedron_handle(t_ph);
02961     CHECK(ph);
02962     dimension_type d = term_to_unsigned<dimension_type>(t_nnd);
02963     ph->add_space_dimensions_and_embed(d);
02964     return PROLOG_SUCCESS;
02965   }
02966   CATCH_ALL;
02967 }

Prolog_foreign_return_type ppl_Polyhedron_add_space_dimensions_and_project ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_nnd 
)

Definition at line 2944 of file ppl_prolog.icc.

References Parma_Polyhedra_Library::Polyhedron::add_space_dimensions_and_project(), CATCH_ALL, CHECK, PROLOG_SUCCESS, and term_to_polyhedron_handle().

02945                                                                        {
02946   try {
02947     Polyhedron* ph = term_to_polyhedron_handle(t_ph);
02948     CHECK(ph);
02949     dimension_type d = term_to_unsigned<dimension_type>(t_nnd);
02950       ph->add_space_dimensions_and_project(d);
02951     return PROLOG_SUCCESS;
02952   }
02953   CATCH_ALL;
02954 }

Prolog_foreign_return_type ppl_Polyhedron_affine_dimension ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_sd 
)

Definition at line 1779 of file ppl_prolog.icc.

References Parma_Polyhedra_Library::Polyhedron::affine_dimension(), CATCH_ALL, CHECK, PROLOG_SUCCESS, term_to_polyhedron_handle(), and unify_ulong().

01779                                                                             {
01780   try {
01781     const Polyhedron* ph = term_to_polyhedron_handle(t_ph);
01782     CHECK(ph);
01783     if (unify_ulong(t_sd, ph->affine_dimension()))
01784       return PROLOG_SUCCESS;
01785   }
01786   CATCH_ALL;
01787 }

Prolog_foreign_return_type ppl_Polyhedron_affine_image ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_v,
Prolog_term_ref  t_le,
Prolog_term_ref  t_d 
)

Prolog_foreign_return_type ppl_Polyhedron_affine_preimage ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_v,
Prolog_term_ref  t_le,
Prolog_term_ref  t_d 
)

Prolog_foreign_return_type ppl_Polyhedron_BHRZ03_widening_assign ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs 
)

Definition at line 2815 of file ppl_prolog.icc.

References widening_assign().

02816                                                              {
02817   return widening_assign(t_lhs, t_rhs, &Polyhedron::BHRZ03_widening_assign);
02818 }

Prolog_foreign_return_type ppl_Polyhedron_BHRZ03_widening_assign_with_token ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs,
Prolog_term_ref  t_t 
)

Definition at line 2807 of file ppl_prolog.icc.

References widening_assign_with_token().

02809                                                                       {
02810   return widening_assign_with_token(t_lhs, t_rhs, t_t,
02811                                     &Polyhedron::BHRZ03_widening_assign);
02812 }

Prolog_foreign_return_type ppl_Polyhedron_BHRZ03_widening_assign_with_tokens ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs,
Prolog_term_ref  t_ti,
Prolog_term_ref  t_to 
)

Definition at line 2798 of file ppl_prolog.icc.

References widening_assign_with_tokens().

02801                                                                         {
02802   return widening_assign_with_tokens(t_lhs, t_rhs, t_ti, t_to,
02803                                     &Polyhedron::BHRZ03_widening_assign);
02804 }

Prolog_foreign_return_type ppl_Polyhedron_bounded_affine_image ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_v,
Prolog_term_ref  t_lb_le,
Prolog_term_ref  t_ub_le,
Prolog_term_ref  t_d 
)

Prolog_foreign_return_type ppl_Polyhedron_bounded_affine_preimage ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_v,
Prolog_term_ref  t_lb_le,
Prolog_term_ref  t_ub_le,
Prolog_term_ref  t_d 
)

Prolog_foreign_return_type ppl_Polyhedron_bounded_BHRZ03_extrapolation_assign ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs,
Prolog_term_ref  t_clist 
)

Definition at line 2864 of file ppl_prolog.icc.

References limited_extrapolation_assign().

02866                                                                             {
02867   return limited_extrapolation_assign(t_lhs,
02868                                       t_rhs,
02869                                       t_clist,
02870                                       &Polyhedron::
02871                                       bounded_BHRZ03_extrapolation_assign);
02872 }

Prolog_foreign_return_type ppl_Polyhedron_bounded_BHRZ03_extrapolation_assign_with_tokens ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs,
Prolog_term_ref  t_clist,
Prolog_term_ref  t_ti,
Prolog_term_ref  t_to 
)

Definition at line 2848 of file ppl_prolog.icc.

References limited_extrapolation_assign_with_tokens().

02853                                                                          {
02854   return limited_extrapolation_assign_with_tokens(t_lhs,
02855                                       t_rhs,
02856                                       t_clist,
02857                                       t_ti,
02858                                       t_to,
02859                                       &Polyhedron::
02860                                       bounded_BHRZ03_extrapolation_assign);
02861 }

Prolog_foreign_return_type ppl_Polyhedron_bounded_H79_extrapolation_assign ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs,
Prolog_term_ref  t_clist 
)

Definition at line 2933 of file ppl_prolog.icc.

References limited_extrapolation_assign().

02935                                                                             {
02936   return limited_extrapolation_assign(t_lhs,
02937                                       t_rhs,
02938                                       t_clist,
02939                                       &Polyhedron::
02940                                       bounded_H79_extrapolation_assign);
02941 }

Prolog_foreign_return_type ppl_Polyhedron_bounded_H79_extrapolation_assign_with_tokens ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs,
Prolog_term_ref  t_clist,
Prolog_term_ref  t_ti,
Prolog_term_ref  t_to 
)

Definition at line 2917 of file ppl_prolog.icc.

References limited_extrapolation_assign_with_tokens().

02922                                                                          {
02923   return limited_extrapolation_assign_with_tokens(t_lhs,
02924                                       t_rhs,
02925                                       t_clist,
02926                                       t_ti,
02927                                       t_to,
02928                                       &Polyhedron::
02929                                       bounded_H79_extrapolation_assign);
02930 }

Prolog_foreign_return_type ppl_Polyhedron_bounds_from_above ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_expr 
)

Definition at line 2063 of file ppl_prolog.icc.

References Parma_Polyhedra_Library::Polyhedron::bounds_from_above(), build_linear_expression(), CATCH_ALL, CHECK, PROLOG_SUCCESS, and term_to_polyhedron_handle().

02064                                                          {
02065   try {
02066     Polyhedron* ph = term_to_polyhedron_handle(t_ph);
02067     CHECK(ph);
02068     Linear_Expression l = build_linear_expression(t_expr);
02069     if (ph->bounds_from_above(l))
02070       return PROLOG_SUCCESS;
02071   }
02072   CATCH_ALL;
02073 }

Prolog_foreign_return_type ppl_Polyhedron_bounds_from_below ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_expr 
)

Definition at line 2076 of file ppl_prolog.icc.

References Parma_Polyhedra_Library::Polyhedron::bounds_from_below(), build_linear_expression(), CATCH_ALL, CHECK, PROLOG_SUCCESS, and term_to_polyhedron_handle().

02077                                                          {
02078   try {
02079     Polyhedron* ph = term_to_polyhedron_handle(t_ph);
02080     CHECK(ph);
02081     Linear_Expression l = build_linear_expression(t_expr);
02082     if (ph->bounds_from_below(l))
02083       return PROLOG_SUCCESS;
02084   }
02085   CATCH_ALL;
02086 }

Prolog_foreign_return_type ppl_Polyhedron_concatenate_assign ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs 
)

Definition at line 2970 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, Parma_Polyhedra_Library::Polyhedron::concatenate_assign(), PROLOG_SUCCESS, and term_to_polyhedron_handle().

02971                                                          {
02972   try {
02973     Polyhedron* lhs = term_to_polyhedron_handle(t_lhs);
02974     const Polyhedron* rhs = term_to_polyhedron_handle(t_rhs);
02975     CHECK(lhs);
02976     CHECK(rhs);
02977     lhs->concatenate_assign(*rhs);
02978     return PROLOG_SUCCESS;
02979   }
02980   CATCH_ALL;
02981 }

Prolog_foreign_return_type ppl_Polyhedron_contains_Polyhedron ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs 
)

Definition at line 2221 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, Parma_Polyhedra_Library::Polyhedron::contains(), PROLOG_SUCCESS, and term_to_polyhedron_handle().

02222                                                           {
02223   try {
02224     const Polyhedron* lhs = term_to_polyhedron_handle(t_lhs);
02225     const Polyhedron* rhs = term_to_polyhedron_handle(t_rhs);
02226     CHECK(lhs);
02227     CHECK(rhs);
02228     if (lhs->contains(*rhs))
02229       return PROLOG_SUCCESS;
02230   }
02231   CATCH_ALL;
02232 }

Prolog_foreign_return_type ppl_Polyhedron_equals_Polyhedron ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs 
)

Definition at line 2263 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, PROLOG_SUCCESS, and term_to_polyhedron_handle().

02264                                                         {
02265   try {
02266     const Polyhedron* lhs = term_to_polyhedron_handle(t_lhs);
02267     const Polyhedron* rhs = term_to_polyhedron_handle(t_rhs);
02268     CHECK(lhs);
02269     CHECK(rhs);
02270     if (*lhs == *rhs)
02271       return PROLOG_SUCCESS;
02272   }
02273   CATCH_ALL;
02274 }

Prolog_foreign_return_type ppl_Polyhedron_expand_space_dimension ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_v,
Prolog_term_ref  t_nd 
)

Definition at line 3018 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, Parma_Polyhedra_Library::Polyhedron::expand_space_dimension(), PROLOG_SUCCESS, term_to_polyhedron_handle(), and term_to_Variable().

03020                                                             {
03021   try {
03022     Polyhedron* ph = term_to_polyhedron_handle(t_ph);
03023     CHECK(ph);
03024     ph->expand_space_dimension(term_to_Variable(t_v),
03025                                term_to_unsigned<dimension_type>(t_nd));
03026     return PROLOG_SUCCESS;
03027   }
03028   CATCH_ALL;
03029 }

Prolog_foreign_return_type ppl_Polyhedron_fold_space_dimensions ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_vlist,
Prolog_term_ref  t_v 
)

Definition at line 3032 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, check_nil_terminating(), Parma_Polyhedra_Library::Polyhedron::fold_space_dimensions(), Prolog_get_cons(), Prolog_is_cons(), Prolog_new_term_ref(), PROLOG_SUCCESS, term_to_polyhedron_handle(), and term_to_Variable().

03034                                                           {
03035   try {
03036     Polyhedron* ph = term_to_polyhedron_handle(t_ph);
03037     CHECK(ph);
03038     Variables_Set fold_variables;
03039     Prolog_term_ref v = Prolog_new_term_ref();
03040     while (Prolog_is_cons(t_vlist)) {
03041       Prolog_get_cons(t_vlist, v, t_vlist);
03042       fold_variables.insert(term_to_Variable(v));
03043     }
03044 
03045     // Check the list is properly terminated.
03046     check_nil_terminating(t_vlist);
03047 
03048     ph->fold_space_dimensions(fold_variables, term_to_Variable(t_v));
03049     return PROLOG_SUCCESS;
03050   }
03051   CATCH_ALL;
03052 }

Prolog_foreign_return_type ppl_Polyhedron_generalized_affine_image ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_v,
Prolog_term_ref  t_r,
Prolog_term_ref  t_le,
Prolog_term_ref  t_d 
)

Prolog_foreign_return_type ppl_Polyhedron_generalized_affine_image_lhs_rhs ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_lhs,
Prolog_term_ref  t_r,
Prolog_term_ref  t_rhs 
)

Prolog_foreign_return_type ppl_Polyhedron_generalized_affine_preimage ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_v,
Prolog_term_ref  t_r,
Prolog_term_ref  t_le,
Prolog_term_ref  t_d 
)

Prolog_foreign_return_type ppl_Polyhedron_generalized_affine_preimage_lhs_rhs ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_lhs,
Prolog_term_ref  t_r,
Prolog_term_ref  t_rhs 
)

Prolog_foreign_return_type ppl_Polyhedron_get_bounding_box ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_cc,
Prolog_term_ref  t_bb 
)

Prolog_foreign_return_type ppl_Polyhedron_get_constraints ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_clist 
)

Prolog_foreign_return_type ppl_Polyhedron_get_generators ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_glist 
)

Definition at line 1830 of file ppl_prolog.icc.

References Parma_Polyhedra_Library::Generator_System::begin(), CATCH_ALL, CHECK, Parma_Polyhedra_Library::Generator_System::end(), generator_term(), Parma_Polyhedra_Library::Polyhedron::generators(), Prolog_construct_cons(), Prolog_new_term_ref(), Prolog_put_atom(), PROLOG_SUCCESS, Prolog_unify(), and term_to_polyhedron_handle().

Referenced by init(), and ppl_sicstus_init().

01831                                                        {
01832   try {
01833     const Polyhedron* ph = term_to_polyhedron_handle(t_ph);
01834     CHECK(ph);
01835 
01836     Prolog_term_ref tail = Prolog_new_term_ref();
01837     Prolog_put_atom(tail, a_nil);
01838     const Generator_System& gs = ph->generators();
01839     for (Generator_System::const_iterator i = gs.begin(),
01840            gs_end = gs.end(); i != gs_end; ++i)
01841       Prolog_construct_cons(tail, generator_term(*i), tail);
01842 
01843     if (Prolog_unify(t_glist, tail))
01844       return PROLOG_SUCCESS;
01845   }
01846   CATCH_ALL;
01847 }

Prolog_foreign_return_type ppl_Polyhedron_get_minimized_constraints ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_clist 
)

Prolog_foreign_return_type ppl_Polyhedron_get_minimized_generators ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_glist 
)

Prolog_foreign_return_type ppl_Polyhedron_H79_widening_assign ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs 
)

Definition at line 2884 of file ppl_prolog.icc.

References widening_assign().

02885                                                           {
02886   return widening_assign(t_lhs, t_rhs, &Polyhedron::H79_widening_assign);
02887 }

Prolog_foreign_return_type ppl_Polyhedron_H79_widening_assign_with_tokens ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs,
Prolog_term_ref  t_ti,
Prolog_term_ref  t_to 
)

Definition at line 2875 of file ppl_prolog.icc.

References widening_assign_with_tokens().

02878                                                                      {
02879   return widening_assign_with_tokens(t_lhs, t_rhs, t_ti, t_to,
02880                                     &Polyhedron::H79_widening_assign);
02881 }

Prolog_foreign_return_type ppl_Polyhedron_intersection_assign ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs 
)

Definition at line 2461 of file ppl_prolog.icc.

References bop_assign().

02462                                                           {
02463   return bop_assign(t_lhs, t_rhs,
02464                     &Polyhedron::intersection_assign);
02465 }

Prolog_foreign_return_type ppl_Polyhedron_intersection_assign_and_minimize ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs 
)

Definition at line 2468 of file ppl_prolog.icc.

References bop_assign_and_minimize().

02469                                                                        {
02470   return bop_assign_and_minimize(t_lhs, t_rhs,
02471                     &Polyhedron::intersection_assign_and_minimize);
02472 }

Prolog_foreign_return_type ppl_Polyhedron_is_bounded ( Prolog_term_ref  t_ph  ) 

Definition at line 2052 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, Parma_Polyhedra_Library::Polyhedron::is_bounded(), PROLOG_SUCCESS, and term_to_polyhedron_handle().

02052                                                 {
02053   try {
02054     const Polyhedron* ph = term_to_polyhedron_handle(t_ph);
02055     CHECK(ph);
02056     if (ph->is_bounded())
02057       return PROLOG_SUCCESS;
02058   }
02059   CATCH_ALL;
02060 }

Prolog_foreign_return_type ppl_Polyhedron_is_disjoint_from_Polyhedron ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs 
)

Definition at line 2249 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, Parma_Polyhedra_Library::Polyhedron::is_disjoint_from(), PROLOG_SUCCESS, and term_to_polyhedron_handle().

02250                                                                   {
02251   try {
02252     const Polyhedron* lhs = term_to_polyhedron_handle(t_lhs);
02253     const Polyhedron* rhs = term_to_polyhedron_handle(t_rhs);
02254     CHECK(lhs);
02255     CHECK(rhs);
02256     if (lhs->is_disjoint_from(*rhs))
02257       return PROLOG_SUCCESS;
02258   }
02259   CATCH_ALL;
02260 }

Prolog_foreign_return_type ppl_Polyhedron_is_empty ( Prolog_term_ref  t_ph  ) 

Definition at line 2030 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, Parma_Polyhedra_Library::Polyhedron::is_empty(), PROLOG_SUCCESS, and term_to_polyhedron_handle().

02030                                               {
02031   try {
02032     const Polyhedron* ph = term_to_polyhedron_handle(t_ph);
02033     CHECK(ph);
02034     if (ph->is_empty())
02035       return PROLOG_SUCCESS;
02036   }
02037   CATCH_ALL;
02038 }

Prolog_foreign_return_type ppl_Polyhedron_is_topologically_closed ( Prolog_term_ref  t_ph  ) 

Definition at line 2199 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, Parma_Polyhedra_Library::Polyhedron::is_topologically_closed(), PROLOG_SUCCESS, and term_to_polyhedron_handle().

02199                                                              {
02200   try {
02201     const Polyhedron* ph = term_to_polyhedron_handle(t_ph);
02202     CHECK(ph);
02203     if (ph->is_topologically_closed())
02204       return PROLOG_SUCCESS;
02205   }
02206   CATCH_ALL;
02207 }

Prolog_foreign_return_type ppl_Polyhedron_is_universe ( Prolog_term_ref  t_ph  ) 

Definition at line 2041 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, Parma_Polyhedra_Library::Polyhedron::is_universe(), PROLOG_SUCCESS, and term_to_polyhedron_handle().

02041                                                  {
02042   try {
02043     const Polyhedron* ph = term_to_polyhedron_handle(t_ph);
02044     CHECK(ph);
02045     if (ph->is_universe())
02046       return PROLOG_SUCCESS;
02047   }
02048   CATCH_ALL;
02049 }

Prolog_foreign_return_type ppl_Polyhedron_limited_BHRZ03_extrapolation_assign ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs,
Prolog_term_ref  t_clist 
)

Definition at line 2837 of file ppl_prolog.icc.

References limited_extrapolation_assign().

02839                                                                             {
02840   return limited_extrapolation_assign(t_lhs,
02841                                       t_rhs,
02842                                       t_clist,
02843                                       &Polyhedron::
02844                                       limited_BHRZ03_extrapolation_assign);
02845 }

Prolog_foreign_return_type ppl_Polyhedron_limited_BHRZ03_extrapolation_assign_with_tokens ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs,
Prolog_term_ref  t_clist,
Prolog_term_ref  t_ti,
Prolog_term_ref  t_to 
)

Definition at line 2821 of file ppl_prolog.icc.

References limited_extrapolation_assign_with_tokens().

02826                                                           {
02827   return limited_extrapolation_assign_with_tokens(t_lhs,
02828                                       t_rhs,
02829                                       t_clist,
02830                                       t_ti,
02831                                       t_to,
02832                                       &Polyhedron::
02833                                       limited_BHRZ03_extrapolation_assign);
02834 }

Prolog_foreign_return_type ppl_Polyhedron_limited_H79_extrapolation_assign ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs,
Prolog_term_ref  t_clist 
)

Definition at line 2906 of file ppl_prolog.icc.

References limited_extrapolation_assign().

02908                                                                          {
02909   return limited_extrapolation_assign(t_lhs,
02910                                       t_rhs,
02911                                       t_clist,
02912                                       &Polyhedron::
02913                                       limited_H79_extrapolation_assign);
02914 }

Prolog_foreign_return_type ppl_Polyhedron_limited_H79_extrapolation_assign_with_tokens ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs,
Prolog_term_ref  t_clist,
Prolog_term_ref  t_ti,
Prolog_term_ref  t_to 
)

Definition at line 2890 of file ppl_prolog.icc.

References limited_extrapolation_assign_with_tokens().

02895                                                                       {
02896   return limited_extrapolation_assign_with_tokens(t_lhs,
02897                                       t_rhs,
02898                                       t_clist,
02899                                       t_ti,
02900                                       t_to,
02901                                       &Polyhedron::
02902                                       limited_H79_extrapolation_assign);
02903 }

Prolog_foreign_return_type ppl_Polyhedron_map_space_dimensions ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_pfunc 
)

Definition at line 3109 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, check_nil_terminating(), Parma_Polyhedra_Library::Variable::id(), Parma_Polyhedra_Library::Polyhedron::map_space_dimensions(), PROLOG_FAILURE, Prolog_get_arg(), Prolog_get_compound_name_arity(), Prolog_get_cons(), Prolog_is_cons(), Prolog_new_term_ref(), PROLOG_SUCCESS, Parma_Polyhedra_Library::Polyhedron::space_dimension(), term_to_polyhedron_handle(), and term_to_Variable().

03110                                                              {
03111   try {
03112     Polyhedron* ph = term_to_polyhedron_handle(t_ph);
03113     dimension_type space_dim = ph->space_dimension();
03114     CHECK(ph);
03115     PFunc pfunc;
03116     Prolog_term_ref t_pair = Prolog_new_term_ref();
03117     while (Prolog_is_cons(t_pfunc)) {
03118       Prolog_get_cons(t_pfunc, t_pair, t_pfunc);
03119       Prolog_atom functor;
03120       int arity;
03121       Prolog_get_compound_name_arity(t_pair, &functor, &arity);
03122       if (arity != 2 || functor != a_minus)
03123         return PROLOG_FAILURE;
03124       Prolog_term_ref t_i = Prolog_new_term_ref();
03125       Prolog_term_ref t_j = Prolog_new_term_ref();
03126       Prolog_get_arg(1, t_pair, t_i);
03127       Prolog_get_arg(2, t_pair, t_j);
03128       dimension_type i = term_to_Variable(t_i).id();
03129       dimension_type j = term_to_Variable(t_j).id();
03130       if (i >= space_dim || !pfunc.insert(i, j))
03131         return PROLOG_FAILURE;
03132     }
03133 
03134     // Check the list is properly terminated.
03135     check_nil_terminating(t_pfunc);
03136 
03137     ph->map_space_dimensions(pfunc);
03138     return PROLOG_SUCCESS;
03139   }
03140   CATCH_ALL;
03141 
03142 }

Prolog_foreign_return_type ppl_Polyhedron_maximize ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_le_expr,
Prolog_term_ref  t_n,
Prolog_term_ref  t_d,
Prolog_term_ref  t_max 
)

Definition at line 2089 of file ppl_prolog.icc.

References build_linear_expression(), CATCH_ALL, CHECK, Coefficient_to_integer_term(), Parma_Polyhedra_Library::Polyhedron::maximize(), Prolog_new_term_ref(), Prolog_put_atom(), PROLOG_SUCCESS, Prolog_unify(), and term_to_polyhedron_handle().

02093                                                {
02094  try {
02095     const Polyhedron* ph = term_to_polyhedron_handle(t_ph);
02096     CHECK(ph);
02097     const Linear_Expression le = build_linear_expression(t_le_expr);
02098     Coefficient n;
02099     Coefficient d;
02100     bool max;
02101     if (ph->maximize(le, n, d, max)) {
02102       Prolog_term_ref t = Prolog_new_term_ref();
02103       Prolog_atom a = (max ? a_true : a_false);
02104       Prolog_put_atom(t, a);
02105       if (Prolog_unify(t_n, Coefficient_to_integer_term(n))
02106           && Prolog_unify(t_d, Coefficient_to_integer_term(d))
02107           && Prolog_unify(t_max, t))
02108         return PROLOG_SUCCESS;
02109     }
02110  }
02111  CATCH_ALL;
02112 }

Prolog_foreign_return_type ppl_Polyhedron_maximize_with_point ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_le_expr,
Prolog_term_ref  t_n,
Prolog_term_ref  t_d,
Prolog_term_ref  t_max,
Prolog_term_ref  t_g 
)

Definition at line 2115 of file ppl_prolog.icc.

References build_linear_expression(), CATCH_ALL, CHECK, Coefficient_to_integer_term(), generator_term(), Parma_Polyhedra_Library::Polyhedron::maximize(), Prolog_new_term_ref(), Prolog_put_atom(), PROLOG_SUCCESS, Prolog_unify(), and term_to_polyhedron_handle().

Referenced by init(), and ppl_sicstus_init().

02120                                                         {
02121  try {
02122     const Polyhedron* ph = term_to_polyhedron_handle(t_ph);
02123     CHECK(ph);
02124     const Linear_Expression le = build_linear_expression(t_le_expr);
02125     Coefficient n;
02126     Coefficient d;
02127     bool max;
02128     Generator g(point());
02129     if (ph->maximize(le, n, d, max, g)) {
02130       Prolog_term_ref t = Prolog_new_term_ref();
02131       Prolog_atom a = (max ? a_true : a_false);
02132       Prolog_put_atom(t, a);
02133       if (Prolog_unify(t_n, Coefficient_to_integer_term(n))
02134           && Prolog_unify(t_d, Coefficient_to_integer_term(d))
02135           && Prolog_unify(t_max, t)
02136           && Prolog_unify(t_g, generator_term(g)))
02137         return PROLOG_SUCCESS;
02138     }
02139  }
02140  CATCH_ALL;
02141 }

Prolog_foreign_return_type ppl_Polyhedron_minimize ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_le_expr,
Prolog_term_ref  t_n,
Prolog_term_ref  t_d,
Prolog_term_ref  t_min 
)

Definition at line 2144 of file ppl_prolog.icc.

References build_linear_expression(), CATCH_ALL, CHECK, Coefficient_to_integer_term(), Parma_Polyhedra_Library::Polyhedron::minimize(), Prolog_new_term_ref(), Prolog_put_atom(), PROLOG_SUCCESS, Prolog_unify(), and term_to_polyhedron_handle().

02148                                                {
02149  try {
02150     const Polyhedron* ph = term_to_polyhedron_handle(t_ph);
02151     CHECK(ph);
02152     const Linear_Expression le = build_linear_expression(t_le_expr);
02153     Coefficient n;
02154     Coefficient d;
02155     bool min;
02156     if (ph->minimize(le, n, d, min)) {
02157       Prolog_term_ref t = Prolog_new_term_ref();
02158       Prolog_atom a = (min ? a_true : a_false);
02159       Prolog_put_atom(t, a);
02160       if (Prolog_unify(t_n, Coefficient_to_integer_term(n))
02161           && Prolog_unify(t_d, Coefficient_to_integer_term(d))
02162           && Prolog_unify(t_min, t))
02163         return PROLOG_SUCCESS;
02164     }
02165  }
02166   CATCH_ALL;
02167 }

Prolog_foreign_return_type ppl_Polyhedron_minimize_with_point ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_le_expr,
Prolog_term_ref  t_n,
Prolog_term_ref  t_d,
Prolog_term_ref  t_min,
Prolog_term_ref  t_g 
)

Definition at line 2170 of file ppl_prolog.icc.

References build_linear_expression(), CATCH_ALL, CHECK, Coefficient_to_integer_term(), generator_term(), Parma_Polyhedra_Library::Polyhedron::minimize(), Prolog_new_term_ref(), Prolog_put_atom(), PROLOG_SUCCESS, Prolog_unify(), and term_to_polyhedron_handle().

Referenced by init(), and ppl_sicstus_init().

02175                                                         {
02176  try {
02177     const Polyhedron* ph = term_to_polyhedron_handle(t_ph);
02178     CHECK(ph);
02179     const Linear_Expression le = build_linear_expression(t_le_expr);
02180     Coefficient n;
02181     Coefficient d;
02182     bool min;
02183     Generator g(point());
02184     if (ph->minimize(le, n, d, min, g)) {
02185       Prolog_term_ref t = Prolog_new_term_ref();
02186       Prolog_atom a = (min ? a_true : a_false);
02187       Prolog_put_atom(t, a);
02188       if (Prolog_unify(t_n, Coefficient_to_integer_term(n))
02189           && Prolog_unify(t_d, Coefficient_to_integer_term(d))
02190           && Prolog_unify(t_min, t)
02191           && Prolog_unify(t_g, generator_term(g)))
02192         return PROLOG_SUCCESS;
02193     }
02194  }
02195  CATCH_ALL;
02196 }

Prolog_foreign_return_type ppl_Polyhedron_OK ( Prolog_term_ref  t_ph  ) 

Definition at line 2277 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, Parma_Polyhedra_Library::Polyhedron::OK(), PROLOG_SUCCESS, and term_to_polyhedron_handle().

02277                                         {
02278   try {
02279     const Polyhedron* ph = term_to_polyhedron_handle(t_ph);
02280     CHECK(ph);
02281     if (ph->OK())
02282       return PROLOG_SUCCESS;
02283   }
02284   CATCH_ALL;
02285 }

Prolog_foreign_return_type ppl_Polyhedron_poly_difference_assign ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs 
)

Definition at line 2489 of file ppl_prolog.icc.

References bop_assign().

02490                                                              {
02491   return bop_assign(t_lhs, t_rhs,
02492                     &Polyhedron::poly_difference_assign);
02493 }

Prolog_foreign_return_type ppl_Polyhedron_poly_hull_assign ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs 
)

Definition at line 2475 of file ppl_prolog.icc.

References bop_assign().

02476                                                        {
02477   return bop_assign(t_lhs, t_rhs,
02478                     &Polyhedron::poly_hull_assign);
02479 }

Prolog_foreign_return_type ppl_Polyhedron_poly_hull_assign_and_minimize ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs 
)

Definition at line 2482 of file ppl_prolog.icc.

References bop_assign_and_minimize().

02483                                                                     {
02484   return bop_assign_and_minimize(t_lhs, t_rhs,
02485                                  &Polyhedron::poly_hull_assign_and_minimize);
02486 }

Prolog_foreign_return_type ppl_Polyhedron_relation_with_constraint ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_c,
Prolog_term_ref  t_r 
)

Definition at line 1870 of file ppl_prolog.icc.

References build_constraint(), CATCH_ALL, CHECK, Parma_Polyhedra_Library::Poly_Con_Relation::implies(), Prolog_construct_cons(), Prolog_new_term_ref(), Prolog_put_atom(), PROLOG_SUCCESS, Prolog_unify(), Parma_Polyhedra_Library::Polyhedron::relation_with(), and term_to_polyhedron_handle().

Referenced by init(), and ppl_sicstus_init().

01872                                                              {
01873   try {
01874     Polyhedron* ph = term_to_polyhedron_handle(t_ph);
01875     CHECK(ph);
01876     Poly_Con_Relation r = ph->relation_with(build_constraint(t_c));
01877 
01878     Prolog_term_ref tail = Prolog_new_term_ref();
01879     Prolog_put_atom(tail, a_nil);
01880     while (r != Poly_Con_Relation::nothing()) {
01881       if (r.implies(Poly_Con_Relation::is_disjoint())) {
01882         Prolog_term_ref t_dis = Prolog_new_term_ref();
01883         Prolog_put_atom(t_dis, a_is_disjoint);
01884         Prolog_construct_cons(tail, t_dis, tail);
01885         r = r - Poly_Con_Relation::is_disjoint();
01886       }
01887       else if (r.implies(Poly_Con_Relation::strictly_intersects())) {
01888         Prolog_term_ref t_sin = Prolog_new_term_ref();
01889         Prolog_put_atom(t_sin, a_strictly_intersects);
01890         Prolog_construct_cons(tail, t_sin, tail);
01891         r = r - Poly_Con_Relation::strictly_intersects();
01892       }
01893       else if (r.implies(Poly_Con_Relation::is_included())) {
01894         Prolog_term_ref t_inc = Prolog_new_term_ref();
01895         Prolog_put_atom(t_inc, a_is_included);
01896         Prolog_construct_cons(tail, t_inc, tail);
01897         r = r - Poly_Con_Relation::is_included();
01898       }
01899       else if (r.implies(Poly_Con_Relation::saturates())) {
01900         Prolog_term_ref t_sat = Prolog_new_term_ref();
01901         Prolog_put_atom(t_sat, a_saturates);
01902         Prolog_construct_cons(tail, t_sat, tail);
01903         r = r - Poly_Con_Relation::saturates();
01904       }
01905     }
01906     if (Prolog_unify(t_r, tail))
01907       return PROLOG_SUCCESS;
01908   }
01909   CATCH_ALL;
01910 }

Prolog_foreign_return_type ppl_Polyhedron_relation_with_generator ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_g,
Prolog_term_ref  t_r 
)

Definition at line 1913 of file ppl_prolog.icc.

References build_generator(), CATCH_ALL, CHECK, Parma_Polyhedra_Library::Poly_Gen_Relation::implies(), Prolog_construct_cons(), Prolog_new_term_ref(), Prolog_put_atom(), PROLOG_SUCCESS, Prolog_unify(), Parma_Polyhedra_Library::Polyhedron::relation_with(), and term_to_polyhedron_handle().

Referenced by init(), and ppl_sicstus_init().

01915                                                             {
01916   try {
01917     Polyhedron* ph = term_to_polyhedron_handle(t_ph);
01918     CHECK(ph);
01919     Poly_Gen_Relation r = ph->relation_with(build_generator(t_g));
01920 
01921     Prolog_term_ref tail = Prolog_new_term_ref();
01922     Prolog_put_atom(tail, a_nil);
01923     while (r != Poly_Gen_Relation::nothing()) {
01924       if (r.implies(Poly_Gen_Relation::subsumes())) {
01925         Prolog_term_ref t_sub = Prolog_new_term_ref();
01926         Prolog_put_atom(t_sub, a_subsumes);
01927         Prolog_construct_cons(tail, t_sub, tail);
01928         r = r - Poly_Gen_Relation::subsumes();
01929       }
01930     }
01931     if (Prolog_unify(t_r, tail))
01932       return PROLOG_SUCCESS;
01933   }
01934   CATCH_ALL;
01935 }

Prolog_foreign_return_type ppl_Polyhedron_remove_higher_space_dimensions ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_nd 
)

Definition at line 3006 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, PROLOG_SUCCESS, Parma_Polyhedra_Library::Polyhedron::remove_higher_space_dimensions(), and term_to_polyhedron_handle().

03007                                                                     {
03008   try {
03009     Polyhedron* ph = term_to_polyhedron_handle(t_ph);
03010     CHECK(ph);
03011     ph->remove_higher_space_dimensions(term_to_unsigned<dimension_type>(t_nd));
03012     return PROLOG_SUCCESS;
03013   }
03014   CATCH_ALL;
03015 }

Prolog_foreign_return_type ppl_Polyhedron_remove_space_dimensions ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_vlist 
)

Definition at line 2984 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, check_nil_terminating(), Prolog_get_cons(), Prolog_is_cons(), Prolog_new_term_ref(), PROLOG_SUCCESS, Parma_Polyhedra_Library::Polyhedron::remove_space_dimensions(), term_to_polyhedron_handle(), and term_to_Variable().

02985                                                                 {
02986   try {
02987     Polyhedron* ph = term_to_polyhedron_handle(t_ph);
02988     CHECK(ph);
02989     Variables_Set dead_variables;
02990     Prolog_term_ref v = Prolog_new_term_ref();
02991     while (Prolog_is_cons(t_vlist)) {
02992       Prolog_get_cons(t_vlist, v, t_vlist);
02993       dead_variables.insert(term_to_Variable(v));
02994     }
02995 
02996     // Check the list is properly terminated.
02997     check_nil_terminating(t_vlist);
02998 
02999     ph->remove_space_dimensions(dead_variables);
03000     return PROLOG_SUCCESS;
03001   }
03002   CATCH_ALL;
03003 }

Prolog_foreign_return_type ppl_Polyhedron_space_dimension ( Prolog_term_ref  t_ph,
Prolog_term_ref  t_sd 
)

Definition at line 1768 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, PROLOG_SUCCESS, Parma_Polyhedra_Library::Polyhedron::space_dimension(), term_to_polyhedron_handle(), and unify_ulong().

01768                                                                            {
01769   try {
01770     const Polyhedron* ph = term_to_polyhedron_handle(t_ph);
01771     CHECK(ph);
01772     if (unify_ulong(t_sd, ph->space_dimension()))
01773       return PROLOG_SUCCESS;
01774   }
01775   CATCH_ALL;
01776 }

Prolog_foreign_return_type ppl_Polyhedron_strictly_contains_Polyhedron ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs 
)

Definition at line 2235 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, PROLOG_SUCCESS, Parma_Polyhedra_Library::Polyhedron::strictly_contains(), and term_to_polyhedron_handle().

02236                                                                    {
02237   try {
02238     const Polyhedron* lhs = term_to_polyhedron_handle(t_lhs);
02239     const Polyhedron* rhs = term_to_polyhedron_handle(t_rhs);
02240     CHECK(lhs);
02241     CHECK(rhs);
02242     if (lhs->strictly_contains(*rhs))
02243       return PROLOG_SUCCESS;
02244   }
02245   CATCH_ALL;
02246 }

Prolog_foreign_return_type ppl_Polyhedron_swap ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs 
)

Definition at line 1744 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, PROLOG_SUCCESS, Parma_Polyhedra_Library::Polyhedron::swap(), and term_to_polyhedron_handle().

Referenced by init(), and ppl_sicstus_init().

01744                                                                   {
01745   try {
01746     Polyhedron* lhs = term_to_polyhedron_handle(t_lhs);
01747     Polyhedron* rhs = term_to_polyhedron_handle(t_rhs);
01748     CHECK(lhs);
01749     CHECK(rhs);
01750     lhs->swap(*rhs);
01751     return PROLOG_SUCCESS;
01752   }
01753   CATCH_ALL;
01754 }

Prolog_foreign_return_type ppl_Polyhedron_time_elapse_assign ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs 
)

Definition at line 2496 of file ppl_prolog.icc.

References bop_assign().

02497                                                          {
02498   return bop_assign(t_lhs, t_rhs,
02499                     &Polyhedron::time_elapse_assign);
02500 }

Prolog_foreign_return_type ppl_Polyhedron_topological_closure_assign ( Prolog_term_ref  t_ph  ) 

Definition at line 2210 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, PROLOG_SUCCESS, term_to_polyhedron_handle(), and Parma_Polyhedra_Library::Polyhedron::topological_closure_assign().

02210                                                                 {
02211   try {
02212     Polyhedron* ph = term_to_polyhedron_handle(t_ph);
02213     CHECK(ph);
02214     ph->topological_closure_assign();
02215     return PROLOG_SUCCESS;
02216   }
02217   CATCH_ALL;
02218 }

Prolog_foreign_return_type ppl_reset_timeout (  ) 

Definition at line 1222 of file ppl_prolog.icc.

References CATCH_ALL, PROLOG_SUCCESS, and reset_timeout().

Referenced by init(), and ppl_sicstus_init().

01222                     {
01223   try {
01224     reset_timeout();
01225     return PROLOG_SUCCESS;
01226   }
01227   CATCH_ALL;
01228 }

Prolog_foreign_return_type ppl_set_timeout ( Prolog_term_ref  t_time  ) 

Definition at line 1206 of file ppl_prolog.icc.

References Parma_Polyhedra_Library::abandon_expensive_computations, CATCH_ALL, PROLOG_SUCCESS, and reset_timeout().

Referenced by init(), and ppl_sicstus_init().

01206                                         {
01207   try {
01208     // In case a timeout was already set.
01209     reset_timeout();
01210     static timeout_exception e;
01211     unsigned hundredth_secs = term_to_unsigned<unsigned>(t_time);
01212     p_timeout_object =
01213       new Parma_Watchdog_Library::Watchdog(hundredth_secs,
01214                                            abandon_expensive_computations,
01215                                            e);
01216     return PROLOG_SUCCESS;
01217   }
01218   CATCH_ALL;
01219 }

Prolog_foreign_return_type ppl_set_timeout_exception_atom ( Prolog_term_ref  t_tea  ) 

Definition at line 1165 of file ppl_prolog.icc.

References CATCH_ALL, Prolog_atom_term_from_string(), Prolog_construct_compound(), PROLOG_FAILURE, Prolog_get_atom_name(), Prolog_is_atom(), Prolog_new_term_ref(), Prolog_raise_exception(), and PROLOG_SUCCESS.

Referenced by init(), and ppl_sicstus_init().

01165                                                       {
01166   try {
01167     if (Prolog_is_atom(t_tea)) {
01168       Prolog_atom tea;
01169       if (Prolog_get_atom_name(t_tea, &tea)) {
01170         timeout_exception_atom = tea;
01171         return PROLOG_SUCCESS;
01172       }
01173     }
01174     Prolog_term_ref found = Prolog_new_term_ref();
01175     Prolog_construct_compound(found, a_found, t_tea);
01176 
01177     Prolog_term_ref expected = Prolog_new_term_ref();
01178     Prolog_construct_compound(expected, a_expected,
01179                               Prolog_atom_term_from_string("atom"));
01180 
01181     Prolog_term_ref where = Prolog_new_term_ref();
01182     Prolog_construct_compound(where, a_where,
01183                               Prolog_atom_term_from_string
01184                               ("ppl_set_timeout_exception_atom"));
01185 
01186     Prolog_term_ref exception_term = Prolog_new_term_ref();
01187     Prolog_construct_compound(exception_term, a_ppl_invalid_argument,
01188                               found, expected, where);
01189     Prolog_raise_exception(exception_term);
01190     return PROLOG_FAILURE;
01191   }
01192   CATCH_ALL;
01193 }

Prolog_foreign_return_type ppl_timeout_exception_atom ( Prolog_term_ref  t  ) 

Definition at line 1196 of file ppl_prolog.icc.

References CATCH_ALL, PROLOG_FAILURE, Prolog_new_term_ref(), Prolog_put_atom(), PROLOG_SUCCESS, and Prolog_unify().

Referenced by init(), and ppl_sicstus_init().

01196                                               {
01197   try {
01198     Prolog_term_ref t_tea = Prolog_new_term_ref();
01199     Prolog_put_atom(t_tea, timeout_exception_atom);
01200     return Prolog_unify(t_tea, t) ? PROLOG_SUCCESS : PROLOG_FAILURE;
01201   }
01202   CATCH_ALL;
01203 }

Prolog_foreign_return_type ppl_version ( Prolog_term_ref  t_v  ) 

Definition at line 1088 of file ppl_prolog.icc.

References CATCH_ALL, Prolog_new_term_ref(), Prolog_put_atom_chars(), PROLOG_SUCCESS, Prolog_unify(), and Parma_Polyhedra_Library::version().

01088                                  {
01089   try {
01090     Prolog_term_ref tmp = Prolog_new_term_ref();
01091     Prolog_put_atom_chars(tmp, version());
01092     if (Prolog_unify(t_v, tmp))
01093       return PROLOG_SUCCESS;
01094   }
01095   CATCH_ALL;
01096 }

Prolog_foreign_return_type ppl_version_beta ( Prolog_term_ref  t_v  ) 

Definition at line 1079 of file ppl_prolog.icc.

References CATCH_ALL, PROLOG_SUCCESS, unify_ulong(), and Parma_Polyhedra_Library::version_beta().

01079                                       {
01080   try {
01081     if (unify_ulong(t_v, version_beta()))
01082       return PROLOG_SUCCESS;
01083   }
01084   CATCH_ALL;
01085 }

Prolog_foreign_return_type ppl_version_major ( Prolog_term_ref  t_v  ) 

Definition at line 1052 of file ppl_prolog.icc.

References CATCH_ALL, PROLOG_SUCCESS, unify_ulong(), and Parma_Polyhedra_Library::version_major().

01052                                        {
01053   try {
01054     if (unify_ulong(t_v, version_major()))
01055       return PROLOG_SUCCESS;
01056   }
01057   CATCH_ALL;
01058 }

Prolog_foreign_return_type ppl_version_minor ( Prolog_term_ref  t_v  ) 

Definition at line 1061 of file ppl_prolog.icc.

References CATCH_ALL, PROLOG_SUCCESS, unify_ulong(), and Parma_Polyhedra_Library::version_minor().

01061                                        {
01062   try {
01063     if (unify_ulong(t_v, version_minor()))
01064       return PROLOG_SUCCESS;
01065   }
01066   CATCH_ALL;
01067 }

Prolog_foreign_return_type ppl_version_revision ( Prolog_term_ref  t_v  ) 

Definition at line 1070 of file ppl_prolog.icc.

References CATCH_ALL, PROLOG_SUCCESS, unify_ulong(), and Parma_Polyhedra_Library::version_revision().

01070                                           {
01071   try {
01072     if (unify_ulong(t_v, version_revision()))
01073       return PROLOG_SUCCESS;
01074   }
01075   CATCH_ALL;
01076 }

Prolog_term_ref @198::Prolog_atom_term_from_string ( const char *  s  )  [static]

Definition at line 201 of file ppl_prolog.icc.

References Prolog_atom_from_string(), Prolog_new_term_ref(), and Prolog_put_atom().

Referenced by handle_exception(), and ppl_set_timeout_exception_atom().

00201                                             {
00202   Prolog_term_ref t = Prolog_new_term_ref();
00203   Prolog_put_atom(t, Prolog_atom_from_string(s));
00204   return t;
00205 }

void @198::reset_timeout (  )  [static]

Definition at line 550 of file ppl_prolog.icc.

References Parma_Polyhedra_Library::abandon_expensive_computations.

Referenced by handle_exception(), ppl_finalize(), ppl_reset_timeout(), and ppl_set_timeout().

00550                 {
00551   if (p_timeout_object) {
00552     delete p_timeout_object;
00553     p_timeout_object = 0;
00554     abandon_expensive_computations = 0;
00555   }
00556 }

bool @198::term_to_boundary ( Prolog_term_ref  t_b,
Boundary_Kind  kind,
bool &  finite,
bool &  closed,
Coefficient &  n,
Coefficient &  d 
) [static]

Definition at line 1531 of file ppl_prolog.icc.

References integer_term_to_Coefficient(), LOWER, Prolog_get_arg(), Prolog_get_atom_name(), Prolog_get_compound_name_arity(), Prolog_is_atom(), Prolog_is_compound(), Prolog_is_integer(), and Prolog_new_term_ref().

Referenced by ppl_new_C_Polyhedron_from_bounding_box(), and ppl_new_NNC_Polyhedron_from_bounding_box().

01533                                                  {
01534   if (!Prolog_is_compound(t_b))
01535     return false;
01536 
01537   Prolog_atom functor;
01538   int arity;
01539 
01540   Prolog_get_compound_name_arity(t_b, &functor, &arity);
01541   // A boundary term is either of the form c(Limit) or o(Limit).
01542   if (arity != 1 || (functor != a_c && functor != a_o))
01543     return false;
01544 
01545   Prolog_atom open_closed_atom = functor;
01546 
01547   Prolog_term_ref t_limit = Prolog_new_term_ref();
01548   Prolog_get_arg(1, t_b, t_limit);
01549   if (Prolog_is_integer(t_limit)) {
01550     // A finite, integral limit.
01551     finite = true;
01552     closed = (open_closed_atom == a_c);
01553     n = integer_term_to_Coefficient(t_limit);
01554     d = 1;
01555   }
01556   else if (Prolog_is_atom(t_limit)) {
01557     Prolog_atom a;
01558     Prolog_get_atom_name(t_limit, &a);
01559     Prolog_atom allowed_infinity = (kind == LOWER ? a_minf : a_pinf);
01560     // Only open bounds may be unbounded.
01561     if (a != allowed_infinity || open_closed_atom != a_o)
01562       return false;
01563 
01564     finite = false;
01565   }
01566   else if (Prolog_is_compound(t_limit)) {
01567     Prolog_get_compound_name_arity(t_limit, &functor, &arity);
01568     if (arity != 2 || functor != a_slash)
01569       return false;
01570 
01571     Prolog_term_ref t_n = Prolog_new_term_ref();
01572     Prolog_term_ref t_d = Prolog_new_term_ref();
01573     Prolog_get_arg(1, t_limit, t_n);
01574     Prolog_get_arg(2, t_limit, t_d);
01575 
01576     if (!Prolog_is_integer(t_n) || !Prolog_is_integer(t_d))
01577       return false;
01578     else {
01579       finite = true;
01580       closed = (open_closed_atom == a_c);
01581       n = integer_term_to_Coefficient(t_n);
01582       d = integer_term_to_Coefficient(t_d);
01583       // Catch negative denominators and divisions by zero here.
01584       if (d <= 0)
01585         return false;
01586     }
01587   }
01588   return true;
01589 }

Coefficient @198::term_to_Coefficient ( Prolog_term_ref  t  )  [static]

Prolog_atom @198::term_to_complexity_class ( Prolog_term_ref  t  )  [static]

Definition at line 1987 of file ppl_prolog.icc.

References name, Prolog_get_atom_name(), and Prolog_is_atom().

Referenced by ppl_Polyhedron_get_bounding_box().

01987                                             {
01988   if (Prolog_is_atom(t)) {
01989     Prolog_atom name;
01990     if (Prolog_get_atom_name(t, &name)
01991         && (name == a_polynomial || name == a_simplex || name == a_any))
01992       return name;
01993   }
01994   throw not_a_complexity_class(t);
01995 }

LP_Problem* @198::term_to_lp_problem_handle ( Prolog_term_ref  t_lp  )  [static]

Prolog_atom @198::term_to_optimization_mode ( Prolog_term_ref  t  )  [static]

Definition at line 1014 of file ppl_prolog.icc.

References name, Prolog_get_atom_name(), and Prolog_is_atom().

Referenced by ppl_LP_Problem_set_optimization_mode(), and ppl_new_LP_Problem().

01014                                              {
01015   if (Prolog_is_atom(t)) {
01016     Prolog_atom name;
01017     if (Prolog_get_atom_name(t, &name)
01018         && (name == a_max || name == a_min))
01019       return name;
01020   }
01021   throw not_an_optimization_mode(t);
01022 }

Polyhedron* @198::term_to_polyhedron_handle ( Prolog_term_ref  t_ph  )  [static]

Definition at line 994 of file ppl_prolog.icc.

References Prolog_get_address(), and Prolog_is_address().

Referenced by bop_assign(), bop_assign_and_minimize(), limited_extrapolation_assign(), limited_extrapolation_assign_with_tokens(), ppl_delete_Polyhedron(), ppl_new_C_Polyhedron_from_C_Polyhedron(), ppl_new_C_Polyhedron_from_NNC_Polyhedron(), ppl_new_NNC_Polyhedron_from_C_Polyhedron(), ppl_new_NNC_Polyhedron_from_NNC_Polyhedron(), ppl_Polyhedron_add_constraint(), ppl_Polyhedron_add_constraint_and_minimize(), ppl_Polyhedron_add_constraints(), ppl_Polyhedron_add_constraints_and_minimize(), ppl_Polyhedron_add_generator(), ppl_Polyhedron_add_generator_and_minimize(), ppl_Polyhedron_add_generators(), ppl_Polyhedron_add_generators_and_minimize(), ppl_Polyhedron_add_space_dimensions_and_embed(), ppl_Polyhedron_add_space_dimensions_and_project(), ppl_Polyhedron_affine_dimension(), ppl_Polyhedron_affine_image(), ppl_Polyhedron_affine_preimage(), ppl_Polyhedron_bounded_affine_image(), ppl_Polyhedron_bounded_affine_preimage(), ppl_Polyhedron_bounds_from_above(), ppl_Polyhedron_bounds_from_below(), ppl_Polyhedron_concatenate_assign(), ppl_Polyhedron_contains_Polyhedron(), ppl_Polyhedron_equals_Polyhedron(), ppl_Polyhedron_expand_space_dimension(), ppl_Polyhedron_fold_space_dimensions(), ppl_Polyhedron_generalized_affine_image(), ppl_Polyhedron_generalized_affine_image_lhs_rhs(), ppl_Polyhedron_generalized_affine_preimage(), ppl_Polyhedron_generalized_affine_preimage_lhs_rhs(), ppl_Polyhedron_get_bounding_box(), ppl_Polyhedron_get_constraints(), ppl_Polyhedron_get_generators(), ppl_Polyhedron_get_minimized_constraints(), ppl_Polyhedron_get_minimized_generators(), ppl_Polyhedron_is_bounded(), ppl_Polyhedron_is_disjoint_from_Polyhedron(), ppl_Polyhedron_is_empty(), ppl_Polyhedron_is_topologically_closed(), ppl_Polyhedron_is_universe(), ppl_Polyhedron_map_space_dimensions(), ppl_Polyhedron_maximize(), ppl_Polyhedron_maximize_with_point(), ppl_Polyhedron_minimize(), ppl_Polyhedron_minimize_with_point(), ppl_Polyhedron_OK(), ppl_Polyhedron_relation_with_constraint(), ppl_Polyhedron_relation_with_generator(), ppl_Polyhedron_remove_higher_space_dimensions(), ppl_Polyhedron_remove_space_dimensions(), ppl_Polyhedron_space_dimension(), ppl_Polyhedron_strictly_contains_Polyhedron(), ppl_Polyhedron_swap(), ppl_Polyhedron_topological_closure_assign(), widening_assign(), widening_assign_with_token(), and widening_assign_with_tokens().

00994                                                 {
00995   if (Prolog_is_address(t_ph)) {
00996     void* p;
00997     if (Prolog_get_address(t_ph, &p))
00998       return static_cast<Polyhedron*>(p);
00999   }
01000   throw not_a_polyhedron_handle(t_ph);
01001 }

Prolog_atom @198::term_to_relation ( Prolog_term_ref  t  )  [static]

Definition at line 2533 of file ppl_prolog.icc.

References name, Prolog_get_atom_name(), and Prolog_is_atom().

Referenced by term_to_relation_symbol().

02533                                     {
02534   if (Prolog_is_atom(t)) {
02535     Prolog_atom name;
02536     if (Prolog_get_atom_name(t, &name)
02537         && (name == a_equal || name == a_greater_than_equal ||
02538             name == a_equal_less_than || name == a_greater_than ||
02539             name == a_less_than))
02540       return name;
02541   }
02542   throw not_a_relation(t);
02543 }

Relation_Symbol @198::term_to_relation_symbol ( Prolog_term_ref  t_r  )  [static]

Prolog_atom @198::term_to_universe_or_empty ( Prolog_term_ref  t  )  [static]

Definition at line 678 of file ppl_prolog.icc.

References name, Prolog_get_atom_name(), and Prolog_is_atom().

Referenced by ppl_new_C_Polyhedron_from_space_dimension(), and ppl_new_NNC_Polyhedron_from_space_dimension().

00678                                              {
00679   if (Prolog_is_atom(t)) {
00680     Prolog_atom name;
00681     if (Prolog_get_atom_name(t, &name)
00682         && (name == a_universe || name == a_empty))
00683       return name;
00684   }
00685   throw not_universe_or_empty(t);
00686 }

template<typename U>
U @198::term_to_unsigned ( Prolog_term_ref  t  )  [inline, static]

Definition at line 654 of file ppl_prolog.icc.

References Parma_Polyhedra_Library::assign_r(), integer_term_to_Coefficient(), Prolog_get_long(), Prolog_is_integer(), and Parma_Polyhedra_Library::Checked_Number< T, Policy >::raw_value().

00654                                     {
00655   if (!Prolog_is_integer(t))
00656     throw not_unsigned_integer(t);
00657 
00658   U d = 0;
00659   long l;
00660   if (Prolog_get_long(t, &l))
00661     if (l < 0)
00662       throw not_unsigned_integer(t);
00663     else if (static_cast<unsigned long>(l) > std::numeric_limits<U>::max())
00664       throw Prolog_unsigned_out_of_range(t, std::numeric_limits<U>::max());
00665     else
00666       d = l;
00667   else {
00668     Coefficient v = integer_term_to_Coefficient(t);
00669     if (v < 0)
00670       throw not_unsigned_integer(t);
00671     if (assign_r(d, raw_value(v), ROUND_NOT_NEEDED) != V_EQ)
00672       throw Prolog_unsigned_out_of_range(t, std::numeric_limits<U>::max());
00673   }
00674   return d;
00675 }

Variable @198::term_to_Variable ( Prolog_term_ref  t  )  [static]

bool @198::unify_long ( Prolog_term_ref  t,
long  l 
) [static]

bool @198::unify_ulong ( Prolog_term_ref  t,
unsigned long  l 
) [static]

Prolog_term_ref @198::variable_term ( dimension_type  varid  )  [static]

Definition at line 631 of file ppl_prolog.icc.

References Prolog_construct_compound(), Prolog_new_term_ref(), and Prolog_put_ulong().

Referenced by get_linear_expression().

00631                                     {
00632   Prolog_term_ref v = Prolog_new_term_ref();
00633   Prolog_put_ulong(v, varid);
00634   Prolog_term_ref t = Prolog_new_term_ref();
00635   Prolog_construct_compound(t, a_dollar_VAR, v);
00636   return t;
00637 }

Prolog_foreign_return_type @198::widening_assign ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs,
void(Polyhedron::*)(const Polyhedron &, unsigned *tp)  widening_assign 
) [static]

Definition at line 2675 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, PROLOG_SUCCESS, and term_to_polyhedron_handle().

Referenced by ppl_Polyhedron_BHRZ03_widening_assign(), and ppl_Polyhedron_H79_widening_assign().

02678                                                                     {
02679   try {
02680     Polyhedron* lhs = term_to_polyhedron_handle(t_lhs);
02681     const Polyhedron* rhs = term_to_polyhedron_handle(t_rhs);
02682     CHECK(lhs);
02683     CHECK(rhs);
02684     (lhs->*widening_assign)(*rhs, 0);
02685     return PROLOG_SUCCESS;
02686   }
02687   CATCH_ALL;
02688 }

Prolog_foreign_return_type @198::widening_assign_with_token ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs,
Prolog_term_ref  t_t,
void(Polyhedron::*widening_assign)(const Polyhedron &,unsigned *tp)   
) [static]

Definition at line 2712 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, PROLOG_SUCCESS, term_to_polyhedron_handle(), and unify_long().

Referenced by ppl_Polyhedron_BHRZ03_widening_assign_with_token().

02717                                                                  {
02718   try {
02719     Polyhedron* lhs = term_to_polyhedron_handle(t_lhs);
02720     const Polyhedron* rhs = term_to_polyhedron_handle(t_rhs);
02721     CHECK(lhs);
02722     CHECK(rhs);
02723     unsigned t = 1;
02724     (lhs->*widening_assign)(*rhs, &t);
02725     if (unify_long(t_t, 1-t))
02726       return PROLOG_SUCCESS;
02727   }
02728   CATCH_ALL;
02729 }

Prolog_foreign_return_type @198::widening_assign_with_tokens ( Prolog_term_ref  t_lhs,
Prolog_term_ref  t_rhs,
Prolog_term_ref  t_ti,
Prolog_term_ref  t_to,
void(Polyhedron::*widening_assign)(const Polyhedron &,unsigned *tp)   
) [static]

Definition at line 2691 of file ppl_prolog.icc.

References CATCH_ALL, CHECK, PROLOG_SUCCESS, term_to_polyhedron_handle(), and unify_long().

Referenced by ppl_Polyhedron_BHRZ03_widening_assign_with_tokens(), and ppl_Polyhedron_H79_widening_assign_with_tokens().

02697                                                                   {
02698   try {
02699     Polyhedron* lhs = term_to_polyhedron_handle(t_lhs);
02700     const Polyhedron* rhs = term_to_polyhedron_handle(t_rhs);
02701     CHECK(lhs);
02702     CHECK(rhs);
02703     unsigned t = term_to_unsigned<unsigned>(t_ti);
02704     (lhs->*widening_assign)(*rhs, &t);
02705       if (unify_long(t_to, t))
02706       return PROLOG_SUCCESS;
02707   }
02708   CATCH_ALL;
02709 }


Variable Documentation

Prolog_atom a_any [static]

Definition at line 108 of file ppl_prolog.icc.

Definition at line 48 of file ppl_prolog.icc.

Prolog_atom a_c [static]

Definition at line 76 of file ppl_prolog.icc.

Definition at line 64 of file ppl_prolog.icc.

Definition at line 43 of file ppl_prolog.icc.

Prolog_atom a_empty [static]

Definition at line 79 of file ppl_prolog.icc.

Prolog_atom a_equal [static]

Definition at line 56 of file ppl_prolog.icc.

Definition at line 55 of file ppl_prolog.icc.

Definition at line 126 of file ppl_prolog.icc.

Prolog_atom a_false [static]

Definition at line 118 of file ppl_prolog.icc.

Prolog_atom a_found [static]

Definition at line 127 of file ppl_prolog.icc.

Definition at line 58 of file ppl_prolog.icc.

Definition at line 57 of file ppl_prolog.icc.

Prolog_atom a_i [static]

Definition at line 99 of file ppl_prolog.icc.

Definition at line 67 of file ppl_prolog.icc.

Definition at line 69 of file ppl_prolog.icc.

Definition at line 54 of file ppl_prolog.icc.

Prolog_atom a_line [static]

Definition at line 61 of file ppl_prolog.icc.

Prolog_atom a_max [static]

Definition at line 85 of file ppl_prolog.icc.

Prolog_atom a_min [static]

Definition at line 88 of file ppl_prolog.icc.

Prolog_atom a_minf [static]

Definition at line 102 of file ppl_prolog.icc.

Prolog_atom a_minus [static]

Definition at line 47 of file ppl_prolog.icc.

Prolog_atom a_nil [static]

Definition at line 40 of file ppl_prolog.icc.

Prolog_atom a_o [static]

Definition at line 96 of file ppl_prolog.icc.

Definition at line 93 of file ppl_prolog.icc.

Definition at line 114 of file ppl_prolog.icc.

Prolog_atom a_pinf [static]

Definition at line 103 of file ppl_prolog.icc.

Prolog_atom a_plus [static]

Definition at line 46 of file ppl_prolog.icc.

Prolog_atom a_point [static]

Definition at line 63 of file ppl_prolog.icc.

Definition at line 106 of file ppl_prolog.icc.

Definition at line 123 of file ppl_prolog.icc.

Definition at line 121 of file ppl_prolog.icc.

Definition at line 124 of file ppl_prolog.icc.

Definition at line 122 of file ppl_prolog.icc.

Definition at line 125 of file ppl_prolog.icc.

Prolog_atom a_ray [static]

Definition at line 62 of file ppl_prolog.icc.

Definition at line 70 of file ppl_prolog.icc.

Definition at line 107 of file ppl_prolog.icc.

Prolog_atom a_slash [static]

Definition at line 51 of file ppl_prolog.icc.

Definition at line 68 of file ppl_prolog.icc.

Definition at line 73 of file ppl_prolog.icc.

Definition at line 111 of file ppl_prolog.icc.

Prolog_atom a_true [static]

Definition at line 117 of file ppl_prolog.icc.

Definition at line 92 of file ppl_prolog.icc.

Definition at line 91 of file ppl_prolog.icc.

Definition at line 82 of file ppl_prolog.icc.

Prolog_atom a_where [static]

Definition at line 128 of file ppl_prolog.icc.

std::set<dimension_type> codomain

Definition at line 3058 of file ppl_prolog.icc.

const char* name

Definition at line 37 of file ppl_prolog.icc.

Definition at line 131 of file ppl_prolog.icc.

Referenced by ppl_sicstus_deinit(), and ppl_sicstus_init().

Parma_Watchdog_Library::Watchdog* p_timeout_object = 0 [static]

Definition at line 547 of file ppl_prolog.icc.

struct { ... } prolog_atoms[] [static]

bool Prolog_interface_initialized = false [static]

Definition at line 1024 of file ppl_prolog.icc.

Referenced by ppl_finalize(), and ppl_initialize().

Definition at line 545 of file ppl_prolog.icc.

std::vector<dimension_type> vec

Definition at line 3059 of file ppl_prolog.icc.


Generated on Wed Jul 16 22:55:26 2008 for PPL by  doxygen 1.5.6