[PPL-devel] [GIT] ppl/ppl(products): After the affine (pre)image operations, unset the reduced flag.

Patricia Hill p.m.hill at leeds.ac.uk
Sun May 17 10:08:36 CEST 2009


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

Author: Patricia Hill <p.m.hill at leeds.ac.uk>
Date:   Sun May 17 09:04:08 2009 +0100

After the affine (pre)image operations, unset the reduced flag.

---

 src/Partially_Reduced_Product.inlines.hh           |    6 ++++++
 .../constraintsproduct1.cc                         |   12 +++++++++---
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/src/Partially_Reduced_Product.inlines.hh b/src/Partially_Reduced_Product.inlines.hh
index 534f6ef..cf33f46 100644
--- a/src/Partially_Reduced_Product.inlines.hh
+++ b/src/Partially_Reduced_Product.inlines.hh
@@ -264,6 +264,7 @@ Partially_Reduced_Product<D1, D2, R>
 	       Coefficient_traits::const_reference denominator) {
   d1.affine_image(var, expr, denominator);
   d2.affine_image(var, expr, denominator);
+  clear_reduced_flag();
 }
 
 template <typename D1, typename D2, typename R>
@@ -274,6 +275,7 @@ Partially_Reduced_Product<D1, D2, R>
 		  Coefficient_traits::const_reference denominator) {
   d1.affine_preimage(var, expr, denominator);
   d2.affine_preimage(var, expr, denominator);
+  clear_reduced_flag();
 }
 
 template <typename D1, typename D2, typename R>
@@ -285,6 +287,7 @@ Partially_Reduced_Product<D1, D2, R>
 			   Coefficient_traits::const_reference denominator) {
   d1.generalized_affine_image(var, relsym, expr, denominator);
   d2.generalized_affine_image(var, relsym, expr, denominator);
+  clear_reduced_flag();
 }
 
 template <typename D1, typename D2, typename R>
@@ -296,6 +299,7 @@ Partially_Reduced_Product<D1, D2, R>
 			      Coefficient_traits::const_reference denominator) {
   d1.generalized_affine_preimage(var, relsym, expr, denominator);
   d2.generalized_affine_preimage(var, relsym, expr, denominator);
+  clear_reduced_flag();
 }
 
 template <typename D1, typename D2, typename R>
@@ -306,6 +310,7 @@ Partially_Reduced_Product<D1, D2, R>
 			   const Linear_Expression& rhs) {
   d1.generalized_affine_image(lhs, relsym, rhs);
   d2.generalized_affine_image(lhs, relsym, rhs);
+  clear_reduced_flag();
 }
 
 template <typename D1, typename D2, typename R>
@@ -316,6 +321,7 @@ Partially_Reduced_Product<D1, D2, R>
                               const Linear_Expression& rhs) {
   d1.generalized_affine_preimage(lhs, relsym, rhs);
   d2.generalized_affine_preimage(lhs, relsym, rhs);
+  clear_reduced_flag();
 }
 
 
diff --git a/tests/Partially_Reduced_Product/constraintsproduct1.cc b/tests/Partially_Reduced_Product/constraintsproduct1.cc
index 444e1f7..0a7f716 100644
--- a/tests/Partially_Reduced_Product/constraintsproduct1.cc
+++ b/tests/Partially_Reduced_Product/constraintsproduct1.cc
@@ -344,7 +344,7 @@ test10() {
   cs.insert(D <= 9);
   Congruence_System cgs;
   cgs.insert(A %= 0);
-  cgs.insert((B %= 0) / 15);
+  cgs.insert((B %= 5) / 15);
   cgs.insert(C %= 0);
   cgs.insert(D %= 0);
 
@@ -364,6 +364,8 @@ test10() {
   gb1.refine_with_constraints(cs);
   gb1.refine_with_congruences(cgs);
   gb1.affine_image(A, 2*B + D);
+  print_constraints(ab1,
+       "*** (Affine_Space x TBox) ab1 constraints ***");
 
   AffBox ab2(ab1);
   TBox box2(box1);
@@ -406,9 +408,11 @@ test10() {
   GridBox known_gb(4);
   known_gb.refine_with_constraints(known_cs);
   known_gb.refine_with_congruences(cgs);
-  known_gb.refine_with_congruence((A + 2*B - D %= 0) / 90);
+  known_gb.refine_with_congruence((A - D %= 20) / 30);
+  known_gb.refine_with_congruence((B %= 5) / 15);
 
-  bool ok = (ab1 == known_ab && box1 == known_box
+  bool ok = (ab1 == known_ab
+             && box1 == known_box
              && affs1 == known_affs && gb1 == known_gb);
 
   print_constraints(ab1,
@@ -416,6 +420,8 @@ test10() {
   print_constraints(box1,
        "*** (TBox) box1 constraints ***");
   print_constraints(affs1, "*** (Affine_Space) affs1 constraints ***");
+  print_constraints(gb1,
+       "*** (Grid x TBox) gb1 constraints ***");
   print_congruences(gb1,
        "*** (Grid x TBox) gb1 congruences ***");
 




More information about the PPL-devel mailing list