24 #ifndef PPL_Determinate_inlines_hh
25 #define PPL_Determinate_inlines_hh 1
27 #include "assertions.hh"
31 template <
typename PSET>
35 : references(0), pset(num_dimensions, kind) {
38 template <
typename PSET>
41 : references(0), pset(p) {
44 template <
typename PSET>
47 : references(0), pset(cs) {
50 template <
typename PSET>
53 : references(0), pset(cgs) {
56 template <
typename PSET>
59 PPL_ASSERT(references == 0);
62 template <
typename PSET>
68 template <
typename PSET>
71 return --references == 0;
74 template <
typename PSET>
77 return references > 1;
80 template <
typename PSET>
83 return pset.external_memory_in_bytes();
86 template <
typename PSET>
92 template <
typename PSET>
99 template <
typename PSET>
102 : prep(new
Rep(cs)) {
106 template <
typename PSET>
109 : prep(new
Rep(cgs)) {
113 template <
typename PSET>
120 template <
typename PSET>
123 if (prep->del_reference()) {
128 template <
typename PSET>
132 if (prep->del_reference()) {
139 template <
typename PSET>
146 template <
typename PSET>
149 if (prep->is_shared()) {
150 Rep*
const new_prep =
new Rep(prep->pset);
151 (void) prep->del_reference();
157 template <
typename PSET>
163 template <
typename PSET>
170 template <
typename PSET>
173 pointset().upper_bound_assign(y.
pointset());
176 template <
typename PSET>
179 pointset().intersection_assign(y.
pointset());
182 template <
typename PSET>
191 template <
typename PSET>
197 pointset().difference_assign(y.
pointset());
200 template <
typename PSET>
203 pointset().concatenate_assign(y.
pointset());
206 template <
typename PSET>
209 return prep == y.
prep || y.
prep->
pset.contains(prep->pset);
212 template <
typename PSET>
218 template <
typename PSET>
221 return prep->pset.is_universe();
224 template <
typename PSET>
227 return prep->pset.is_empty();
230 template <
typename PSET>
233 return prep->total_memory_in_bytes();
236 template <
typename PSET>
242 template <
typename PSET>
245 return prep->pset.OK();
248 namespace IO_Operators {
251 template <
typename PSET>
253 operator<<(std::ostream& s, const Determinate<PSET>& x) {
261 template <
typename PSET>
268 template <
typename PSET>
274 template <
typename PSET>
275 template <
typename Binary_Operator_Assign>
279 : op_assign_(op_assign) {
282 template <
typename PSET>
283 template <
typename Binary_Operator_Assign>
290 template <
typename PSET>
291 template <
typename Binary_Operator_Assign>
299 template <
typename PSET>
307 #endif // !defined(PPL_Determinate_inlines_hh)
static Binary_Operator_Assign_Lifter< Binary_Operator_Assign > lift_op_assign(Binary_Operator_Assign op_assign)
Helper function returning a Binary_Operator_Assign_Lifter object, also allowing for the deduction of ...
void new_reference() const
Registers a new reference.
The possibly shared representation of a Determinate object.
memory_size_type external_memory_in_bytes() const
Returns a lower bound to the size in bytes of the memory managed by *this.
void swap(CO_Tree &x, CO_Tree &y)
size_t dimension_type
An unsigned integral type for representing space dimensions.
A function adapter for the Determinate class.
memory_size_type total_memory_in_bytes() const
Returns a lower bound to the total size in bytes of the memory occupied by *this. ...
bool is_top() const
Returns true if and only if *this embeds the universe element PSET.
Determinate & operator=(const Determinate &y)
Assignment operator.
bool operator==(const Determinate< PSET > &x, const Determinate< PSET > &y)
void weakening_assign(const Determinate &y)
Assigns to *this the result of weakening *this with y.
void swap(Determinate< PSET > &x, Determinate< PSET > &y)
void concatenate_assign(const Determinate &y)
Assigns to *this the concatenation of *this and y, taken in this order.
bool is_definitely_equivalent_to(const Determinate &y) const
Returns true if and only if *this and y are definitely equivalent.
void upper_bound_assign(const Determinate &y)
Assigns to *this the upper bound of *this and y.
void mutate()
On return from this method, the representation of *this is not shared by different Determinate object...
A wrapper for PPL pointsets, providing them with a determinate constraint system interface, as defined in [Bag98].
Determinate(const PSET &pset)
Constructs a COW-wrapped object corresponding to the pointset pset.
bool OK() const
Checks if all the invariants are satisfied.
bool definitely_entails(const Determinate &y) const
Returns true if and only if *this entails y.
Degenerate_Element
Kinds of degenerate abstract elements.
Enable_If< Is_Native< T >::value, memory_size_type >::type external_memory_in_bytes(const T &)
For native types, returns the size in bytes of the memory managed by the type of the (unused) paramet...
bool operator!=(const Determinate< PSET > &x, const Determinate< PSET > &y)
Rep * prep
A pointer to the possibly shared representation of the base-level domain element. ...
bool is_bottom() const
Returns true if and only if *this embeds the empty element of PSET.
static bool has_nontrivial_weakening()
memory_size_type external_memory_in_bytes() const
Returns a lower bound to the size in bytes of the memory managed by *this.
The entire library is confined to this namespace.
memory_size_type total_memory_in_bytes() const
Returns a lower bound to the total size in bytes of the memory occupied by *this. ...
PSET pset
The possibly shared, embedded pointset.
bool del_reference() const
Unregisters one reference; returns true if and only if the representation has become unreferenced...
bool is_shared() const
True if and only if this representation is currently shared.
void meet_assign(const Determinate &y)
Assigns to *this the meet of *this and y.
size_t memory_size_type
An unsigned integral type for representing memory size in bytes.
void m_swap(Determinate &y)
Swaps *this with y.
~Determinate()
Destructor.
Rep()
Private and unimplemented: default construction not allowed.
const PSET & pointset() const
Returns a const reference to the embedded pointset.