diff --git a/al_function.hpp b/al_function.hpp index b80f1c8..4d845cc 100644 --- a/al_function.hpp +++ b/al_function.hpp @@ -102,7 +102,7 @@ class Function { case 4: mask = mask_4; remains = remains_4; - shift = shift_3; + shift = shift_4; break; default: assert(false); diff --git a/main.cpp b/main.cpp index 450dc99..3570545 100644 --- a/main.cpp +++ b/main.cpp @@ -42,6 +42,8 @@ void test_function() { assert(("f(x_1 + 1 + 1, x_2, x_3) == f", negation == negation.var_negation(1).var_negation(1))); assert(("f(x_1, x_2 + 1 + 1, x_3) == f", negation == negation.var_negation(2).var_negation(2))); assert(("f(x_1, x_2, x_3 + 1 + 1) == f", negation == negation.var_negation(3).var_negation(3))); + assert((Function("0000000100010111").var_negation(1).string() == "0000001000101011")); + assert((Function("0000000100010111").var_negation(4).string() == "0001011100000001")); /* cout << "f(x_1, x_2, x_3) = " << negation.string() << endl; cout << "f(x_1 + 1, x_2, x_3) = " << negation.var_negation(1).string() << endl;