# C++ Language Interface

The core implementation of the Parma Polyhedra Library is written in C++. More...

## Classes

class | Parma_Polyhedra_Library::Throwable
| User objects the PPL can throw. More...
struct | Parma_Polyhedra_Library::Recycle_Input
| A tag class. More...
struct | Parma_Polyhedra_Library::Is_Checked< T >
struct | Parma_Polyhedra_Library::Is_Checked< Checked_Number< T, P > >
struct | Parma_Polyhedra_Library::Is_Native_Or_Checked< T >
class | Parma_Polyhedra_Library::Checked_Number< T, Policy >
| A wrapper for numeric types implementing a given policy. More...
class | Parma_Polyhedra_Library::Variable
| A dimension of the vector space. More...
struct | Parma_Polyhedra_Library::Variable::Compare
| Binary predicate defining the total ordering on variables. More...
class | Parma_Polyhedra_Library::Linear_Expression
| A linear expression. More...
class | Parma_Polyhedra_Library::Constraint_System
| A system of constraints. More...
class | Parma_Polyhedra_Library::Constraint_System::const_iterator
| An iterator over a system of constraints. More...
class | Parma_Polyhedra_Library::Constraint
| A linear equality or inequality. More...
class | Parma_Polyhedra_Library::Poly_Con_Relation
| The relation between a polyhedron and a constraint. More...
class | Parma_Polyhedra_Library::Generator_System
| A system of generators. More...
class | Parma_Polyhedra_Library::Generator_System::const_iterator
| An iterator over a system of generators. More...
class | Parma_Polyhedra_Library::Generator
| A line, ray, point or closure point. More...
class | Parma_Polyhedra_Library::Congruence_System
| A system of congruences. More...
class | Parma_Polyhedra_Library::Congruence_System::const_iterator
| An iterator over a system of congruences. More...
class | Parma_Polyhedra_Library::Congruence
| A linear congruence. More...
class | Parma_Polyhedra_Library::Grid_Generator_System
| A system of grid generators. More...
class | Parma_Polyhedra_Library::Grid_Generator_System::const_iterator
| An iterator over a system of grid generators. More...
class | Parma_Polyhedra_Library::Grid_Generator
| A grid line, parameter or grid point. More...
class | Parma_Polyhedra_Library::PIP_Problem
| A Parametric Integer (linear) Programming problem. More...
class | Parma_Polyhedra_Library::BHRZ03_Certificate
| The convergence certificate for the BHRZ03 widening operator. More...
struct | Parma_Polyhedra_Library::BHRZ03_Certificate::Compare
| A total ordering on BHRZ03 certificates. More...
class | Parma_Polyhedra_Library::H79_Certificate
| A convergence certificate for the H79 widening operator. More...
struct | Parma_Polyhedra_Library::H79_Certificate::Compare
| A total ordering on H79 certificates. More...
class | Parma_Polyhedra_Library::Poly_Gen_Relation
| The relation between a polyhedron and a generator. More...
class | Parma_Polyhedra_Library::Polyhedron
| The base class for convex polyhedra. More...
class | Parma_Polyhedra_Library::MIP_Problem
| A Mixed Integer (linear) Programming problem. More...
class | Parma_Polyhedra_Library::Interval< Boundary, Info >
| A generic, not necessarily closed, possibly restricted interval. More...
class | Parma_Polyhedra_Library::Grid_Certificate
| The convergence certificate for the Grid widening operator. More...
class | Parma_Polyhedra_Library::C_Polyhedron
| A closed convex polyhedron. More...
class | Parma_Polyhedra_Library::NNC_Polyhedron
| A not necessarily closed convex polyhedron. More...
class | Parma_Polyhedra_Library::Grid
| A grid. More...
class | Parma_Polyhedra_Library::Box< ITV >
| A not necessarily closed, iso-oriented hyperrectangle. More...
class | Parma_Polyhedra_Library::BD_Shape< T >
| A bounded difference shape. More...
class | Parma_Polyhedra_Library::Octagonal_Shape< T >
| An octagonal shape. More...
class | Parma_Polyhedra_Library::Smash_Reduction< D1, D2 >
| This class provides the reduction method for the Smash_Product domain. More...
class | Parma_Polyhedra_Library::Constraints_Reduction< D1, D2 >
| This class provides the reduction method for the Constraints_Product domain. More...
class | Parma_Polyhedra_Library::Congruences_Reduction< D1, D2 >
| This class provides the reduction method for the Congruences_Product domain. More...
class | Parma_Polyhedra_Library::Shape_Preserving_Reduction< D1, D2 >
| This class provides the reduction method for the Shape_Preserving_Product domain. More...
class | Parma_Polyhedra_Library::No_Reduction< D1, D2 >
| This class provides the reduction method for the Direct_Product domain. More...
class | Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >
| The partially reduced product of two abstractions. More...
class | Parma_Polyhedra_Library::Determinate< PSET >
| A wrapper for PPL pointsets, providing them with a determinate constraint system interface, as defined in [Bag98]. More...
class | Parma_Polyhedra_Library::Powerset< D >
| The powerset construction on a base-level domain. More...
class | Parma_Polyhedra_Library::Pointset_Powerset< PSET >
| The powerset construction instantiated on PPL pointset domains. More...
class | Parma_Polyhedra_Library::GMP_Integer
| Unbounded integers as provided by the GMP library. More...

