[gringo] 03/05: add patch to fix #min/#max translation bug

Thomas Krennwallner tkren-guest at moszumanska.debian.org
Sun May 1 07:01:22 UTC 2016


This is an automated email from the git hooks/post-receive script.

tkren-guest pushed a commit to branch devel
in repository gringo.

commit 12698ff214bc7dadad6d35619fff28f431611638
Author: Thomas Krennwallner <tkren at kr.tuwien.ac.at>
Date:   Sun May 1 07:44:25 2016 +0200

    add patch to fix #min/#max translation bug
    
    gringo-translate-minmax.patch fixes incorrect answers caused by a bug in
    
    Upstream bug 119: https://sourceforge.net/p/potassco/bugs/119/
---
 debian/patches/gringo-translate-minmax.patch | 29 ++++++++++++++++++++++++++++
 debian/patches/series                        |  1 +
 2 files changed, 30 insertions(+)

diff --git a/debian/patches/gringo-translate-minmax.patch b/debian/patches/gringo-translate-minmax.patch
new file mode 100644
index 0000000..bda6d15
--- /dev/null
+++ b/debian/patches/gringo-translate-minmax.patch
@@ -0,0 +1,29 @@
+Author: Roland Kaminski <kaminski at cs.uni-potsdam.de>
+Description: fixes translation bug of #min/#max aggregates
+Bug: https://sourceforge.net/p/potassco/bugs/119/
+Index: gringo-git-gbp/libgringo/src/output/aggregates.cc
+===================================================================
+--- gringo-git-gbp.orig/libgringo/src/output/aggregates.cc
++++ gringo-git-gbp/libgringo/src/output/aggregates.cc
+@@ -192,13 +192,15 @@ ULit MinMaxTranslator::translate(LparseT
+         ULitVec antecedent;
+         ULitVec consequent;
+         for (auto &elem : elems) {
+-            if (bound.first.contains(elem.second)) {
+-                if (isMin) { consequent.emplace_back(get_clone(elem.first)); }
++            if (res.range.contains(elem.second)) {
++                if (bound.first.contains(elem.second)) {
++                    if (isMin) { consequent.emplace_back(get_clone(elem.first)); }
++                }
++                else if (bound.second.contains(elem.second)) {
++                    if (!isMin) { consequent.emplace_back(get_clone(elem.first)); }
++                }
++                else if (hasAntecedent) { antecedent.emplace_back(get_clone(elem.first)); }
+             }
+-            else if (bound.second.contains(elem.second)) {
+-                if (!isMin) { consequent.emplace_back(get_clone(elem.first)); }
+-            }
+-            else if (hasAntecedent) { antecedent.emplace_back(get_clone(elem.first)); }
+         }
+         if (hasAntecedent) {
+             assert(!antecedent.empty());
diff --git a/debian/patches/series b/debian/patches/series
index a23077b..43a7337 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 gringo-manpages.patch
 gringo-include-math.patch
 gringo-solve-multi.patch
+gringo-translate-minmax.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/gringo.git



More information about the debian-science-commits mailing list