
Module: ppl/ppl Branch: bounded_arithmetic Commit: 20d6899edb2b8be27a6f04e7ddacd37d6b4df964 URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=20d6899edb2b8...
Author: Alberto Gioia alberto.gioia1@studenti.unipr.it Date: Sat Aug 27 18:12:17 2011 +0200
Minor changes to the code.
---
tests/Concrete_Expression/linearize_int.cc | 83 ++++++++++++++-------------- 1 files changed, 42 insertions(+), 41 deletions(-)
diff --git a/tests/Concrete_Expression/linearize_int.cc b/tests/Concrete_Expression/linearize_int.cc index 6bf18cc..2b0c1ad 100644 --- a/tests/Concrete_Expression/linearize_int.cc +++ b/tests/Concrete_Expression/linearize_int.cc @@ -135,13 +135,6 @@ test01(){ known_result_lshift = known_result_or; known_result_rshift = known_result_or;
- linearize_int(bor, oracle, Integer_Linear_Form_Abstract_Store(), result_or); - nout << "*** " << known_result_or << " | " << lf << " ***" << endl - << "*** result_or *** " << endl - << result_or << endl; - known_result_or |= lf; - nout << endl; - linearize_int(band, oracle, Integer_Linear_Form_Abstract_Store(), result_and); nout << "*** " << known_result_and << " & " << lf << " ***" << endl << "*** result_and *** " << endl @@ -149,6 +142,13 @@ test01(){ known_result_and &= lf; nout << endl;
+ linearize_int(bor, oracle, Integer_Linear_Form_Abstract_Store(), result_or); + nout << "*** " << known_result_or << " | " << lf << " ***" << endl + << "*** result_or *** " << endl + << result_or << endl; + known_result_or |= lf; + nout << endl; + linearize_int(bxor, oracle, Integer_Linear_Form_Abstract_Store(), result_xor); nout << "*** " << known_result_xor << " ^ " << lf << " ***" << endl << "*** result_xor *** " << endl @@ -175,10 +175,10 @@ test01(){ nout << endl;
bool ok = - (result_or == known_result_or) - && (result_and == known_result_and) && + (result_or == known_result_or) + && (result_xor == known_result_xor) && (result_lshift == known_result_lshift) @@ -312,9 +312,9 @@ test02(){ nout << endl;
bool ok = - (result_or == known_result_or) - && (result_and == known_result_and) + && + (result_or == known_result_or) && (result_xor == known_result_xor) && @@ -457,10 +457,10 @@ test03(){ nout << endl;
bool ok = - (result_or == known_result_or) - && (result_and == known_result_and) && + (result_or == known_result_or) + && (result_xor == known_result_xor) && (result_lshift == known_result_lshift) @@ -593,10 +593,10 @@ test04(){ nout << endl;
bool ok = - (result_or == known_result_or) - && (result_and == known_result_and) && + (result_or == known_result_or) + && (result_xor == known_result_xor) && (result_lshift == known_result_lshift) @@ -740,10 +740,10 @@ test05(){ nout << endl;
bool ok = - (result_or == known_result_or) - && (result_and == known_result_and) && + (result_or == known_result_or) + && (result_xor == known_result_xor) && (result_lshift == known_result_lshift) @@ -832,10 +832,10 @@ test06(){ nout << endl;
bool ok = - (result_or == known_result_or) - && (result_and == known_result_and) && + (result_or == known_result_or) + && (result_xor == known_result_xor) && (result_lshift == known_result_lshift) @@ -896,20 +896,23 @@ test07(){ bool failed_or = false; bool failed_xor = false;
- if (!linearize_int(bor, oracle, Integer_Linear_Form_Abstract_Store(), - result_or)) { + nout << "*** " << known_result_and << " << " << lf << " ***" << endl; + if (!linearize_int(band, oracle, Integer_Linear_Form_Abstract_Store(), + result_and)) { nout << "*** Linearization failed, the two linear forms have " << "different size *** " << endl << endl; - failed_or = true; + failed_and = true; }
- if (!linearize_int(band, oracle, Integer_Linear_Form_Abstract_Store(), - result_and)) { + nout << "*** " << known_result_or << " << " << lf << " ***" << endl; + if (!linearize_int(bor, oracle, Integer_Linear_Form_Abstract_Store(), + result_or)) { nout << "*** Linearization failed, the two linear forms have " << "different size *** " << endl << endl; - failed_and = true; + failed_or = true; }
+ nout << "*** " << known_result_xor << " << " << lf << " ***" << endl; if (!linearize_int(bxor, oracle, Integer_Linear_Form_Abstract_Store(), result_xor)) { nout << "*** Linearization failed, the two linear forms have " @@ -934,10 +937,10 @@ test07(){ nout << endl;
bool ok = - (failed_or) - && (failed_and) && + (failed_or) + && (failed_xor) && (result_lshift == known_result_lshift) @@ -1017,13 +1020,6 @@ test08(){ known_result_lshift = known_result_or; known_result_rshift = known_result_or;
- linearize_int(bor, oracle, Integer_Linear_Form_Abstract_Store(), result_or); - nout << "*** " << known_result_or << " | " << lf << " ***" << endl - << "*** result_or *** " << endl - << result_or << endl; - known_result_or |= lf; - nout << endl; - linearize_int(band, oracle, Integer_Linear_Form_Abstract_Store(), result_and); nout << "*** " << known_result_and << " & " << lf << " ***" << endl << "*** result_and *** " << endl @@ -1031,6 +1027,13 @@ test08(){ known_result_and &= lf; nout << endl;
+ linearize_int(bor, oracle, Integer_Linear_Form_Abstract_Store(), result_or); + nout << "*** " << known_result_or << " | " << lf << " ***" << endl + << "*** result_or *** " << endl + << result_or << endl; + known_result_or |= lf; + nout << endl; + linearize_int(bxor, oracle, Integer_Linear_Form_Abstract_Store(), result_xor); nout << "*** " << known_result_xor << " ^ " << lf << " ***" << endl << "*** result_xor *** " << endl @@ -1058,10 +1061,10 @@ test08(){ nout << endl;
bool ok = - (result_or == known_result_or) - && (result_and == known_result_and) && + (result_or == known_result_or) + && (result_xor == known_result_xor) && (result_lshift == known_result_lshift) @@ -1168,6 +1171,7 @@ test09(){ known_result_xor = known_result_and; known_result_lshift = known_result_and; known_result_rshift = known_result_and; + linearize_int(band, oracle, Integer_Linear_Form_Abstract_Store(), result_and); nout << "*** " << known_result_and << " & " << lf << " ***" << endl << "*** result_and *** " << endl @@ -1189,9 +1193,6 @@ test09(){ known_result_xor ^= lf; nout << endl;
- // b1 *= tmp1; - //inh_term1 += b1; - bool failed_lshift = false; bool failed_rshift = false;
@@ -1212,10 +1213,10 @@ test09(){ }
bool ok = - (result_or == known_result_or) - && (result_and == known_result_and) && + (result_or == known_result_or) + && (result_xor == known_result_xor) && failed_lshift