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

Thomas Krennwallner tkren-guest at moszumanska.debian.org
Sat Nov 4 10:21:05 UTC 2017


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

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

commit a527d3985098284115d04de1fb2d4ce76ea2c0e7
Author: Thomas Krennwallner <tkren at kr.tuwien.ac.at>
Date:   Sat Nov 4 09:30:58 2017 +0000

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

diff --git a/debian/patches/clasp-manpage.patch b/debian/patches/clasp-manpage.patch
index fe6956e..4d939e1 100644
--- a/debian/patches/clasp-manpage.patch
+++ b/debian/patches/clasp-manpage.patch
@@ -1,5 +1,5 @@
 From: Thomas Krennwallner <tkren at kr.tuwien.ac.at>
-Date: Wed Nov 30 08:39:00 2016 +0100
+Date: Wed, 30 Nov 2016 08:39:00 +0100
 Subject: Add clasp.1 manpage
 
 ===================================================================
diff --git a/debian/patches/clasp-remove-wrong-assertion.patch b/debian/patches/clasp-remove-wrong-assertion.patch
new file mode 100644
index 0000000..993d824
--- /dev/null
+++ b/debian/patches/clasp-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
+---
+ src/logic_program.cpp      | 1 -
+ tests/dlp_builder_test.cpp | 9 +++++++++
+ 2 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/src/logic_program.cpp b/src/logic_program.cpp
+index 059cd89..08a0224 100644
+--- a/src/logic_program.cpp
++++ b/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/tests/dlp_builder_test.cpp b/tests/dlp_builder_test.cpp
+index 88f01a3..68cb772 100644
+--- a/tests/dlp_builder_test.cpp
++++ b/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 b31f497..dad97ed 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 clasp-manpage.patch
+clasp-remove-wrong-assertion.patch

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



More information about the debian-science-commits mailing list