## Namespaces

namespace | Parma_Polyhedra_Library::IO_Operators

| All input/output operators are confined to this namespace.
namespace | std

| The standard C++ namespace.

## Defines

#define | PPL_VERSION_MAJOR 0
| The major number of the PPL version.
#define | PPL_VERSION_MINOR 11
| The minor number of the PPL version.
#define | PPL_VERSION_REVISION 2
| The revision number of the PPL version.
#define | PPL_VERSION_BETA 0
| The beta number of the PPL version. This is zero for official releases and nonzero for development snapshots.
#define | PPL_VERSION "0.11.2"
| A string containing the PPL version.

## Typedefs

typedef size_t | Parma_Polyhedra_Library::dimension_type
| An unsigned integral type for representing space dimensions.
typedef size_t | Parma_Polyhedra_Library::memory_size_type
| An unsigned integral type for representing memory size in bytes.
typedef PPL_COEFFICIENT_TYPE | Parma_Polyhedra_Library::Coefficient
| An alias for easily naming the type of PPL coefficients.

## Enumerations

enum

Parma_Polyhedra_Library::Result {
Parma_Polyhedra_Library::V_EMPTY, Parma_Polyhedra_Library::V_EQ, Parma_Polyhedra_Library::V_LT, Parma_Polyhedra_Library::V_GT,
Parma_Polyhedra_Library::V_NE, Parma_Polyhedra_Library::V_LE, Parma_Polyhedra_Library::V_GE, Parma_Polyhedra_Library::V_LGE,
Parma_Polyhedra_Library::V_OVERFLOW, Parma_Polyhedra_Library::V_LT_INF, Parma_Polyhedra_Library::V_GT_SUP, Parma_Polyhedra_Library::V_LT_PLUS_INFINITY,
Parma_Polyhedra_Library::V_GT_MINUS_INFINITY, Parma_Polyhedra_Library::V_EQ_MINUS_INFINITY, Parma_Polyhedra_Library::V_EQ_PLUS_INFINITY, Parma_Polyhedra_Library::V_NAN,
Parma_Polyhedra_Library::V_CVT_STR_UNK, Parma_Polyhedra_Library::V_DIV_ZERO, Parma_Polyhedra_Library::V_INF_ADD_INF, Parma_Polyhedra_Library::V_INF_DIV_INF,
Parma_Polyhedra_Library::V_INF_MOD, Parma_Polyhedra_Library::V_INF_MUL_ZERO, Parma_Polyhedra_Library::V_INF_SUB_INF, Parma_Polyhedra_Library::V_MOD_ZERO,
Parma_Polyhedra_Library::V_SQRT_NEG, Parma_Polyhedra_Library::V_UNKNOWN_NEG_OVERFLOW, Parma_Polyhedra_Library::V_UNKNOWN_POS_OVERFLOW, Parma_Polyhedra_Library::V_UNREPRESENTABLE
}

