PPL  1.2
Poly_Con_Relation_defs.hh
Go to the documentation of this file.
1 /* Poly_Con_Relation class declaration.
2  Copyright (C) 2001-2010 Roberto Bagnara <bagnara@cs.unipr.it>
3  Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com)
4 
5 This file is part of the Parma Polyhedra Library (PPL).
6 
7 The PPL is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 The PPL is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software Foundation,
19 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
20 
21 For the most up-to-date information see the Parma Polyhedra Library
22 site: http://bugseng.com/products/ppl/ . */
23 
24 #ifndef PPL_Poly_Con_Relation_defs_hh
25 #define PPL_Poly_Con_Relation_defs_hh 1
26 
28 #include "globals_defs.hh"
29 #include <iosfwd>
30 
31 namespace Parma_Polyhedra_Library {
32 
33 // Put them in the namespace here to declare them friend later.
34 
36 
37 bool operator==(const Poly_Con_Relation& x, const Poly_Con_Relation& y);
38 
40 
41 bool operator!=(const Poly_Con_Relation& x, const Poly_Con_Relation& y);
42 
44 
45 Poly_Con_Relation operator&&(const Poly_Con_Relation& x,
46  const Poly_Con_Relation& y);
47 
54 Poly_Con_Relation operator-(const Poly_Con_Relation& x,
55  const Poly_Con_Relation& y);
56 
57 namespace IO_Operators {
58 
60 
61 std::ostream& operator<<(std::ostream& s, const Poly_Con_Relation& r);
62 
63 } // namespace IO_Operators
64 
65 } // namespace Parma_Polyhedra_Library
66 
67 
69 
74 private:
76  typedef unsigned int flags_t;
77 
79 
80  static const flags_t NOTHING = 0U;
81  static const flags_t IS_DISJOINT = 1U << 0;
82  static const flags_t STRICTLY_INTERSECTS = 1U << 1;
83  static const flags_t IS_INCLUDED = 1U << 2;
84  static const flags_t SATURATES = 1U << 3;
86 
88  static const flags_t EVERYTHING
89  = IS_DISJOINT
90  | STRICTLY_INTERSECTS
91  | IS_INCLUDED
92  | SATURATES;
93 
95  flags_t flags;
96 
98  static bool implies(flags_t x, flags_t y);
99 
101  Poly_Con_Relation(flags_t mask);
102 
103  friend bool
104  operator==(const Poly_Con_Relation& x, const Poly_Con_Relation& y);
105  friend bool
106  operator!=(const Poly_Con_Relation& x, const Poly_Con_Relation& y);
107 
108  friend Poly_Con_Relation
109  operator&&(const Poly_Con_Relation& x, const Poly_Con_Relation& y);
110 
111  friend Poly_Con_Relation
112  operator-(const Poly_Con_Relation& x, const Poly_Con_Relation& y);
113 
114  friend std::ostream&
116  IO_Operators::operator<<(std::ostream& s, const Poly_Con_Relation& r);
117 
118 public:
119 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
120 
124 #endif
125  flags_t get_flags() const;
126 
127 public:
129  static Poly_Con_Relation nothing();
130 
136 
142 
148 
153  static Poly_Con_Relation saturates();
154 
156 
158  bool implies(const Poly_Con_Relation& y) const;
159 
161  bool OK() const;
162 };
163 
165 
166 #endif // !defined(PPL_Poly_Con_Relation_defs_hh)
bool operator!=(const Box< ITV > &x, const Box< ITV > &y)
Definition: Box_inlines.hh:264
static Poly_Con_Relation is_disjoint()
The polyhedron and the set of points satisfying the constraint are disjoint.
bool OK() const
Checks if all the invariants are satisfied.
static bool implies(flags_t x, flags_t y)
True if and only if the conjunction x implies the conjunction y.
std::ostream & operator<<(std::ostream &s, const Ask_Tell< D > &x)
static Poly_Con_Relation is_included()
The polyhedron is included in the set of points satisfying the constraint.
static Poly_Con_Relation saturates()
The polyhedron is included in the set of points saturating the constraint.
flags_t flags
This holds the current bitset.
Poly_Con_Relation(flags_t mask)
Construct from a bit-mask.
friend Poly_Con_Relation operator-(const Poly_Con_Relation &x, const Poly_Con_Relation &y)
flags_t get_flags() const
Access the internal flags: this is needed for some language interfaces.
#define PPL_OUTPUT_DECLARATIONS
friend bool operator!=(const Poly_Con_Relation &x, const Poly_Con_Relation &y)
unsigned int flags_t
Poly_Con_Relation is implemented by means of a finite bitset.
The entire library is confined to this namespace.
Definition: version.hh:61
friend Poly_Con_Relation operator&&(const Poly_Con_Relation &x, const Poly_Con_Relation &y)
bool operator==(const Box< ITV > &x, const Box< ITV > &y)
friend bool operator==(const Poly_Con_Relation &x, const Poly_Con_Relation &y)
Enable_If< Is_Singleton< T >::value, Interval< B, Info > >::type operator-(const Interval< B, Info > &x, const T &y)
static const flags_t EVERYTHING
All assertions together.
static Poly_Con_Relation nothing()
The assertion that says nothing.
static Poly_Con_Relation strictly_intersects()
The polyhedron intersects the set of points satisfying the constraint, but it is not included in it...
The relation between a polyhedron and a constraint.