From 1d07b8933a7a6214da9954fae409dccf16dd748b Mon Sep 17 00:00:00 2001
From: Tobias Winkler <tobias.winkler@cs.rwth-aachen.de>
Date: Fri, 21 Jan 2022 11:10:59 -0500
Subject: [PATCH] fix subtraction

---
 src/Dist.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/Dist.cpp b/src/Dist.cpp
index 460a0a7..50feec3 100644
--- a/src/Dist.cpp
+++ b/src/Dist.cpp
@@ -296,6 +296,7 @@ namespace prodigy {
         } else if (is_a<mul>(term)) {
             size_t subexpr_count = term.nops();
             if (subexpr_count == 2){
+                // todo this case probably has some errors and needs debugging!!
                 // something like x*y || 2*x
                 ex first=term.op(0);
                 ex second=term.op(1);
@@ -308,7 +309,7 @@ namespace prodigy {
                 } else if (first.info(info_flags::symbol) && second.info(info_flags::negint)){
                     // e.g. -y || -1 * y
                     std::cerr << "Warning! This might lead to undesired behavior!" << std::endl;
-                    res = res.subs(term == x*pow(first, second));
+                    res = res.subs(first == first*pow(x, second));
                 } else if (second.info(info_flags::symbol) && first.info(info_flags::negint)){
                     // e.g. y * -1
                     std::cerr << "Warning! This might lead to undesired behavior!" << std::endl;
-- 
GitLab