| Possible outcomes of a checked arithmetic computation. More...
enum | Parma_Polyhedra_Library::Degenerate_Element { Parma_Polyhedra_Library::UNIVERSE, Parma_Polyhedra_Library::EMPTY }
| Kinds of degenerate abstract elements. More...
enum | Parma_Polyhedra_Library::Relation_Symbol { Parma_Polyhedra_Library::EQUAL, Parma_Polyhedra_Library::LESS_THAN, Parma_Polyhedra_Library::LESS_OR_EQUAL, Parma_Polyhedra_Library::GREATER_THAN, Parma_Polyhedra_Library::GREATER_OR_EQUAL, Parma_Polyhedra_Library::NOT_EQUAL }
| Relation symbols. More...
enum | Parma_Polyhedra_Library::Complexity_Class { Parma_Polyhedra_Library::POLYNOMIAL_COMPLEXITY, Parma_Polyhedra_Library::SIMPLEX_COMPLEXITY, Parma_Polyhedra_Library::ANY_COMPLEXITY }
| Complexity pseudo-classes. More...
enum | Parma_Polyhedra_Library::Optimization_Mode { Parma_Polyhedra_Library::MINIMIZATION, Parma_Polyhedra_Library::MAXIMIZATION }
| Possible optimization modes. More...
enum | Parma_Polyhedra_Library::Bounded_Integer_Type_Width { Parma_Polyhedra_Library::BITS_8, Parma_Polyhedra_Library::BITS_16, Parma_Polyhedra_Library::BITS_32, Parma_Polyhedra_Library::BITS_64, Parma_Polyhedra_Library::BITS_128 }
| Widths of bounded integer types. More...
enum | Parma_Polyhedra_Library::Bounded_Integer_Type_Representation { Parma_Polyhedra_Library::UNSIGNED, Parma_Polyhedra_Library::SIGNED_2_COMPLEMENT }
| Representation of bounded integer types. More...
enum | Parma_Polyhedra_Library::Bounded_Integer_Type_Overflow { Parma_Polyhedra_Library::OVERFLOW_WRAPS, Parma_Polyhedra_Library::OVERFLOW_UNDEFINED, Parma_Polyhedra_Library::OVERFLOW_IMPOSSIBLE }
| Overflow behavior of bounded integer types. More...
enum | Parma_Polyhedra_Library::Rounding_Dir { Parma_Polyhedra_Library::ROUND_DOWN, Parma_Polyhedra_Library::ROUND_UP, Parma_Polyhedra_Library::ROUND_IGNORE , Parma_Polyhedra_Library::ROUND_NOT_NEEDED , Parma_Polyhedra_Library::ROUND_STRICT_RELATION }
| Rounding directions for arithmetic computations. More...
enum | Parma_Polyhedra_Library::PIP_Problem_Status { Parma_Polyhedra_Library::UNFEASIBLE_PIP_PROBLEM, Parma_Polyhedra_Library::OPTIMIZED_PIP_PROBLEM }
| Possible outcomes of the PIP_Problem solver. More...
enum | Parma_Polyhedra_Library::MIP_Problem_Status { Parma_Polyhedra_Library::UNFEASIBLE_MIP_PROBLEM, Parma_Polyhedra_Library::UNBOUNDED_MIP_PROBLEM, Parma_Polyhedra_Library::OPTIMIZED_MIP_PROBLEM }
| Possible outcomes of the MIP_Problem solver. More...

## Variables

const Throwable *volatile | Parma_Polyhedra_Library::abandon_expensive_computations
| A pointer to an exception object.

## Detailed Description

The core implementation of the Parma Polyhedra Library is written in C++.

See Namespace, Hierarchical and Compound indexes for additional information about each single data type.

## Define Documentation

#define PPL_VERSION_MAJOR 0

The major number of the PPL version.

#define PPL_VERSION_MINOR 11

The minor number of the PPL version.

#define PPL_VERSION_REVISION 2

The revision number of the PPL version.

#define PPL_VERSION "0.11.2"

A string containing the PPL version.

