[PPL-devel] [GIT] ppl/ppl(master): Add method wrap_assign() to Pointset_Powerset.

Enea Zaffanella zaffanella at cs.unipr.it
Fri Apr 16 11:15:19 CEST 2010


Module: ppl/ppl
Branch: master
Commit: 7db9d078f15311aaaeed57e0dae06c44e89dd329
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=7db9d078f15311aaaeed57e0dae06c44e89dd329

Author: Enea Zaffanella <zaffanella at cs.unipr.it>
Date:   Fri Apr 16 11:14:23 2010 +0200

Add method wrap_assign() to Pointset_Powerset.

---

 src/Pointset_Powerset.defs.hh      |   54 ++++++++++++++++++++++++++++++++++++
 src/Pointset_Powerset.templates.hh |   18 ++++++++++++
 2 files changed, 72 insertions(+), 0 deletions(-)

diff --git a/src/Pointset_Powerset.defs.hh b/src/Pointset_Powerset.defs.hh
index 849e971..0ae87f3 100644
--- a/src/Pointset_Powerset.defs.hh
+++ b/src/Pointset_Powerset.defs.hh
@@ -985,6 +985,60 @@ public:
   void time_elapse_assign(const Pointset_Powerset& y);
 
   /*! \brief
+    \ref Wrapping_Operator "Wraps" the specified dimensions of the
+    vector space.
+
+    \param vars
+    The set of Variable objects corresponding to the space dimensions
+    to be wrapped.
+
+    \param w
+    The width of the bounded integer type corresponding to
+    all the dimensions to be wrapped.
+
+    \param r
+    The representation of the bounded integer type corresponding to
+    all the dimensions to be wrapped.
+
+    \param o
+    The overflow behavior of the bounded integer type corresponding to
+    all the dimensions to be wrapped.
+
+    \param pcs
+    Possibly null pointer to a constraint system whose variables
+    are contained in \p vars.  If <CODE>*pcs</CODE> depends on
+    variables not in \p vars, the behavior is undefined.
+    When non-null, the pointed-to constraint system is assumed to
+    represent the conditional or looping construct guard with respect
+    to which wrapping is performed.  Since wrapping requires the
+    computation of upper bounds and due to non-distributivity of
+    constraint refinement over upper bounds, passing a constraint
+    system in this way can be more precise than refining the result of
+    the wrapping operation with the constraints in <CODE>*pcs</CODE>.
+
+    \param complexity_threshold
+    A precision parameter of the \ref Wrapping_Operator "wrapping operator":
+    higher values result in possibly improved precision.
+
+    \param wrap_individually
+    <CODE>true</CODE> if the dimensions should be wrapped individually
+    (something that results in much greater efficiency to the detriment of
+    precision).
+
+    \exception std::invalid_argument
+    Thrown if <CODE>*pcs</CODE> is dimension-incompatible with
+    \p vars, or if \p *this is dimension-incompatible \p vars or with
+    <CODE>*pcs</CODE>.
+  */
+  void wrap_assign(const Variables_Set& vars,
+                   Bounded_Integer_Type_Width w,
+                   Bounded_Integer_Type_Representation r,
+                   Bounded_Integer_Type_Overflow o,
+                   const Constraint_System* pcs = 0,
+                   unsigned complexity_threshold = 16,
+                   bool wrap_individually = true);
+
+  /*! \brief
     Assign to \p *this the result of (recursively) merging together
     the pairs of disjuncts whose upper-bound is the same as their
     set-theoretical union.
diff --git a/src/Pointset_Powerset.templates.hh b/src/Pointset_Powerset.templates.hh
index d759e7b..5391a4e 100644
--- a/src/Pointset_Powerset.templates.hh
+++ b/src/Pointset_Powerset.templates.hh
@@ -1155,6 +1155,24 @@ Pointset_Powerset<PSET>::contains_integer_point() const {
 
 template <typename PSET>
 void
+Pointset_Powerset<PSET>::wrap_assign(const Variables_Set& vars,
+                                     Bounded_Integer_Type_Width w,
+                                     Bounded_Integer_Type_Representation r,
+                                     Bounded_Integer_Type_Overflow o,
+                                     const Constraint_System* pcs,
+                                     unsigned complexity_threshold,
+                                     bool wrap_individually) {
+  Pointset_Powerset& x = *this;
+  for (Sequence_iterator si = x.sequence.begin(),
+	 s_end = x.sequence.end(); si != s_end; ++si)
+    si->pointset().wrap_assign(vars, w, r, o, pcs,
+                               complexity_threshold, wrap_individually);
+  x.reduced = false;
+  PPL_ASSERT_HEAVY(x.OK());
+}
+
+template <typename PSET>
+void
 Pointset_Powerset<PSET>::pairwise_reduce() {
   Pointset_Powerset& x = *this;
   // It is wise to omega-reduce before pairwise-reducing.




More information about the PPL-devel mailing list