[gringo] 01/03: add patch from upstream commit 02c6d85 to fix wrong assertion

Thomas Krennwallner tkren-guest at moszumanska.debian.org
Sat Nov 4 11:28:57 UTC 2017


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

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

commit 62727d7e513487ed54bcb448aa41d2d5fbc62f24
Author: Thomas Krennwallner <tkren at kr.tuwien.ac.at>
Date:   Sat Nov 4 10:08:45 2017 +0000

    add patch from upstream commit 02c6d85 to fix wrong assertion
---
 debian/patches/gringo-manpages.patch               |  2 +-
 debian/patches/gringo-remove-wrong-assertion.patch | 48 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 50 insertions(+), 1 deletion(-)

diff --git a/debian/patches/gringo-manpages.patch b/debian/patches/gringo-manpages.patch
index 8a16f98..034401a 100644
--- a/debian/patches/gringo-manpages.patch
+++ b/debian/patches/gringo-manpages.patch
@@ -80,7 +80,7 @@ index 0000000..ba04b34
 +for the Debian project (and may be used by others).
 diff --git a/gringo.1 b/gringo.1
 new file mode 100644
-index 0000000..544a12a
+index 0000000..7587e8e
 --- /dev/null
 +++ b/gringo.1
 @@ -0,0 +1,60 @@
diff --git a/debian/patches/gringo-remove-wrong-assertion.patch b/debian/patches/gringo-remove-wrong-assertion.patch
new file mode 100644
index 0000000..56caec4
--- /dev/null
+++ b/debian/patches/gringo-remove-wrong-assertion.patch
@@ -0,0 +1,48 @@
+From: Benjamin Kaufmann <kaufmann at cs.uni-potsdam.de>
+Origin: upstream, https://github.com/potassco/clasp/commit/02c6d85573f2372342035239223acbbe4f4991e0.patch
+Bug: https://github.com/potassco/clasp/issues/13
+Date: Fri, 3 Nov 2017 19:14:27 +0100
+Subject: Remove wrong assertion
+
+  * The assertion failed to consider the case where
+    a disjunction was eq to some atom that itself
+    was part of a disjunction.
+
+Fixes #13
+---
+ clasp/src/logic_program.cpp      | 1 -
+ clasp/tests/dlp_builder_test.cpp | 9 +++++++++
+ 2 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/clasp/src/logic_program.cpp b/clasp/src/logic_program.cpp
+index 059cd89..08a0224 100644
+--- a/clasp/src/logic_program.cpp
++++ b/clasp/src/logic_program.cpp
+@@ -1277,7 +1277,6 @@ void LogicProgram::finalizeDisjunctions(Preprocessor& p, uint32 numSccs) {
+ 		d->destroy();
+ 		// create shortcut for supports to avoid duplications during shifting
+ 		Literal supportLit = dx != bot ? getEqAtomLit(dx, supports, p, sccMap) : dx;
+-		POTASSCO_ASSERT(dx == bot || getRootAtom(supportLit.var())->var() == dx.var());
+ 		// create shifted rules and split disjunctions into non-hcf components
+ 		for (VarVec::iterator hIt = head.begin(), hEnd = head.end(); hIt != hEnd; ++hIt) {
+ 			uint32 scc = getAtom(*hIt)->scc();
+diff --git a/clasp/tests/dlp_builder_test.cpp b/clasp/tests/dlp_builder_test.cpp
+index 88f01a3..68cb772 100644
+--- a/clasp/tests/dlp_builder_test.cpp
++++ b/clasp/tests/dlp_builder_test.cpp
+@@ -171,6 +171,15 @@ TEST_CASE("Disjunctive logic programs", "[asp][dlp]") {
+ 		REQUIRE(ctx.master()->isTrue(lp.getLiteral(b)));
+ 	}
+ 
++	SECTION("testOddLoop") {
++		lpAdd(lp.start(ctx),
++			"a|b :- not c.\n"
++			"c|d :- not a.\n");
++		REQUIRE((lp.endProgram() && ctx.endInit()));
++		REQUIRE(lp.stats.disjunctions[0] == 2);
++		REQUIRE(lp.stats.disjunctions[1] == 0);
++	}
++
+ 	SECTION("testNoEqRegression") {
+ 		lpAdd(lp.start(ctx, LogicProgram::AspOptions().noEq()),
+ 			"{c}.\n"
diff --git a/debian/patches/series b/debian/patches/series
index 95843bd..5458570 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 gringo-manpages.patch
+gringo-remove-wrong-assertion.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