[PPL-devel] [GIT] ppl/ppl(bounded_arithmetic): Minor changes.
Alberto Gioia
alberto.gioia1 at studenti.unipr.it
Mon Sep 19 19:35:26 CEST 2011
Module: ppl/ppl
Branch: bounded_arithmetic
Commit: bb132ec0901f5629cd56113093a9223141241047
URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=bb132ec0901f5629cd56113093a9223141241047
Author: Alberto Gioia <alberto.gioia1 at studenti.unipr.it>
Date: Mon Sep 19 19:34:28 2011 +0200
Minor changes.
---
src/Linear_Form.templates.hh | 3 +--
tests/Concrete_Expression/linearize_int_xor.cc | 19 ++++++++++++-------
2 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/src/Linear_Form.templates.hh b/src/Linear_Form.templates.hh
index b7f8764..b697f96 100644
--- a/src/Linear_Form.templates.hh
+++ b/src/Linear_Form.templates.hh
@@ -416,9 +416,8 @@ operator^=(Linear_Form<C>& f1, const Linear_Form<C>& f2) {
return f1;
}
else if (check_totaly(f1, f2)) {
- for (dimension_type i = f2_size; i-- > 0; ) {
+ for (dimension_type i = f2_size; i-- > 0; )
f1[i] ^= f2[i];
- }
return f1;
}
else
diff --git a/tests/Concrete_Expression/linearize_int_xor.cc b/tests/Concrete_Expression/linearize_int_xor.cc
index 3492721..db3c0ef 100644
--- a/tests/Concrete_Expression/linearize_int_xor.cc
+++ b/tests/Concrete_Expression/linearize_int_xor.cc
@@ -74,7 +74,7 @@ bool
test01() {
Integer_Int_Interval tmp(2);
tmp.join_assign(3);
- nout << "B in " << tmp << endl;
+ nout<< "B in " << tmp << endl;
Test_Oracle oracle(Integer_Interval_Abstract_Store(2));
oracle.int_store.set_interval(Variable(1), tmp);
@@ -241,6 +241,7 @@ test03() {
Integer_Int_Interval tmp1(2);
tmp1.join_assign(3);
nout << "A in " << tmp << " and B in " << tmp1 << endl;
+
Test_Oracle oracle(Integer_Interval_Abstract_Store(2));
oracle.int_store.set_interval(Variable(0), tmp);
oracle.int_store.set_interval(Variable(1), tmp1);
@@ -252,6 +253,10 @@ test03() {
Integer_Int_Interval inh_term(-2);
inh_term.join_assign(-3);
+ Integer_Int_Interval a1(-1);
+
+ Integer_Int_Interval b1(-1);
+
Integer_Int_Interval inh_term1(-1);
inh_term1.join_assign(-4);
@@ -263,8 +268,8 @@ test03() {
Int_Constant<C_Expr> coeff_a(Integer_Type, a);
Int_Constant<C_Expr> coeff_b(Integer_Type, b);
Int_Constant<C_Expr> coeff_inh_term(Integer_Type, inh_term);
- Int_Constant<C_Expr> coeff_a1(Integer_Type, a);
- Int_Constant<C_Expr> coeff_b1(Integer_Type, a);
+ Int_Constant<C_Expr> coeff_a1(Integer_Type, a1);
+ Int_Constant<C_Expr> coeff_b1(Integer_Type, b1);
Int_Constant<C_Expr> coeff_inh_term1(Integer_Type, inh_term1);
Binary_Operator<C_Expr> term_a(Integer_Type, Binary_Operator<C_Expr>::MUL,
@@ -299,9 +304,9 @@ test03() {
known_result += b * Integer_Linear_Form(B);
known_result += inh_term;
- Integer_Linear_Form lf = Integer_Linear_Form(A);
- lf *= a;
- lf += a * Integer_Linear_Form(B);
+ Integer_Linear_Form lf = A;
+ lf *= a1;
+ lf += b1 * Integer_Linear_Form(B);
lf += inh_term1;
linearize_int(bxor, oracle, Integer_Linear_Form_Abstract_Store(), result);
@@ -390,7 +395,7 @@ test04() {
nout << endl;
bool ok = result == known_result ;
- ;
+
return ok;
}
More information about the PPL-devel
mailing list