From 5badb6b27dc8edd3dfeb3f6188becbbc4a46dea2 Mon Sep 17 00:00:00 2001 From: Aleksey Lobanov Date: Mon, 24 Feb 2020 22:48:55 +0300 Subject: [PATCH] Fixed missprint with var negation (4) --- al_function.hpp | 2 +- main.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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;