PPL  1.2
Parma_Polyhedra_Library::H79_Certificate Class Reference

A convergence certificate for the H79 widening operator. More...

#include <H79_Certificate_defs.hh>

Classes

struct  Compare
 A total ordering on H79 certificates. More...
 

Public Member Functions

 H79_Certificate ()
 Default constructor. More...
 
template<typename PH >
 H79_Certificate (const PH &ph)
 Constructor: computes the certificate for ph. More...
 
 H79_Certificate (const Polyhedron &ph)
 Constructor: computes the certificate for ph. More...
 
 H79_Certificate (const H79_Certificate &y)
 Copy constructor. More...
 
 ~H79_Certificate ()
 Destructor. More...
 
int compare (const H79_Certificate &y) const
 The comparison function for certificates. More...
 
template<typename PH >
int compare (const PH &ph) const
 Compares *this with the certificate for polyhedron ph. More...
 
int compare (const Polyhedron &ph) const
 Compares *this with the certificate for polyhedron ph. More...
 

Private Attributes

dimension_type affine_dim
 Affine dimension of the polyhedron. More...
 
dimension_type num_constraints
 Cardinality of a non-redundant constraint system for the polyhedron. More...
 

Detailed Description

A convergence certificate for the H79 widening operator.

Convergence certificates are used to instantiate the BHZ03 framework so as to define widening operators for the finite powerset domain.

Note
The convergence of the H79 widening can also be certified by BHRZ03_Certificate.

Definition at line 40 of file H79_Certificate_defs.hh.

Constructor & Destructor Documentation

Parma_Polyhedra_Library::H79_Certificate::H79_Certificate ( )
inline

Default constructor.

Definition at line 32 of file H79_Certificate_inlines.hh.

33  : affine_dim(0), num_constraints(0) {
34  // This is the certificate for a zero-dim universe polyhedron.
35 }
dimension_type num_constraints
Cardinality of a non-redundant constraint system for the polyhedron.
dimension_type affine_dim
Affine dimension of the polyhedron.
template<typename PH >
Parma_Polyhedra_Library::H79_Certificate::H79_Certificate ( const PH &  ph)
inline

Constructor: computes the certificate for ph.

Definition at line 56 of file H79_Certificate_inlines.hh.

References affine_dim, Parma_Polyhedra_Library::NECESSARILY_CLOSED, and num_constraints.

57  : affine_dim(0), num_constraints(0) {
58  H79_Certificate cert(Polyhedron(NECESSARILY_CLOSED, ph.constraints()));
59  affine_dim = cert.affine_dim;
60  num_constraints = cert.num_constraints;
61 }
dimension_type num_constraints
Cardinality of a non-redundant constraint system for the polyhedron.
dimension_type affine_dim
Affine dimension of the polyhedron.
Parma_Polyhedra_Library::H79_Certificate::H79_Certificate ( const Polyhedron ph)

Constructor: computes the certificate for ph.

Definition at line 33 of file H79_Certificate.cc.

References affine_dim, Parma_Polyhedra_Library::Constraint_System::begin(), Parma_Polyhedra_Library::Constraint_System::end(), Parma_Polyhedra_Library::Polyhedron::is_necessarily_closed(), Parma_Polyhedra_Library::Polyhedron::marked_empty(), Parma_Polyhedra_Library::Polyhedron::minimize(), Parma_Polyhedra_Library::Polyhedron::minimized_constraints(), num_constraints, and Parma_Polyhedra_Library::Polyhedron::space_dimension().

34  : affine_dim(0), num_constraints(0) {
35  // The affine dimension of the polyhedron is obtained by subtracting
36  // the number of equalities from the space dimension.
37  // When counting constraints, for a correct reasoning, we have
38  // to disregard the low-level constraints (i.e., the positivity
39  // constraint and epsilon bounds).
40  const dimension_type space_dim = ph.space_dimension();
41  affine_dim = space_dim;
42  const Constraint_System& cs = ph.minimized_constraints();
43  // It is assumed that `ph' is not an empty polyhedron.
44  PPL_ASSERT(!ph.marked_empty());
45  for (Constraint_System::const_iterator i = cs.begin(),
46  cs_end = cs.end(); i != cs_end; ++i) {
48  if (i->is_equality()) {
49  --affine_dim;
50  }
51  }
52 
53  // TODO: this is an inefficient workaround.
54  // For NNC polyhedra, generators might be no longer up-to-date
55  // (and hence, neither minimized) due to the strong minimization
56  // process applied to constraints when constructing the certificate.
57  // We have to reinforce the (normal) minimization of the generator
58  // system. The future, lazy implementation of the strong minimization
59  // process will solve this problem.
60  if (!ph.is_necessarily_closed()) {
61  ph.minimize();
62  }
63 }
size_t dimension_type
An unsigned integral type for representing space dimensions.
dimension_type num_constraints
Cardinality of a non-redundant constraint system for the polyhedron.
dimension_type affine_dim
Affine dimension of the polyhedron.
Constraint_System_const_iterator const_iterator
Parma_Polyhedra_Library::H79_Certificate::H79_Certificate ( const H79_Certificate y)
inline

Copy constructor.

Definition at line 38 of file H79_Certificate_inlines.hh.

39  : affine_dim(y.affine_dim), num_constraints(y.num_constraints) {
40 }
dimension_type num_constraints
Cardinality of a non-redundant constraint system for the polyhedron.
dimension_type affine_dim
Affine dimension of the polyhedron.
Parma_Polyhedra_Library::H79_Certificate::~H79_Certificate ( )
inline