Let `M` and `m` denote the numbers associated to PPL_VERSION_MAJOR and PPL_VERSION_MINOR, respectively. The format of PPL_VERSION is `M "." m` if both PPL_VERSION_REVISION (`r`) and PPL_VERSION_BETA (`b`)are zero, `M "." m "pre" b` if PPL_VERSION_REVISION is zero and PPL_VERSION_BETA is not zero, `M "." m "." r` if PPL_VERSION_REVISION is not zero and PPL_VERSION_BETA is zero, `M "." m "." r "pre" b` if neither PPL_VERSION_REVISION nor PPL_VERSION_BETA are zero.

## Typedef Documentation

typedef size_t Parma_Polyhedra_Library::dimension_type

An unsigned integral type for representing space dimensions.

typedef size_t Parma_Polyhedra_Library::memory_size_type

An unsigned integral type for representing memory size in bytes.

typedef PPL_COEFFICIENT_TYPE Parma_Polyhedra_Library::Coefficient

An alias for easily naming the type of PPL coefficients.

Objects of type Coefficient are used to implement the integral valued coefficients occurring in linear expressions, constraints, generators, intervals, bounding boxes and so on. Depending on the chosen configuration options (see file `README.configure`), a Coefficient may actually be:

- The GMP_Integer type, which in turn is an alias for the `mpz_class` type implemented by the C++ interface of the GMP library (this is the default configuration).
- An instance of the Checked_Number class template: with the policy Bounded_Integer_Coefficient_Policy, this implements overflow detection on top of a native integral type (available template instances include checked integers having 8, 16, 32 or 64 bits); with the Checked_Number_Transparent_Policy, this is a wrapper for native integral types with no overflow detection (available template instances are as above).

## Enumeration Type Documentation

enum Parma_Polyhedra_Library::Result

Possible outcomes of a checked arithmetic computation.

Enumerator:

  V_EMPTY | The exact result is not comparable.
  V_EQ | The computed result is exact.
  V_LT | The computed result is inexact and rounded up.
  V_GT | The computed result is inexact and rounded down.
  V_NE | The computed result is inexact.
  V_LE | The computed result may be inexact and rounded up.
  V_GE | The computed result may be inexact and rounded down.
  V_LGE | The computed result may be inexact.
  V_OVERFLOW | The exact result is a number out of finite bounds.
  V_LT_INF | A negative integer overflow occurred (rounding up).
  V_GT_SUP | A positive integer overflow occurred (rounding down).
  V_LT_PLUS_INFINITY | A positive integer overflow occurred (rounding up).
  V_GT_MINUS_INFINITY | A negative integer overflow occurred (rounding down).
  V_EQ_MINUS_INFINITY | Negative infinity result.
  V_EQ_PLUS_INFINITY | Positive infinity result.
  V_NAN | Not a number result.
  V_CVT_STR_UNK | Converting from unknown string.
  V_DIV_ZERO | Dividing by zero.
  V_INF_ADD_INF | Adding two infinities having opposite signs.
  V_INF_DIV_INF | Dividing two infinities.
  V_INF_MOD | Taking the modulus of an infinity.
  V_INF_MUL_ZERO | Multiplying an infinity by zero.
  V_INF_SUB_INF | Subtracting two infinities having the same sign.
  V_MOD_ZERO | Computing a remainder modulo zero.
  V_SQRT_NEG | Taking the square root of a negative number.
  V_UNKNOWN_NEG_OVERFLOW | Unknown result due to intermediate negative overflow.
  V_UNKNOWN_POS_OVERFLOW | Unknown result due to intermediate positive overflow.
  V_UNREPRESENTABLE | The computed result is not representable.

enum Parma_Polyhedra_Library::Degenerate_Element

Kinds of degenerate abstract elements.

Enumerator:

  UNIVERSE | The universe element, i.e., the whole vector space.
  EMPTY | The empty element, i.e., the empty set.

enum Parma_Polyhedra_Library::Relation_Symbol

Relation symbols.

Enumerator:

  EQUAL | Equal to.
  LESS_THAN | Less than.
  LESS_OR_EQUAL | Less than or equal to.
  GREATER_THAN | Greater than.
  GREATER_OR_EQUAL | Greater than or equal to.
  NOT_EQUAL | Not equal to.

enum Parma_Polyhedra_Library::Complexity_Class

Complexity pseudo-classes.

Enumerator:

  POLYNOMIAL_COMPLEXITY | Worst-case polynomial complexity.
  SIMPLEX_COMPLEXITY | Worst-case exponential complexity but typically polynomial behavior.
  ANY_COMPLEXITY | Any complexity.

enum Parma_Polyhedra_Library::Optimization_Mode

Possible optimization modes.

Enumerator:

  MINIMIZATION | Minimization is requested.
  MAXIMIZATION | Maximization is requested.

enum Parma_Polyhedra_Library::Bounded_Integer_Type_Width

Widths of bounded integer types.

See the section on approximating bounded integers.

Enumerator:

  BITS_8 | 8 bits.
  BITS_16 | 16 bits.
  BITS_32 | 32 bits.
  BITS_64 | 64 bits.
  BITS_128 | 128 bits.

enum Parma_Polyhedra_Library::Bounded_Integer_Type_Representation

Representation of bounded integer types.

See the section on approximating bounded integers.

Enumerator:

  UNSIGNED | Unsigned binary.
  SIGNED_2_COMPLEMENT | Signed binary where negative values are represented by the two's complement of the absolute value.

enum Parma_Polyhedra_Library::Bounded_Integer_Type_Overflow

Overflow behavior of bounded integer types.

See the section on approximating bounded integers.

Enumerator:

  OVERFLOW_WRAPS | On overflow, wrapping takes place. This means that, for a -bit bounded integer, the computation happens modulo .

  OVERFLOW_UNDEFINED

  On overflow, the result is undefined.

  This simply means that the result of the operation resulting in an overflow can take any value.
  Note:
    Even though something more serious can happen in the system being analyzed ---due to, e.g., C's undefined behavior---, here we are only concerned with the results of arithmetic operations. It is the responsibility of the analyzer to ensure that other manifestations of undefined behavior are conservatively approximated.

  OVERFLOW_IMPOSSIBLE | Overflow is impossible. This is for the analysis of languages where overflow is trapped before it affects the state, for which, thus, any indication that an overflow may have affected the state is necessarily due to the imprecision of the analysis.

enum Parma_Polyhedra_Library::Rounding_Dir

Rounding directions for arithmetic computations.

Enumerator:

  ROUND_DOWN | Round toward .
  ROUND_UP | Round toward .
  ROUND_IGNORE | Rounding is delegated to lower level. Result info is evaluated lazily.
  ROUND_NOT_NEEDED | Rounding is not needed: client code must ensure that the operation result is exact and representable in the destination type. Result info is evaluated lazily.
  ROUND_STRICT_RELATION | The client code is willing to pay an extra price to know the exact relation beetwen the exact result and the computed one.

enum Parma_Polyhedra_Library::PIP_Problem_Status

Possible outcomes of the PIP_Problem solver.

Enumerator:

  UNFEASIBLE_PIP_PROBLEM | The problem is unfeasible.
  OPTIMIZED_PIP_PROBLEM | The problem has an optimal solution.

enum Parma_Polyhedra_Library::MIP_Problem_Status

Possible outcomes of the MIP_Problem solver.

Enumerator:

  UNFEASIBLE_MIP_PROBLEM | The problem is unfeasible.
  UNBOUNDED_MIP_PROBLEM | The problem is unbounded.
  OPTIMIZED_MIP_PROBLEM | The problem has an optimal solution.

## Variable Documentation

const Throwable* volatile Parma_Polyhedra_Library::abandon_expensive_computations

A pointer to an exception object.

This pointer, which is initialized to zero, is repeatedly checked along any super-linear (i.e., computationally expensive) computation path in the library. When it is found nonzero the exception it points to is thrown. In other words, making this pointer point to an exception (and leaving it in this state) ensures that the library will return control to the client application, possibly by throwing the given exception, within a time that is a linear function of the size of the representation of the biggest object (powerset of polyhedra, polyhedron, system of constraints or generators) on which the library is operating upon.

Note:
  The only sensible way to assign to this pointer is from within a signal handler or from a parallel thread. For this reason, the library, apart from ensuring that the pointer is initially set to zero, never assigns to it. In particular, it does not zero it again when the exception is thrown: it is the client's responsibility to do so.