Destructor.

Definition at line 43 of file H79_Certificate_inlines.hh.

43  {
44 }

Member Function Documentation

int Parma_Polyhedra_Library::H79_Certificate::compare ( const H79_Certificate y) const

The comparison function for certificates.

Returns
$-1$, $0$ or $1$ depending on whether *this is smaller than, equal to, or greater than y, respectively.

Compares *this with y, using a total ordering which is a refinement of the limited growth ordering relation for the H79 widening.

Definition at line 66 of file H79_Certificate.cc.

References affine_dim, num_constraints, and Parma_Polyhedra_Library::Implementation::num_constraints().

Referenced by compare(), and Parma_Polyhedra_Library::H79_Certificate::Compare::operator()().

66  {
67  if (affine_dim != y.affine_dim) {
68  return (affine_dim > y.affine_dim) ? 1 : -1;
69  }
70  if (num_constraints != y.num_constraints) {
71  return (num_constraints > y.num_constraints) ? 1 : -1;
72  }
73  // All components are equal.
74  return 0;
75 }
dimension_type num_constraints
Cardinality of a non-redundant constraint system for the polyhedron.
dimension_type affine_dim
Affine dimension of the polyhedron.
template<typename PH >
int Parma_Polyhedra_Library::H79_Certificate::compare ( const PH &  ph) const
inline

Compares *this with the certificate for polyhedron ph.

Definition at line 65 of file H79_Certificate_inlines.hh.

References compare(), and Parma_Polyhedra_Library::NECESSARILY_CLOSED.

65  {
66  return this->compare(Polyhedron(NECESSARILY_CLOSED, ph.constraints()));
67 }
int compare(const H79_Certificate &y) const
The comparison function for certificates.
int Parma_Polyhedra_Library::H79_Certificate::compare ( const Polyhedron ph) const

Compares *this with the certificate for polyhedron ph.

Definition at line 78 of file H79_Certificate.cc.

References Parma_Polyhedra_Library::Constraint_System::begin(), Parma_Polyhedra_Library::Constraint_System::end(), Parma_Polyhedra_Library::Polyhedron::is_necessarily_closed(), Parma_Polyhedra_Library::Polyhedron::marked_empty(), Parma_Polyhedra_Library::Polyhedron::minimize(), Parma_Polyhedra_Library::Polyhedron::minimized_constraints(), Parma_Polyhedra_Library::Implementation::num_constraints(), and Parma_Polyhedra_Library::Polyhedron::space_dimension().

78  {
79  // The affine dimension of the polyhedron is obtained by subtracting
80  // the number of equalities from the space dimension.
81  // When counting constraints, for a correct reasoning, we have
82  // to disregard the low-level constraints (i.e., the positivity
83  // constraint and epsilon bounds).
84  const dimension_type space_dim = ph.space_dimension();
85  dimension_type ph_affine_dim = space_dim;
86  dimension_type ph_num_constraints = 0;
87  const Constraint_System& cs = ph.minimized_constraints();
88  // It is assumed that `ph' is a polyhedron containing the
89  // polyhedron described by `*this': hence, it cannot be empty.
90  PPL_ASSERT(!ph.marked_empty());
91  for (Constraint_System::const_iterator i = cs.begin(),
92  cs_end = cs.end(); i != cs_end; ++i) {
93  ++ph_num_constraints;
94  if (i->is_equality()) {
95  --ph_affine_dim;
96  }
97  }
98  // TODO: this is an inefficient workaround.
99  // For NNC polyhedra, generators might be no longer up-to-date
100  // (and hence, neither minimized) due to the strong minimization
101  // process applied to constraints when constructing the certificate.
102  // We have to reinforce the (normal) minimization of the generator
103  // system. The future, lazy implementation of the strong minimization
104  // process will solve this problem.
105  if (!ph.is_necessarily_closed()) {
106  ph.minimize();
107  }
108 
109  // If the affine dimension of `ph' is increasing, the chain is stabilizing.
110  if (ph_affine_dim > affine_dim) {
111  return 1;
112  }
113 
114  // At this point the two polyhedra must have the same affine dimension.
115  PPL_ASSERT(ph_affine_dim == affine_dim);
116 
117  // If the number of constraints of `ph' is decreasing, then the chain
118  // is stabilizing. If it is increasing, the chain is not stabilizing.
119  if (ph_num_constraints != num_constraints) {
120  return (ph_num_constraints < num_constraints) ? 1 : -1;
121  }
122 
123  // All components are equal.
124  return 0;
125 }
size_t dimension_type
An unsigned integral type for representing space dimensions.
dimension_type num_constraints
Cardinality of a non-redundant constraint system for the polyhedron.
dimension_type affine_dim
Affine dimension of the polyhedron.
Constraint_System_const_iterator const_iterator

Member Data Documentation

dimension_type Parma_Polyhedra_Library::H79_Certificate::affine_dim
private

Affine dimension of the polyhedron.

Definition at line 90 of file H79_Certificate_defs.hh.

Referenced by compare(), and H79_Certificate().

dimension_type Parma_Polyhedra_Library::H79_Certificate::num_constraints
private

Cardinality of a non-redundant constraint system for the polyhedron.

Definition at line 92 of file H79_Certificate_defs.hh.

Referenced by compare(), and H79_Certificate().


The documentation for this class was generated from the following files: