From: Thomas Krennwallner Date: Tue, 20 Dec 2016 04:10:36 +0000 (+0000) Subject: Import gringo_5.1.0-4.debian.tar.xz X-Git-Tag: archive/raspbian/5.3.0-13+rpi1~1^2^2~6^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d0690f1036b5eacfd153f9a9bb170b68e4ee12fc;p=gringo.git Import gringo_5.1.0-4.debian.tar.xz [dgit import tarball gringo 5.1.0-4 gringo_5.1.0-4.debian.tar.xz] --- d0690f1036b5eacfd153f9a9bb170b68e4ee12fc diff --git a/NEWS.Debian b/NEWS.Debian new file mode 100644 index 0000000..c870da2 --- /dev/null +++ b/NEWS.Debian @@ -0,0 +1,12 @@ +gringo (5.1.0-1) unstable; urgency=medium + + The gringo and reify programs drop direct support for smodels output + format and use the new asp intermediate format (aspif) instead. The + clasp solver automatically supports aspif starting with version 3.2.0 + and later. If you need to ground a logic program to smodels format, + you can translate aspif to smodels format with the lpconvert tool, + which is part of this package. See also + for a + detailed description of the asp intermediate format. + + -- Thomas Krennwallner , Sun, 11 Dec 2016 09:51:56 +0100 diff --git a/changelog b/changelog new file mode 100644 index 0000000..806909a --- /dev/null +++ b/changelog @@ -0,0 +1,364 @@ +gringo (5.1.0-4) unstable; urgency=medium + + * fix FTBFS on alpha: do not define FPU_SWITCH_DOUBLE on alpha, + _FPU_GETCW and friends are undefined on this arch + + -- Thomas Krennwallner Tue, 20 Dec 2016 05:10:36 +0100 + +gringo (5.1.0-3) unstable; urgency=medium + + * debian/rules: fix FTBFS on architectures that require -latomic + + -- Thomas Krennwallner Fri, 16 Dec 2016 08:13:33 +0100 + +gringo (5.1.0-2) unstable; urgency=medium + + * debian/rules: fix C++11 threads + - link with libatomic on architectures that need it + - disable threads and define BROKEN_STD_EXCEPTION_PTR on armel + * gringo-broken-std-exception_ptr.patch: add support for armel + + -- Thomas Krennwallner Thu, 15 Dec 2016 06:49:16 +0100 + +gringo (5.1.0-1) unstable; urgency=medium + + * New upstream version 5.1.0 + * debian/copyright: update copyright year and github source + * debian/control + - Build-Depends on g++ >= 4:6.1.1 replaces libtbb-dev + - point Homepage to https://www.potassco.org + - use https for Vcs-* + - add Breaks clasp (<< 3.2.1-1) + * debian/rules + - build lpconvert + - drop libtbb-dev and use c++11 multi-threading + - disable threads on powerpc,powerpcspe,m68k,mips,mipsel,sh4 + * drop already applied upstream patches: gringo-include-math.patch, + gringo-solve-multi.patch, gringo-translate-minmax.patch + * gringo-fix-body-literals-as-auxiliary.patch: add upstream patch + cherry-picked from d6cfb89df6bbf138ca3e259d71ca7050b322b5d5 + + -- Thomas Krennwallner Sun, 11 Dec 2016 13:12:35 +0100 + +gringo (4.5.4-4) unstable; urgency=medium + + * Bug fix: "please make the build reproducible", thanks to + Reiner Herrmann (Closes: #844096). + + -- Thomas Krennwallner Wed, 07 Dec 2016 08:27:20 +0100 + +gringo (4.5.4-3) unstable; urgency=medium + + * Fix gringo-multi-solver.patch: this fixes an FTBFS on architectures + that have WITH_THREAD=0, i.e., all architectures except amd64 and + ppc64. + + -- Thomas Krennwallner Mon, 02 May 2016 07:18:34 +0200 + +gringo (4.5.4-2) unstable; urgency=medium + + * Bug fix: "FTBFS: error: 'pow' is not a member of 'std'", thanks to + Martin Michlmayr (Closes: #822383). + * Add patch to fix random python multithreading segfaults (upstream bug 117) + * Add patch to fix #min/#max translation bug (upstream bug 119) + * Build with liblua5.3 + * Bump Standards-Version to 3.9.8 + + -- Thomas Krennwallner Sun, 01 May 2016 08:47:29 +0200 + +gringo (4.5.4-1) unstable; urgency=medium + + * Imported Upstream version 4.5.4 + + -- Thomas Krennwallner Sat, 19 Dec 2015 14:07:05 +0100 + +gringo (4.5.3-1) unstable; urgency=medium + + * Imported Upstream version 4.5.3 + + -- Thomas Krennwallner Sat, 26 Sep 2015 09:31:03 +0200 + +gringo (4.5.1-1) unstable; urgency=medium + + * Imported Upstream version 4.5.1 + * Add reify.1 manpage + + -- Thomas Krennwallner Mon, 13 Jul 2015 09:01:56 +0200 + +gringo (4.5.0-1) unstable; urgency=medium + + * Bump Standards-Version to 3.9.6. + * Imported Upstream version 4.5.0 + * debian/control: Add Breaks: aspcud (<= 1.9.0-2). Add reify description. + * debian/copyright: Update copyright information, remove outdated files. + * debian/docs: Remove NOTES. + * debian/install: Install reify. + * debian/rules: Build reify. + + -- Thomas Krennwallner Sat, 11 Jul 2015 09:36:10 +0200 + +gringo (4.4.0-1) unstable; urgency=low + + * New upstream release. + * debian/control: Remove Suggests on potassco-guide. + * debian/control: Fix Vcs fields to use anonscm.debian.org. + * Setup git repository to use git-buildpackage. + * Import upstream sources with git-import-orig --pristine-tar. + + -- Thomas Krennwallner Mon, 18 Aug 2014 17:10:34 +0200 + +gringo (4.3.0-2) unstable; urgency=low + + * Bug fix: "non-standard gcc/g++ used for build (gcc-4.8)", thanks to + Matthias Klose (Closes: #751317). + * Build with system-wide liblua5.2-dev. + + -- Thomas Krennwallner Thu, 12 Jun 2014 09:16:31 +0200 + +gringo (4.3.0-1) unstable; urgency=low + + * New upstream release. + + -- Thomas Krennwallner Wed, 26 Feb 2014 13:06:29 +0100 + +gringo (4.2.1-4) unstable; urgency=low + + * Bug fix: "add ppc64el to architecture list for libtbb-dev to fix + FTBFS", thanks to Logan Rosen (Closes: #735005). + + -- Thomas Krennwallner Sun, 12 Jan 2014 19:22:44 +0100 + +gringo (4.2.1-3) unstable; urgency=low + + * debian/control: Breaks aspcud <= 2012.10.24-6 after discussion with + upstream. + Remove spurious Build-Depends on libboost-filesystem-dev and + libboost-system-dev. + + -- Thomas Krennwallner Wed, 18 Dec 2013 09:42:59 +0100 + +gringo (4.2.1-2) unstable; urgency=low + + * debian/control: FTBFS on ia64 sparc powerpc, Build-Depends is now + g++-4.8 >= 4.8.0. + * debian/rules: Set CXX to g++-4.8. + + -- Thomas Krennwallner Tue, 17 Dec 2013 07:07:54 +0100 + +gringo (4.2.1-1) unstable; urgency=low + + gringo 4.2 adds support for {i,o,}clingo again. + + * New upstream release. + * debian/watch: Back to watching all releases of gringo. + * debian/rules: Add scons, python, tbb, and hardening support. + * debian/install: Install gringo and clingo. + * debian/gringo.links: Symlink clingo binary and manpage to {i,o}clingo. + * debian/gringo.manpages: Remove iclingo manpage. + * debian/control: Build-Depends on bison, scons, g++ >= 4.8.0, + libpython2.7-dev, libtbb-dev. + Bump Standards-Version to 3.9.5. + + -- Thomas Krennwallner Mon, 16 Dec 2013 16:28:42 +0100 + +gringo (3.0.5-1) unstable; urgency=low + + * New upstream release. + * debian/copyright: Update copyright years. + * debian/compat: Bump to version 9. + * debian/control: + - Remove DM-Upload-Allowed. + - Build-Depends on debhelper >= 9. + * debian/watch: Only watch upstream gringo >= 3. + * debian/patches/gringo-clang-gcc.patch debian/patches/gringo-cond.patch + debian/patches/gringo-domain-fwd-decl.patch + debian/patches/gringo-unpool-pred.patch debian/patches/series: Remove + already applied patches. + + -- Thomas Krennwallner Tue, 21 May 2013 19:04:24 +0200 + +gringo (3.0.4-4) unstable; urgency=low + + * Apply upstream patches from subversion r6200 and r6237 for fixing + potassco bugs 75 and 76, resp. + * debian/patches/gringo-cond.patch: New file originally from + http://sourceforge.net/p/potassco/code/6291/tree/tags/gringo-3.0.4/patches/patch-cond.diff?format=raw. + * debian/patches/gringo-unpool-pred.patch: New file originally from + http://sourceforge.net/p/potassco/code/6291/tree/tags/gringo-3.0.4/patches/patch-unpool-pred.diff?format=raw. + * debian/control: Bump Standards-Version to 3.9.4. + + -- Thomas Krennwallner Thu, 22 Nov 2012 10:40:56 +0100 + +gringo (3.0.4-3) unstable; urgency=low + + * Bug fix: "please build-depend on unversionend boost libraries", thanks + to Ralf Treinen (Closes: #672933). + + -- Thomas Krennwallner Wed, 23 May 2012 15:25:09 +0200 + +gringo (3.0.4-2) unstable; urgency=low + + * debian/patches/gringo-clang-gcc.patch: New file originally from + https://potassco.svn.sourceforge.net/svnroot/potassco/tags/gringo-3.0.4/patches/patch-clang.diff. + * Bug fix: "ftbfs with GCC-4.7", thanks to Matthias Klose (Closes: + #667193). + * debian/control: Bump Standards-Version to 3.9.3. + + -- Thomas Krennwallner Tue, 10 Apr 2012 16:48:52 +0200 + +gringo (3.0.4-1ubuntu1~oneiric1) oneiric; urgency=low + + * Upload to ppa:~tkren/asp. + + -- Thomas Krennwallner Fri, 27 Jan 2012 08:08:04 +0100 + +gringo (3.0.4-1) unstable; urgency=low + + * New upstream release. + + -- Thomas Krennwallner Thu, 26 Jan 2012 14:59:59 +0100 + +gringo (3.0.3-7) unstable; urgency=low + + * debian/copyright: Fix comma-separated-files-in-dep5-copyright, + obsolete-field-in-dep5-copyright and unversioned-copyright-format-uri + lintian warnings. + * Bug fix: "FTBFS: clone_allocator.hpp:34:27: error: invalid use of + incomplete type ", thanks to Lucas Nussbaum + (Closes: #652787). + * debian/patches/gringo-domain-fwd-decl.patch: New file. + * debian/control: Build-Depends on re2c to recreate parser.cpp from + parser.r2c, add boost version libboost-*N.MM-dev. + * debian/rules: Add override_dh_auto_configure and remove parser.cpp and + converter.cpp to force recreation of re2c lexer files. + + -- Thomas Krennwallner Sun, 25 Dec 2011 18:44:20 +0100 + +gringo (3.0.3-6) unstable; urgency=low + + * debian/control: Setup as Debian Science project. + - Set Maintainer to Debian Science Maintainers and Uploaders to Thomas + Krennwallner. + - Set DM-Upload-Allowed to yes. + - Convert bzr repository to git and use Vcs-Git and Vcs-Browser + accordingly. + - Build-Depends on debhelper >= 8.0.0. + * debian/rules: Add override_dh_auto_build to get rid off + debian/patches/gringo-makefile.patch. + * debian/patches/gringo-makefile.patch debian/patches/series: Remove + debian/patches/gringo-makefile.patch. + + -- Thomas Krennwallner Mon, 05 Sep 2011 13:21:51 +0200 + +gringo (3.0.3-5~natty1) natty; urgency=low + + * debian/watch: Fix lintian debian-watch-contains-dh_make-template. + * debian/control: Lower Priority to extra and bump Standards-Version to + 3.9.2. + + -- Thomas Krennwallner Fri, 29 Apr 2011 07:11:12 +0200 + +gringo (3.0.3-4) unstable; urgency=low + + * debian/control: Combine gringo, clingo, and iclingo binary packages + into gringo. + + Conflicts and Replaces clingo and iclingo. + * debian/copyright: Convert to DEP-5 format and add missing licenses. + * debian/rules: Add override_dh_installchangelogs for CHANGES file. + * debian/install: Install gringo, clingo and iclingo. + * Refresh debian/patches/gringo-makefile.patch; do not install anything + here. + + -- Thomas Krennwallner Tue, 22 Feb 2011 09:38:26 +0100 + +gringo (3.0.3-3) unstable; urgency=low + + * Initial upload (Closes: #605879) + + -- Thomas Krennwallner Sun, 05 Dec 2010 18:01:28 +0100 + +gringo (3.0.3-2) unstable; urgency=low + + * Upload to mentors.debian.net. + + -- Thomas Krennwallner Sat, 20 Nov 2010 09:43:35 +0100 + +gringo (3.0.3-1~maverick1) maverick; urgency=low + + * New upstream release. + + * Fix changelog entries. + + -- Thomas Krennwallner Fri, 12 Nov 2010 05:53:36 +0100 + +gringo (3.0.2-2~maverick1) maverick; urgency=low + + * Tag distro-series. + + * Fix Standards-Version and Priority. + + * Suggest potassco-guide. + + * Fix missing changelog. + + * Add additional authors to copyright. + + -- Thomas Krennwallner Sun, 10 Oct 2010 08:50:01 +0200 + +gringo (3.0.2-1) lucid; urgency=low + + * New upstream release. + + -- Thomas Krennwallner Mon, 04 Oct 2010 22:03:12 +0200 + +gringo (3.0.1-2) lucid; urgency=low + + * Build with system-wide liblua5.1-dev. + + -- Thomas Krennwallner Wed, 28 Jul 2010 06:15:10 +0200 + +gringo (3.0.1-1) lucid; urgency=low + + * New upstream release. + + -- Thomas Krennwallner Tue, 27 Jul 2010 06:00:34 +0200 + +gringo (2.0.5-6) lucid; urgency=low + + * Switch to dpkg-source 3.0 (quilt) format. + + * Fix lintian warning debhelper-but-no-misc-depends: add ${misc:Depends} to potassco-guide. + + -- Thomas Krennwallner Sun, 06 Jun 2010 18:18:22 +0200 + +gringo (2.0.5-5) lucid; urgency=low + + * Added watch file. + + * Added Vcs-Bzr to control. + + -- Thomas Krennwallner Tue, 01 Jun 2010 14:47:13 +0200 + +gringo (2.0.5-4) lucid; urgency=low + + * Set Architecture of all binary packages to "any". + + -- Thomas Krennwallner Fri, 28 May 2010 09:21:58 +0200 + +gringo (2.0.5-3) lucid; urgency=low + + * Set Architecture of all binary packages to "all". + + -- Thomas Krennwallner Fri, 28 May 2010 07:04:46 +0200 + +gringo (2.0.5-2) lucid; urgency=low + + * Moved to Ubuntu PPA. + + -- Thomas Krennwallner Wed, 26 May 2010 00:33:32 +0200 + +gringo (2.0.5-1) unstable; urgency=low + + * Initial release. + + -- Thomas Krennwallner Thu, 04 Mar 2010 19:47:14 +0100 diff --git a/compat b/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/compat @@ -0,0 +1 @@ +9 diff --git a/control b/control new file mode 100644 index 0000000..078503d --- /dev/null +++ b/control @@ -0,0 +1,48 @@ +Source: gringo +Section: interpreters +Priority: extra +Maintainer: Debian Science Maintainers +Uploaders: Thomas Krennwallner +Build-Depends: debhelper (>= 9), + g++ (>= 4:6.1.1), + scons, + re2c, + bison, + liblua5.3-dev, + libpython2.7-dev +Standards-Version: 3.9.8 +Vcs-Git: https://anonscm.debian.org/git/debian-science/packages/gringo.git +Vcs-Browser: https://anonscm.debian.org/cgit/debian-science/packages/gringo.git +Homepage: https://www.potassco.org/clasp/ + +Package: gringo +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Recommends: clasp +Replaces: clingo, iclingo +Conflicts: clingo, iclingo +Breaks: + aspcud (<= 1.9.0-2), + clasp (<< 3.2.1-1) +Description: grounding tools for (disjunctive) logic programs + Current answer set solvers work on variable-free programs. Hence, a + grounder is needed that, given an input program with first-order + variables, computes an equivalent ground (variable-free) program. + . + This package contains the following tools: + . + - gringo: a grounder that, given an input program with first-order + variables, computes an equivalent ground (variable-free) program in + aspif format. Its output can be processed further with answer set + solver clasp. Starting with gringo series 5, its output is no longer + directly compatible with solvers like smodels or cmodels reading + smodels format. Use lpconvert for translating aspif format to + smodels format. + - clingo: combines both gringo and clasp into a monolithic system. + This way it offers more control over the grounding and solving + process than gringo and clasp can offer individually: multi-shot + solving. + - lpconvert: converter between gringo's aspif and smodels format. + - reify: small utility that reifies logic programs given in aspif + format. It produces a set of facts, which can be processed further + with gringo. diff --git a/copyright b/copyright new file mode 100644 index 0000000..57aa1f6 --- /dev/null +++ b/copyright @@ -0,0 +1,229 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: gringo +Upstream-Contact: Roland Kaminski +Source: https://github.com/potassco/clingo/releases + +Files: * +Copyright: 2008-2013, Roland Kaminski +License: GPL-3+ + +Files: app/* +Copyright: 2013, 2015, 2016, Benjamin Kaufmann +License: GPL-3+ + +Files: app/cexample/* +Copyright: 2008-2013, Roland Kaminski +License: GPL-3+ + +Files: app/clingo/* +Copyright: 2008-2013, Roland Kaminski +License: GPL-3+ + +Files: app/clingo/src/* +Copyright: 2013, Roland Kaminski + 2013, Benjamin Kaufmann +License: GPL-3+ + +Files: app/clingo/src/clasp/* +Copyright: 2006-2016, Benjamin Kaufmann +License: GPL-2+ + +Files: app/clingo/src/main.cc +Copyright: 2013, 2015, 2016, Benjamin Kaufmann +License: GPL-3+ + +Files: app/example/* +Copyright: 2013, Roland Kaminski + 2013, Benjamin Kaufmann +License: GPL-3+ + +Files: app/gringo/* +Copyright: 2013, Roland Kaminski +License: GPL-3+ + +Files: app/reify/* +Copyright: 2013, Roland Kaminski +License: GPL-3+ + +Files: debian/* +Copyright: 2010-2016, Thomas Krennwallner +License: GPL-3+ + +Files: libclasp/* +Copyright: 2006-2014, Benjamin Kaufmann +License: GPL-2+ + +Files: libclasp/clasp/* +Copyright: 2006-2016, Benjamin Kaufmann +License: GPL-2+ + +Files: libclasp/clasp/parser.h +Copyright: Benjamin Kaufmann +License: GPL-2+ + +Files: libclasp/clasp/util/hash_map.h +Copyright: 2006-2014, Benjamin Kaufmann +License: GPL-2+ + +Files: libclasp/src/* +Copyright: 2006-2016, Benjamin Kaufmann +License: GPL-2+ + +Files: libclasp/src/parser.cpp + libclasp/src/solver_strategies.cpp +Copyright: Benjamin Kaufmann +License: GPL-2+ + +Files: libclingo/* +Copyright: 2013, Roland Kaminski + 2013, Benjamin Kaufmann +License: GPL-3+ + +Files: libclingo/tests/* +Copyright: Roland Kaminski +License: GPL-3+ + +Files: libclingo/tests/catch.hpp +Copyright: 2012, Two Blue Cubes Ltd. +License: BSL-1.0 + +Files: libclingo/tests/variant.cc +Copyright: 2008-2013, Roland Kaminski +License: GPL-3+ + +Files: libgringo/* +Copyright: 2013, Roland Kaminski +License: GPL-3+ + +Files: libgringo/clingo.h + libgringo/clingo.hh +Copyright: Roland Kaminski +License: GPL-3+ + +Files: libgringo/gringo/symbol.hh +Copyright: Roland Kaminski +License: GPL-3+ + +Files: libgringo/src/control.cc + libgringo/src/symbol.cc +Copyright: Roland Kaminski +License: GPL-3+ + +Files: libgringo/src/output/literal.cc +Copyright: 2008-2013, Roland Kaminski +License: GPL-3+ + +Files: libgringo/tests/catch.hpp +Copyright: 2012, Two Blue Cubes Ltd. +License: BSL-1.0 + +Files: liblp/* +Copyright: 2013, 2015, 2016, Benjamin Kaufmann +License: GPL-3+ + +Files: liblp/potassco/theory_data.h +Copyright: 2006-2016, Benjamin Kaufmann +License: GPL-2+ + +Files: liblp/src/theory_data.cpp +Copyright: 2006-2016, Benjamin Kaufmann +License: GPL-2+ + +Files: liblp/tests/catch.hpp +Copyright: 2012, Two Blue Cubes Ltd. +License: BSL-1.0 + +Files: libprogram_opts/* +Copyright: Benjamin Kaufmann +License: GPL-2+ + +Files: libprogram_opts/program_opts/* +Copyright: 2004, Benjamin Kaufmann +License: GPL-2+ + +Files: libprogram_opts/program_opts/detail/* +Copyright: 2010, Benjamin Kaufmann +License: GPL-2+ + +Files: libprogram_opts/program_opts/mapped_value.h + libprogram_opts/program_opts/value_store.h +Copyright: 2010, Benjamin Kaufmann +License: GPL-2+ + +Files: libprogram_opts/src/value_store.cpp +Copyright: 2010, Benjamin Kaufmann +License: GPL-2+ + +Files: libreify/reify/util.hh +Copyright: 2013, Roland Kaminski +License: GPL-3+ + +Files: libreify/tests/catch.hpp +Copyright: 2012, Two Blue Cubes Ltd. +License: BSL-1.0 + +License: BSL-1.0 + Permission is hereby granted, free of charge, to any person or organization + obtaining a copy of the software and accompanying documentation covered by + this license (the "Software") to use, reproduce, display, distribute, + execute, and transmit the Software, and to prepare derivative works of the + Software, and to permit third-parties to whom the Software is furnished to + do so, all subject to the following: + . + The copyright notices in the Software and this entire statement, including + the above license grant, this restriction and the following disclaimer, + must be included in all copies of the Software, in whole or in part, and + all derivative works of the Software, unless such copies or derivative + works are solely in the form of machine-executable object code generated by + a source language processor. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT + SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE + FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + +License: GPL-2+ + This program is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later + version. + . + This program is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the GNU General Public License for more + details. + . + You should have received a copy of the GNU General Public + License along with this package; if not, write to the Free + Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301 USA + . + On Debian systems, the full text of the GNU General Public + License version 2 can be found in the file + `/usr/share/common-licenses/GPL-2'. + +License: GPL-3+ + This program is free software: you can redistribute it + and/or modify it under the terms of the GNU General Public + License as published by the Free Software Foundation, either + version 3 of the License, or (at your option) any later + version. + . + This program is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the GNU General Public License for more + details. + . + You should have received a copy of the GNU General Public + License along with this program. If not, see + . + . + On Debian systems, the full text of the GNU General Public + License version 3 can be found in the file + `/usr/share/common-licenses/GPL-3'. diff --git a/docs b/docs new file mode 100644 index 0000000..b9de7ba --- /dev/null +++ b/docs @@ -0,0 +1,2 @@ +README.md +examples diff --git a/gringo.links b/gringo.links new file mode 100644 index 0000000..1f295db --- /dev/null +++ b/gringo.links @@ -0,0 +1,4 @@ +usr/bin/clingo usr/bin/iclingo +usr/bin/clingo usr/bin/oclingo +usr/share/man/man1/clingo.1 usr/share/man/man1/iclingo.1 +usr/share/man/man1/clingo.1 usr/share/man/man1/oclingo.1 diff --git a/gringo.manpages b/gringo.manpages new file mode 100644 index 0000000..8d0e373 --- /dev/null +++ b/gringo.manpages @@ -0,0 +1,4 @@ +gringo.1 +clingo.1 +reify.1 +lpconvert.1 diff --git a/install b/install new file mode 100644 index 0000000..57650b3 --- /dev/null +++ b/install @@ -0,0 +1,4 @@ +build/release/gringo usr/bin/ +build/release/clingo usr/bin/ +build/release/reify usr/bin/ +build/release/lpconvert usr/bin/ diff --git a/patches/gringo-alpha-fpu-getcw.patch b/patches/gringo-alpha-fpu-getcw.patch new file mode 100644 index 0000000..d8cf944 --- /dev/null +++ b/patches/gringo-alpha-fpu-getcw.patch @@ -0,0 +1,23 @@ +From: Thomas Krennwallner +Date: Sat, 17 Dec 2016 07:27:31 +0100 +Subject: alpha FTBFS: _FPU_GETCW is undefined +Forwarded: https://github.com/potassco/clasp/pull/3 + +=================================================================== +--- + app/clingo/src/clasp/clasp_app.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/app/clingo/src/clasp/clasp_app.cpp b/app/clingo/src/clasp/clasp_app.cpp +index 31f2b70..cb4294e 100644 +--- a/app/clingo/src/clasp/clasp_app.cpp ++++ b/app/clingo/src/clasp/clasp_app.cpp +@@ -32,7 +32,7 @@ + #endif + #include + +-#if defined( __linux__ ) ++#if defined( __linux__ ) && !defined(__alpha__) + #include + #if defined(_FPU_EXTENDED) && defined(_FPU_SINGLE) && defined(_FPU_DOUBLE) + #define FPU_SWITCH_DOUBLE(oldW) _FPU_GETCW(oldW);\ diff --git a/patches/gringo-broken-std-exception_ptr.patch b/patches/gringo-broken-std-exception_ptr.patch new file mode 100644 index 0000000..e852a89 --- /dev/null +++ b/patches/gringo-broken-std-exception_ptr.patch @@ -0,0 +1,179 @@ +From: Thomas Krennwallner +Date: Wed, 14 Dec 2016 08:37:15 +0100 +Subject: add support for architectures with broken std::exception_ptr + std::exception_ptr is currently not supported on armel, see libstdc++ + bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58938 +Forwarded: not-needed + +=================================================================== +--- + libgringo/gringo/control.hh | 22 +++++++++++++++++++++- + libgringo/src/control.cc | 39 ++++++++++++++++++++++++++++++++------- + 2 files changed, 53 insertions(+), 8 deletions(-) + +diff --git a/libgringo/gringo/control.hh b/libgringo/gringo/control.hh +index 6338d6f..197eb1e 100644 +--- a/libgringo/gringo/control.hh ++++ b/libgringo/gringo/control.hh +@@ -270,11 +270,31 @@ void inline clingo_expect(bool expr) { + if (!expr) { throw std::runtime_error("unexpected"); } + } + +-void handleCError(bool ret, std::exception_ptr *exc = nullptr); ++#ifndef BROKEN_STD_EXCEPTION_PTR ++typedef std::exception_ptr clingo_exception_holder_t; + void handleCXXError(); ++#else ++typedef std::shared_ptr clingo_exception_holder_t; ++void handleCXXError(const char *what, clingo_error_t err); ++#endif ++ ++void handleCError(bool ret, clingo_exception_holder_t *exc = nullptr); + + #define GRINGO_CLINGO_TRY try ++ ++#ifndef BROKEN_STD_EXCEPTION_PTR + #define GRINGO_CLINGO_CATCH catch (...) { Gringo::handleCXXError(); return false; } return true ++#else ++#define GRINGO_CLINGO_CATCH \ ++ catch (Gringo::GringoError const &e) { Gringo::handleCXXError(e.what(), clingo_error_runtime); return false; } \ ++ catch (Gringo::ClingoError const &e) { return false; } \ ++ catch (Gringo::MessageLimitError const &e) { Gringo::handleCXXError(e.what(), clingo_error_runtime); return false; } \ ++ catch (std::bad_alloc const &e) { Gringo::handleCXXError(e.what(), clingo_error_bad_alloc); return false; } \ ++ catch (std::runtime_error const &e) { Gringo::handleCXXError(e.what(), clingo_error_runtime); return false; } \ ++ catch (std::logic_error const &e) { Gringo::handleCXXError(e.what(), clingo_error_logic); return false; } \ ++ catch (...) { Gringo::handleCXXError("", clingo_error_unknown); return false; } \ ++ return true ++#endif + + // }}}1 + +diff --git a/libgringo/src/control.cc b/libgringo/src/control.cc +index 67c6691..384f3cb 100644 +--- a/libgringo/src/control.cc ++++ b/libgringo/src/control.cc +@@ -72,18 +72,18 @@ void print(char *ret, size_t n, F f) { + } + + #ifndef GRINGO_NO_THREAD_LOCAL +- thread_local std::exception_ptr g_lastException; ++ thread_local clingo_exception_holder_t g_lastException; + thread_local std::string g_lastMessage; + thread_local clingo_error_t g_lastCode; + #else + struct TLData { +- std::exception_ptr lastException; ++ clingo_exception_holder_t lastException; + std::string lastMessage; + clingo_error_t lastCode; + }; + std::mutex g_tLMut; + std::unordered_map g_tLData; +- std::exception_ptr &tLlastException() { ++ clingo_exception_holder_t &tLlastException() { + std::lock_guard lock(g_tLMut); + return g_tLData[std::this_thread::get_id()].lastException; + } +@@ -102,9 +102,13 @@ void print(char *ret, size_t n, F f) { + + } // namespace + +-void handleCError(bool ret, std::exception_ptr *exc) { ++void handleCError(bool ret, clingo_exception_holder_t *exc) { + if (!ret) { ++#ifndef BROKEN_STD_EXCEPTION_PTR + if (exc && *exc) { std::rethrow_exception(*exc); } ++#else ++ if (exc && *exc) { throw std::runtime_error(**exc); } ++#endif + char const *msg = clingo_error_message(); + if (!msg) { msg = "no message"; } + switch (static_cast(clingo_error_code())) { +@@ -117,6 +121,7 @@ void handleCError(bool ret, std::exception_ptr *exc) { + } + } + ++#ifndef BROKEN_STD_EXCEPTION_PTR + void handleCXXError() { + try { throw; } + catch (Gringo::GringoError const &) { g_lastException = std::current_exception(); g_lastCode = clingo_error_runtime; return; } +@@ -130,6 +135,12 @@ void handleCXXError() { + catch (std::logic_error const &) { g_lastException = std::current_exception(); g_lastCode = clingo_error_logic; return; } + g_lastCode = clingo_error_unknown; + } ++#else ++void handleCXXError(const char *what, clingo_error_t err) { ++ g_lastException = clingo_exception_holder_t(new std::string(what)); ++ g_lastCode = err; ++} ++#endif + + // }}}1 + +@@ -261,7 +272,12 @@ SymbolType Symbol::type() const { + } + + #define CLINGO_CALLBACK_TRY try ++ ++#ifndef BROKEN_STD_EXCEPTION_PTR + #define CLINGO_CALLBACK_CATCH(ref) catch (...){ (ref) = std::current_exception(); return false; } return true ++#else ++#define CLINGO_CALLBACK_CATCH(ref) catch (std::exception &e){ (ref) = clingo_exception_holder_t(new std::string(e.what())); return false; } return true ++#endif + + std::string Symbol::to_string() const { + return ::to_string(clingo_symbol_to_string_size, clingo_symbol_to_string, sym_); +@@ -1588,7 +1604,7 @@ void Control::add(char const *name, StringSpan params, char const *part) { + } + + void Control::ground(PartSpan parts, GroundCallback cb) { +- using Data = std::pair; ++ using Data = std::pair; + Data data(cb, nullptr); + handleCError(clingo_control_ground(*impl_, reinterpret_cast(parts.begin()), parts.size(), + [](clingo_location_t loc, char const *name, clingo_symbol_t const *args, size_t n, void *data, clingo_symbol_callback_t *cb, void *cbdata) -> bool { +@@ -1612,7 +1628,7 @@ clingo_control_t *Control::to_c() const { return *impl_; } + + SolveResult Control::solve(ModelCallback mh, SymbolicLiteralSpan assumptions) { + clingo_solve_result_bitset_t ret; +- using Data = std::pair; ++ using Data = std::pair; + Data data(mh, nullptr); + handleCError(clingo_control_solve(*impl_, [](clingo_model_t *m, void *data, bool *ret) -> bool { + auto &d = *static_cast(data); +@@ -2590,7 +2606,7 @@ std::ostream &operator<<(std::ostream &out, Statement const &x) { + } // namespace AST + + void parse_program(char const *program, StatementCallback cb, Logger logger, unsigned message_limit) { +- using Data = std::pair; ++ using Data = std::pair; + Data data(cb, nullptr); + handleCError(clingo_parse_program(program, [](clingo_ast_statement_t const *stm, void *data) -> bool { + auto &d = *static_cast(data); +@@ -2612,17 +2628,26 @@ void parse_program(char const *program, StatementCallback cb, Logger logger, uns + + extern "C" void clingo_set_error(clingo_error_t code, char const *message) { + g_lastCode = code; ++#ifndef BROKEN_STD_EXCEPTION_PTR + try { g_lastException = std::make_exception_ptr(std::runtime_error(message)); } ++#else ++ try { g_lastException = clingo_exception_holder_t(new std::string(message)); } ++#endif + catch (...) { g_lastException = nullptr; } + } + extern "C" char const *clingo_error_message() { + if (g_lastException) { ++#ifndef BROKEN_STD_EXCEPTION_PTR + try { std::rethrow_exception(g_lastException); } + catch (std::bad_alloc const &) { return "bad_alloc"; } + catch (std::exception const &e) { + g_lastMessage = e.what(); + return g_lastMessage.c_str(); + } ++#else ++ g_lastMessage = *g_lastException; ++ return g_lastMessage.c_str(); ++#endif + } + return nullptr; + } diff --git a/patches/gringo-fix-body-literals-as-auxiliary.patch b/patches/gringo-fix-body-literals-as-auxiliary.patch new file mode 100644 index 0000000..a3ce644 --- /dev/null +++ b/patches/gringo-fix-body-literals-as-auxiliary.patch @@ -0,0 +1,302 @@ +From: Roland Kaminski +Date: Wed, 16 Nov 2016 12:12:52 +0100 +Subject: bugfix: correctly mark body literals as auxiliary in all cases +Origin: upstream, https://github.com/potassco/clingo/commit/d6cfb89df6bbf138ca3e259d71ca7050b322b5d5 +Bug: https://sourceforge.net/p/potassco/mailman/message/35493632/ + +--- + app/clingo/tests/lp/aggregates.lp | 38 +++++++++++++++++++++++++++++++++ + app/clingo/tests/lp/aggregates.sol | 2 ++ + libgringo/gringo/ground/statements.hh | 20 ++++++++++------- + libgringo/src/ground/statements.cc | 20 ++++++++++------- + libgringo/src/input/aggregates.cc | 16 +++++++------- + libgringo/tests/ground/instantiation.cc | 8 +++++++ + 6 files changed, 80 insertions(+), 24 deletions(-) + create mode 100644 app/clingo/tests/lp/aggregates.lp + create mode 100644 app/clingo/tests/lp/aggregates.sol + +diff --git a/app/clingo/tests/lp/aggregates.lp b/app/clingo/tests/lp/aggregates.lp +new file mode 100644 +index 0000000..40d6748 +--- /dev/null ++++ b/app/clingo/tests/lp/aggregates.lp +@@ -0,0 +1,38 @@ ++arg(s3). sat(s3):-ass(s3,Y_s3),lt(Y_s3,Z_s3),V_t_0=0, V_3_1=-V_t_0, V_t_2=0, V_2_1=-2*V_t_2+V_3_1, dom(V_t_3), V_t_3 #sum{Z_s3,s3}V_t_3, V_1_1=1*V_t_3+V_2_1, V_t_4=0, V_0_1=2*V_t_4+V_1_1, dom(V_1), V_1 #sum{1:V_0_1>0} V_1, V_1=1. ++inv(s3):-ass(s3,Y_s3),lt(Y_s3,Z_s3),V_t_0=0, V_3_1=-V_t_0, V_t_2=0, V_2_1=-2*V_t_2+V_3_1, dom(V_t_3), V_t_3 #sum{Z_s3,s3} V_t_3, V_1_1=1*V_t_3+V_2_1, V_t_4=0, V_0_1=2*V_t_4+V_1_1, dom(V_1), V_1 #sum{1:V_0_1>0}V_1, V_1=0. ++sattwo(s3):-asstwo(s3,Y_s3),lt(Y_s3,Z_s3),V_t_0=0, V_3_1=-V_t_0, V_t_2=0, V_2_1=-2*V_t_2+V_3_1, dom(V_t_3), V_t_3#sum{Z_s3,s3}V_t_3, V_1_1=1*V_t_3+V_2_1, V_t_4=0, V_0_1=2*V_t_4+V_1_1, dom(V_1), V_1 #sum{1:V_0_1>0}V_1, V_1=1. ++invtwo(s3):-asstwo(s3,Y_s3),lt(Y_s3,Z_s3),V_t_0=0, V_3_1=-V_t_0, V_t_2=0, V_2_1=-2*V_t_2+V_3_1, dom(V_t_3), V_t_3#sum{Z_s3,s3}V_t_3, V_1_1=1*V_t_3+V_2_1, V_t_4=0, V_0_1=2*V_t_4+V_1_1, dom(V_1), V_1 #sum{1:V_0_1>0}V_1, V_1=0. ++arg(s2). ++sat(s2):-V_t_5=0, V_3_6=-V_t_5, V_t_7=0, V_2_6=-2*V_t_7+V_3_6, V_t_8=0, V_1_6=1*V_t_8+V_2_6, V_t_9=0, V_0_6=2*V_t_9+V_1_6, dom(V_6), V_6#sum{1:V_0_6>0}V_6, V_6=1. ++inv(s2):-V_t_5=0, V_3_6=-V_t_5, V_t_7=0, V_2_6=-2*V_t_7+V_3_6, V_t_8=0, V_1_6=1*V_t_8+V_2_6, V_t_9=0, V_0_6=2*V_t_9+V_1_6, dom(V_6), V_6#sum{1:V_0_6>0}V_6, V_6=0. ++sattwo(s2):-V_t_5=0, V_3_6=-V_t_5, V_t_7=0, V_2_6=-2*V_t_7+V_3_6, V_t_8=0, V_1_6=1*V_t_8+V_2_6, V_t_9=0, V_0_6=2*V_t_9+V_1_6, dom(V_6), V_6#sum{1:V_0_6>0}V_6, V_6=1. ++invtwo(s2):-V_t_5=0, V_3_6=-V_t_5, V_t_7=0, V_2_6=-2*V_t_7+V_3_6, V_t_8=0, V_1_6=1*V_t_8+V_2_6, V_t_9=0, V_0_6=2*V_t_9+V_1_6, dom(V_6), V_6#sum{1:V_0_6>0}V_6, V_6=0. ++arg(s1). ++sat(s1):-ass(s2,Y_s2),lt(Y_s2,Z_s2),ass(s3,Y_s3),lt(Y_s3,Z_s3),dom(V_t_10), V_t_10#sum{Z_s2,s2}V_t_10, V_3_11=-V_t_10, V_t_12=0, V_2_11=-2*V_t_12+V_3_11, dom(V_t_13), V_t_13 #sum{Z_s3,s3}V_t_13, V_1_11=1*V_t_13+V_2_11, V_t_14=0, V_0_11=2*V_t_14+V_1_11, dom(V_11), V_11#sum{1:V_0_11>0}V_11, V_11=1. ++inv(s1):-ass(s2,Y_s2),lt(Y_s2,Z_s2),ass(s3,Y_s3),lt(Y_s3,Z_s3),dom(V_t_10), V_t_10#sum{Z_s2,s2}V_t_10, V_3_11=-V_t_10, V_t_12=0, V_2_11=-2*V_t_12+V_3_11, dom(V_t_13), V_t_13 #sum{Z_s3,s3}V_t_13, V_1_11=1*V_t_13+V_2_11, V_t_14=0, V_0_11=2*V_t_14+V_1_11, dom(V_11), V_11#sum{1:V_0_11>0}V_11, V_11=0. ++sattwo(s1):-asstwo(s2,Y_s2),lt(Y_s2,Z_s2),asstwo(s3,Y_s3),lt(Y_s3,Z_s3),dom(V_t_10), V_t_10#sum{Z_s2,s2}V_t_10, V_3_11=-V_t_10, V_t_12=0, V_2_11=-2*V_t_12+V_3_11, dom(V_t_13), V_t_13#sum{Z_s3,s3}V_t_13, V_1_11=1*V_t_13+V_2_11, V_t_14=0, V_0_11=2*V_t_14+V_1_11, dom(V_11), V_11#sum{1:V_0_11>0}V_11, V_11=1. ++invtwo(s1):-asstwo(s2,Y_s2),lt(Y_s2,Z_s2),asstwo(s3,Y_s3),lt(Y_s3,Z_s3),dom(V_t_10), V_t_10#sum{Z_s2,s2}V_t_10, V_3_11=-V_t_10, V_t_12=0, V_2_11=-2*V_t_12+V_3_11, dom(V_t_13), V_t_13#sum{Z_s3,s3}V_t_13, V_1_11=1*V_t_13+V_2_11, V_t_14=0, V_0_11=2*V_t_14+V_1_11, dom(V_11), V_11#sum{1:V_0_11>0}V_11, V_11=0. ++saturate:-ass(s3,X_1),asstwo(s3,X_1),ass(s2,X_2),asstwo(s2,X_2),ass(s1,X_3),asstwo(s1,X_3). ++dom(0..1). ++lt(u,0).lt(u,1).lt(1,1).lt(0,0). ++ass(S,0):-not ass(S,1),not ass(S,u),arg(S). ++ass(S,1):-not ass(S,u),not ass(S,0),arg(S). ++ass(S,u):-not ass(S,0),not ass(S,1),arg(S). ++:-arg(S),ass(S,1),inv(S). ++:-arg(S),ass(S,0),sat(S). ++asstwo(S,0):-ass(S,0). ++asstwo(S,1):-ass(S,1). ++asstwo(S,0)|asstwo(S,1)|asstwo(S,u):-ass(S,u). ++saturate:-arg(S),asstwo(S,1),invtwo(S). ++saturate:-arg(S),asstwo(S,0),sattwo(S). ++asstwo(S,0):-arg(S),ass(S,u),saturate. ++asstwo(S,1):-arg(S),ass(S,u),saturate. ++asstwo(S,u):-arg(S),ass(S,u),saturate. ++sattwo(S):-arg(S),ass(S,u),saturate. ++:-not saturate. ++#show ass/2. ++ ++:-ass(s1, 0),ass(s2, 0),ass(s3, 0). ++:-ass(s1, 1),ass(s2, 0),ass(s3, 1). ++ ++%unfounded: saturate, asstwo(s1,0), asstwo(s1,0) +\ No newline at end of file +diff --git a/app/clingo/tests/lp/aggregates.sol b/app/clingo/tests/lp/aggregates.sol +new file mode 100644 +index 0000000..94dc765 +--- /dev/null ++++ b/app/clingo/tests/lp/aggregates.sol +@@ -0,0 +1,2 @@ ++Step: 1 ++UNSAT +diff --git a/libgringo/gringo/ground/statements.hh b/libgringo/gringo/ground/statements.hh +index 5b26c65..f1804e7 100644 +--- a/libgringo/gringo/ground/statements.hh ++++ b/libgringo/gringo/ground/statements.hh +@@ -376,7 +376,7 @@ private: + + class BodyAggregateLiteral : public Literal, private BodyOcc { + public: +- BodyAggregateLiteral(BodyAggregateComplete &complete, NAF naf); ++ BodyAggregateLiteral(BodyAggregateComplete &complete, NAF naf, bool auxiliary); + virtual ~BodyAggregateLiteral() noexcept; + + // {{{2 Printable interface +@@ -388,7 +388,7 @@ public: + void collect(VarTermBoundVec &vars) const override; + Score score(Term::VarSet const &bound, Logger &log) override; + std::pair toOutput(Logger &log) override; +- bool auxiliary() const override { return false; } // by construction ++ bool auxiliary() const override { return auxiliary_; } + // }}}2 + + private: +@@ -407,6 +407,7 @@ private: + DefinedBy defs_; + Potassco::Id_t offset_ = 0; + NAF naf_; ++ bool auxiliary_; + OccurrenceType type_ = OccurrenceType::POSITIVELY_STRATIFIED; + }; + +@@ -499,7 +500,7 @@ private: + + class AssignmentAggregateLiteral : public Literal, private BodyOcc { + public: +- AssignmentAggregateLiteral(AssignmentAggregateComplete &complete); ++ AssignmentAggregateLiteral(AssignmentAggregateComplete &complete, bool auxiliary); + virtual ~AssignmentAggregateLiteral() noexcept; + // {{{2 Printable interface + void print(std::ostream &out) const override; +@@ -510,7 +511,7 @@ public: + void collect(VarTermBoundVec &vars) const override; + Score score(Term::VarSet const &bound, Logger &log) override; + std::pair toOutput(Logger &log) override; +- bool auxiliary() const override { return false; } // by construction ++ bool auxiliary() const override { return auxiliary_; } + // }}}2 + + private: +@@ -529,6 +530,7 @@ private: + DefinedBy defs_; + Id_t offset_ = InvalidId; + OccurrenceType type_ = OccurrenceType::POSITIVELY_STRATIFIED; ++ bool auxiliary_; + }; + + // }}}1 +@@ -667,7 +669,7 @@ private: + + class ConjunctionLiteral : public Literal, private BodyOcc { + public: +- ConjunctionLiteral(ConjunctionComplete &complete); ++ ConjunctionLiteral(ConjunctionComplete &complete, bool auxiliary); + virtual ~ConjunctionLiteral() noexcept; + // {{{2 Printable interface + void print(std::ostream &out) const override; +@@ -678,7 +680,7 @@ public: + void collect(VarTermBoundVec &vars) const override; + Score score(Term::VarSet const &bound, Logger &log) override; + std::pair toOutput(Logger &log) override; +- bool auxiliary() const override { return false; } // by construction ++ bool auxiliary() const override { return auxiliary_; } + // }}}2 + + private: +@@ -697,6 +699,7 @@ private: + DefinedBy defs_; + Id_t offset_; + OccurrenceType type_ = OccurrenceType::POSITIVELY_STRATIFIED; ++ bool auxiliary_; + }; + + // }}}1 +@@ -786,7 +789,7 @@ private: + + class DisjointLiteral : public Literal, private BodyOcc { + public: +- DisjointLiteral(DisjointComplete &complete, NAF naf); ++ DisjointLiteral(DisjointComplete &complete, NAF naf, bool auxiliary); + virtual ~DisjointLiteral() noexcept; + // {{{2 Printable interface + void print(std::ostream &out) const override; +@@ -797,7 +800,7 @@ public: + void collect(VarTermBoundVec &vars) const override; + Score score(Term::VarSet const &bound, Logger &log) override; + std::pair toOutput(Logger &log) override; +- bool auxiliary() const override { return false; } // by construction ++ bool auxiliary() const override { return auxiliary_; } + // }}}2 + private: + // {{{2 BodyOcc interface +@@ -816,6 +819,7 @@ private: + Id_t offset_ = InvalidId; + OccurrenceType type_ = OccurrenceType::POSITIVELY_STRATIFIED; + NAF naf_; ++ bool auxiliary_; + }; + + // }}}1 +diff --git a/libgringo/src/ground/statements.cc b/libgringo/src/ground/statements.cc +index 17bbf6e..38a4562 100644 +--- a/libgringo/src/ground/statements.cc ++++ b/libgringo/src/ground/statements.cc +@@ -888,9 +888,10 @@ void BodyAggregateAccumulate::printHead(std::ostream &out) const { + + // {{{1 definition of BodyAggregateLiteral + +-BodyAggregateLiteral::BodyAggregateLiteral(BodyAggregateComplete &complete, NAF naf) ++BodyAggregateLiteral::BodyAggregateLiteral(BodyAggregateComplete &complete, NAF naf, bool auxiliary) + : complete_(complete) +-, naf_(naf) { } ++, naf_(naf) ++, auxiliary_(auxiliary) { } + + BodyAggregateLiteral::~BodyAggregateLiteral() noexcept = default; + +@@ -1138,8 +1139,9 @@ void AssignmentAggregateAccumulate::printHead(std::ostream &out) const { + + // {{{1 Definition of AssignmentAggregateLiteral + +-AssignmentAggregateLiteral::AssignmentAggregateLiteral(AssignmentAggregateComplete &complete) +-: complete_(complete) { } ++AssignmentAggregateLiteral::AssignmentAggregateLiteral(AssignmentAggregateComplete &complete, bool auxiliary) ++: complete_(complete) ++, auxiliary_(auxiliary) { } + + AssignmentAggregateLiteral::~AssignmentAggregateLiteral() noexcept = default; + +@@ -1206,8 +1208,9 @@ std::pair AssignmentAggregateLiteral::toOutput(Logger &) + + // {{{1 definition of ConjunctionLiteral + +-ConjunctionLiteral::ConjunctionLiteral(ConjunctionComplete &complete) +-: complete_(complete) { } ++ConjunctionLiteral::ConjunctionLiteral(ConjunctionComplete &complete, bool auxiliary) ++: complete_(complete) ++, auxiliary_(auxiliary) { } + + ConjunctionLiteral::~ConjunctionLiteral() noexcept = default; + +@@ -1663,9 +1666,10 @@ void DisjointAccumulate::printHead(std::ostream &out) const { + + // {{{1 definition of DisjointLiteral + +-DisjointLiteral::DisjointLiteral(DisjointComplete &complete, NAF naf) ++DisjointLiteral::DisjointLiteral(DisjointComplete &complete, NAF naf, bool auxiliary) + : complete_(complete) +-, naf_(naf) { ++, naf_(naf) ++, auxiliary_(auxiliary) { + } + + DisjointLiteral::~DisjointLiteral() noexcept = default; +diff --git a/libgringo/src/input/aggregates.cc b/libgringo/src/input/aggregates.cc +index a77d5d9..98469a8 100644 +--- a/libgringo/src/input/aggregates.cc ++++ b/libgringo/src/input/aggregates.cc +@@ -324,8 +324,8 @@ CreateBody TupleBodyAggregate::toGround(ToGroundArg &x, Ground::UStmVec &stms) c + return std::move(ret); + }); + } +- return CreateBody([&completeRef, this](Ground::ULitVec &lits, bool primary, bool) { +- if (primary) { lits.emplace_back(gringo_make_unique(completeRef, naf)); } ++ return CreateBody([&completeRef, this](Ground::ULitVec &lits, bool primary, bool auxiliary) { ++ if (primary) { lits.emplace_back(gringo_make_unique(completeRef, naf, auxiliary)); } + }, std::move(split)); + } + else { +@@ -362,8 +362,8 @@ CreateBody TupleBodyAggregate::toGround(ToGroundArg &x, Ground::UStmVec &stms) c + return std::move(ret); + }); + } +- return CreateBody([&completeRef, this](Ground::ULitVec &lits, bool primary, bool) { +- if (primary) { lits.emplace_back(gringo_make_unique(completeRef)); } ++ return CreateBody([&completeRef, this](Ground::ULitVec &lits, bool primary, bool auxiliary) { ++ if (primary) { lits.emplace_back(gringo_make_unique(completeRef, auxiliary)); } + }, std::move(split)); + } + } +@@ -752,8 +752,8 @@ CreateBody Conjunction::toGround(ToGroundArg &x, Ground::UStmVec &stms) const { + return std::move(ret); + }); + +- return CreateBody([&completeRef](Ground::ULitVec &lits, bool primary, bool) { +- if (primary) { lits.emplace_back(gringo_make_unique(completeRef)); } ++ return CreateBody([&completeRef](Ground::ULitVec &lits, bool primary, bool auxiliary) { ++ if (primary) { lits.emplace_back(gringo_make_unique(completeRef, auxiliary)); } + }, std::move(split)); + } + +@@ -1751,8 +1751,8 @@ CreateBody DisjointAggregate::toGround(ToGroundArg &x, Ground::UStmVec &stms) co + return std::move(ret); + }); + } +- return CreateBody([&completeRef, this](Ground::ULitVec &lits, bool primary, bool) { +- if (primary) { lits.emplace_back(gringo_make_unique(completeRef, naf)); } ++ return CreateBody([&completeRef, this](Ground::ULitVec &lits, bool primary, bool auxiliary) { ++ if (primary) { lits.emplace_back(gringo_make_unique(completeRef, naf, auxiliary)); } + }, std::move(split)); + } + +diff --git a/libgringo/tests/ground/instantiation.cc b/libgringo/tests/ground/instantiation.cc +index 22817af..7bc9d87 100644 +--- a/libgringo/tests/ground/instantiation.cc ++++ b/libgringo/tests/ground/instantiation.cc +@@ -1108,6 +1108,14 @@ TEST_CASE("ground-instantiation", "[ground]") { + "-q(X):-not not -q(X), p(X).\n" + " q(X):-not not q(X), p(X).\n")); + } ++ SECTION("two aggregates") { ++ REQUIRE( ++ "p:-#count{0,a:a}=0.\n" ++ "p:-#count{0,a:a}=1,1<=#count{0,b:b}.\n" ++ "{a;b}.\n" == ground( ++ "{a;b}.\n" ++ "p :- X = { a }, X { b }.\n")); ++ } + + SECTION("tuple") { + REQUIRE("p(((),())).\n" == ground("p(((),())).\n")); +-- +2.11.0 + diff --git a/patches/gringo-manpages.patch b/patches/gringo-manpages.patch new file mode 100644 index 0000000..8a16f98 --- /dev/null +++ b/patches/gringo-manpages.patch @@ -0,0 +1,265 @@ +From: Thomas Krennwallner +Date: Wed, 7 Dec 2016 07:50:31 +0100 +Subject: Add gringo.1, clingo.1, lpconvert.1, and reify.1 manpages + +=================================================================== +--- + clingo.1 | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + gringo.1 | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + lpconvert.1 | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ + reify.1 | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 225 insertions(+) + create mode 100644 clingo.1 + create mode 100644 gringo.1 + create mode 100644 lpconvert.1 + create mode 100644 reify.1 + +diff --git a/clingo.1 b/clingo.1 +new file mode 100644 +index 0000000..ba04b34 +--- /dev/null ++++ b/clingo.1 +@@ -0,0 +1,58 @@ ++.\" Hey, EMACS: -*- nroff -*- ++.\" First parameter, NAME, should be all caps ++.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection ++.\" other parameters are allowed: see man(7), man(1) ++.TH CLINGO 1 "December 11, 2016" ++.\" Please adjust this date whenever revising the manpage. ++.\" ++.\" Some roff macros, for reference: ++.\" .nh disable hyphenation ++.\" .hy enable hyphenation ++.\" .ad l left justify ++.\" .ad b justify to both left and right margins ++.\" .nf disable filling ++.\" .fi enable filling ++.\" .br insert line break ++.\" .sp insert n+1 empty lines ++.\" for manpage-specific macros, see man(7) ++.SH NAME ++clingo \- a combination of clasp and gringo ++.SH SYNOPSIS ++.B clingo ++[\fIOPTION\fR]... \fR[\fIFILE\fR]... ++.SH DESCRIPTION ++This manual page documents briefly the ++.B clingo ++command. ++.PP ++.\" TeX users may be more comfortable with the \fB\fP and ++.\" \fI\fP escape sequences to invode bold face and italics, ++.\" respectively. ++\fBclingo\fP stands for clasp on gringo and combines both systems in a ++monolithic way. Its input language is that of gringo and its output ++corresponds to that of clasp. This way it offers more control over the ++grounding and solving process than gringo and clasp can offer ++individually: multi-shot solving. ++.SH OPTIONS ++These programs follow the usual GNU command line syntax, with long ++options starting with two dashes (`-'). ++A summary of options is included below. ++For a complete description, see the potassco-guide at ++https://sourceforge.net/projects/potassco/files/guide/. ++.TP ++.B \-h, \-\-help ++Show summary of options. ++.TP ++.B \-v, \-\-version ++Show version of program. ++.SH SEE ALSO ++.BR clasp (1), ++.BR gringo (1), ++.BR lpconvert (1), ++.BR reify (1) ++.br ++.SH AUTHOR ++clingo was written by Roland Kaminski ++.PP ++This manual page was written by Thomas Krennwallner , ++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 +--- /dev/null ++++ b/gringo.1 +@@ -0,0 +1,60 @@ ++.\" Hey, EMACS: -*- nroff -*- ++.\" First parameter, NAME, should be all caps ++.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection ++.\" other parameters are allowed: see man(7), man(1) ++.TH GRINGO 1 "December 11, 2016" ++.\" Please adjust this date whenever revising the manpage. ++.\" ++.\" Some roff macros, for reference: ++.\" .nh disable hyphenation ++.\" .hy enable hyphenation ++.\" .ad l left justify ++.\" .ad b justify to both left and right margins ++.\" .nf disable filling ++.\" .fi enable filling ++.\" .br insert line break ++.\" .sp insert n+1 empty lines ++.\" for manpage-specific macros, see man(7) ++.SH NAME ++gringo \- a grounder for non-ground logic programs ++.SH SYNOPSIS ++.B gringo ++[\fIOPTION\fR]... \fR[\fIFILE\fR]... ++.SH DESCRIPTION ++This manual page documents briefly the ++.B gringo ++command. ++.PP ++.\" TeX users may be more comfortable with the \fB\fP and ++.\" \fI\fP escape sequences to invode bold face and italics, ++.\" respectively. ++\fBgringo\fP is a grounder that, given an input program with first-order ++variables, computes an equivalent ground (variable-free) program in ++aspif format. Its output can be processed further with answer set solver ++clasp. Starting with gringo series 5, its output is no longer directly ++compatible with solvers like smodels or cmodels reading smodels format. ++Use the \fBlpconvert\fP converter for translating aspif format to ++smodels format. ++.SH OPTIONS ++These programs follow the usual GNU command line syntax, with long ++options starting with two dashes (`-'). ++A summary of options is included below. ++For a complete description, see the potassco-guide at ++https://sourceforge.net/projects/potassco/files/guide/. ++.TP ++.B \-h, \-\-help ++Show summary of options. ++.TP ++.B \-v, \-\-version ++Show version of program. ++.SH SEE ALSO ++.BR clasp (1), ++.BR clingo (1), ++.BR lpconvert (1), ++.BR reify (1) ++.br ++.SH AUTHOR ++gringo was written by Roland Kaminski ++.PP ++This manual page was written by Thomas Krennwallner , ++for the Debian project (and may be used by others). +diff --git a/lpconvert.1 b/lpconvert.1 +new file mode 100644 +index 0000000..f5d931e +--- /dev/null ++++ b/lpconvert.1 +@@ -0,0 +1,53 @@ ++.\" Hey, EMACS: -*- nroff -*- ++.\" First parameter, NAME, should be all caps ++.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection ++.\" other parameters are allowed: see man(7), man(1) ++.TH LPCONVERT 1 "December 11, 2016" ++.\" Please adjust this date whenever revising the manpage. ++.\" ++.\" Some roff macros, for reference: ++.\" .nh disable hyphenation ++.\" .hy enable hyphenation ++.\" .ad l left justify ++.\" .ad b justify to both left and right margins ++.\" .nf disable filling ++.\" .fi enable filling ++.\" .br insert line break ++.\" .sp insert n+1 empty lines ++.\" for manpage-specific macros, see man(7) ++.SH NAME ++lpconvert \- converter between gringo's aspif and smodels format ++.SH SYNOPSIS ++.B lpconvert ++\fR[\fIOPTION\fR]... \fR[\fIFILE\fR]... ++.SH DESCRIPTION ++This manual page documents briefly the ++.B lpconvert ++command. ++.PP ++.\" TeX users may be more comfortable with the \fB\fP and ++.\" \fI\fP escape sequences to invode bold face and italics, ++.\" respectively. ++\fBlpconvert\fP is a converter between gringo's aspif and smodels ++format. ++.SH OPTIONS ++These programs follow the usual GNU command line syntax, with long ++options starting with two dashes (`-'). A summary of options is ++included below. For a complete description, see the potassco-guide ++https://sourceforge.net/projects/potassco/files/guide/2.0/. ++.TP ++.B \-h, \-\-help ++Show summary of options. ++.TP ++.B \-v, \-\-version ++Show version of program. ++.SH SEE ALSO ++.BR clasp (1), ++.BR gringo (1), ++.BR reify (1) ++.br ++.SH AUTHOR ++lpconvert was written by Roland Kaminski ++.PP ++This manual page was written by Thomas Krennwallner , ++for the Debian project (and may be used by others). +diff --git a/reify.1 b/reify.1 +new file mode 100644 +index 0000000..aea2db7 +--- /dev/null ++++ b/reify.1 +@@ -0,0 +1,54 @@ ++.\" Hey, EMACS: -*- nroff -*- ++.\" First parameter, NAME, should be all caps ++.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection ++.\" other parameters are allowed: see man(7), man(1) ++.TH REIFY 1 "December 11, 2016" ++.\" Please adjust this date whenever revising the manpage. ++.\" ++.\" Some roff macros, for reference: ++.\" .nh disable hyphenation ++.\" .hy enable hyphenation ++.\" .ad l left justify ++.\" .ad b justify to both left and right margins ++.\" .nf disable filling ++.\" .fi enable filling ++.\" .br insert line break ++.\" .sp insert n+1 empty lines ++.\" for manpage-specific macros, see man(7) ++.SH NAME ++reify \- a small utility that reifies logic programs ++.SH SYNOPSIS ++.B reify ++\fR[\fIOPTION\fR]... ++.SH DESCRIPTION ++This manual page documents briefly the ++.B reify ++command. ++.PP ++.\" TeX users may be more comfortable with the \fB\fP and ++.\" \fI\fP escape sequences to invode bold face and italics, ++.\" respectively. ++\fBreify\fP is a small utility that reifies logic programs given in ++aspif format by reading standard input. It produces a set of facts, ++which can be processed further with gringo. ++.SH OPTIONS ++These programs follow the usual GNU command line syntax, with long ++options starting with two dashes (`-'). A summary of options is ++included below. For a complete description, see the potassco-guide ++https://sourceforge.net/projects/potassco/files/guide/2.0/. ++.TP ++.B \-h, \-\-help ++Show summary of options. ++.TP ++.B \-v, \-\-version ++Show version of program. ++.SH SEE ALSO ++.BR clasp (1), ++.BR gringo (1), ++.BR lpconvert (1) ++.br ++.SH AUTHOR ++reify was written by Roland Kaminski ++.PP ++This manual page was written by Thomas Krennwallner , ++for the Debian project (and may be used by others). diff --git a/patches/reproducible-build.patch b/patches/reproducible-build.patch new file mode 100644 index 0000000..86ed8f2 --- /dev/null +++ b/patches/reproducible-build.patch @@ -0,0 +1,24 @@ +From: Reiner Herrmann +Date: Wed, 7 Dec 2016 08:08:36 +0100 +Subject: Sort source files for deterministic linking order +Origin: vendor, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=844096;msg=5 +Bug-Debian: https://bugs.debian.org/844096 + +=================================================================== +--- + SConscript | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/SConscript b/SConscript +index 0ab4e7a..9164cd1 100644 +--- a/SConscript ++++ b/SConscript +@@ -47,7 +47,7 @@ def find_files(env, path): + target = os.path.join(root, filename[:-4] + ".hh") + source = "#"+os.path.join(root, filename) + env.Re2cCond(target, source) +- return sources ++ return sorted(sources) + finally: + os.chdir(oldcwd) + diff --git a/patches/series b/patches/series new file mode 100644 index 0000000..7d790fc --- /dev/null +++ b/patches/series @@ -0,0 +1,5 @@ +gringo-manpages.patch +reproducible-build.patch +gringo-fix-body-literals-as-auxiliary.patch +gringo-broken-std-exception_ptr.patch +gringo-alpha-fpu-getcw.patch diff --git a/rules b/rules new file mode 100755 index 0000000..70c31a2 --- /dev/null +++ b/rules @@ -0,0 +1,73 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# gringo requires c++11 threads with 64bit __atomic_exchange, we need to +# link with libatomic on powerpc, powerpcspe, m68k, mips, mipsel, and +# sh4, see also +# https://gcc.gnu.org/wiki/Atomic +# https://gcc.gnu.org/wiki/Atomic/GCCMM/LIbrary +arch = $(shell dpkg-architecture -qDEB_BUILD_ARCH | egrep -v -x "(powerpc|powerpcspe|m68k|mips|mipsel|sh4)") + +# currently, libstdc++ on armel does not support std::exception_ptr, see +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58938 +# +# we define BROKEN_STD_EXCEPTION_PTR below to enable replacement code in +# gringo-broken-std-exception_ptr.patch +broken_exception_ptr = $(shell dpkg-architecture -qDEB_BUILD_ARCH | grep "armel") + +# force g++ +CONFIGPARMS = CXX='g++' + +# use c++11 threads, lua5.3, and python2.7 +ifneq ($(if $(broken_exception_ptr),broken), broken) + CONFIGPARMS += WITH_THREADS='posix' WITH_LUA='lua5.3' WITH_PYTHON='python2.7' CPPPATH='$${["/usr/include/lua5.3","/usr/include/python2.7"]}' +endif + +# +# export CPPFLAGS, CXXFLAGS, and LDFLAGS for scons +# +# default to -O3 -std=c++11 -Wall -DNDEBUG and enable all hardening flags +# +DEB_CXXFLAGS_MAINT_APPEND = -std=c++11 -O3 -Wall +DEB_CPPFLAGS_MAINT_APPEND = -DNDEBUG +DEB_LDFLAGS_MAINT_APPEND = + +ifeq ($(if $(broken_exception_ptr),broken), broken) + DEB_CPPFLAGS_MAINT_APPEND += -DBROKEN_STD_EXCEPTION_PTR +endif + +ifeq ($(and $(if $(arch),,atomic), $(if $(broken_exception_ptr),,atomic)), atomic) + DEB_LDFLAGS_MAINT_APPEND += -latomic +endif + +export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/buildflags.mk + +# inject compiler and linker flags to scons variables +SCCXXFLAGS = $(shell echo $(CXXFLAGS) $(CPPFLAGS) | sed -e 's/^/\$${["/;s/ -/","-/g;s/$$/"]}/') +SCLINKFLAGS = $(shell echo $(LDFLAGS) | sed -e 's/^/\$${["/;s/ -/","-/g;s/$$/"]}/') + +%: + dh $@ + +# configure with LUA, Python; forcibly turn off threads if std::exception_ptr is broken +override_dh_auto_configure: + scons configure --build-dir=release $(CONFIGPARMS) CXXFLAGS='$(SCCXXFLAGS)' LINKFLAGS='$(SCLINKFLAGS)' || cat build/release.log build/release.py +ifeq ($(if $(broken_exception_ptr),broken), broken) + sed -i -e 's/WITH_THREADS =.*/WITH_THREADS = None/' -e 's/WITH_LUA =.*/WITH_LUA = None/' -e 's/WITH_PYTHON =.*/WITH_PYTHON = None/' ./build/release.py +endif + +# build gringo clingo reify +override_dh_auto_build: + scons --build-dir=release gringo clingo reify lpconvert + +override_dh_auto_clean: + rm -rf ./build .sconf_temp .sconsign.dblite + +override_dh_installchangelogs: + dh_installchangelogs CHANGES diff --git a/source/format b/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/watch b/watch new file mode 100644 index 0000000..1f4fe2c --- /dev/null +++ b/watch @@ -0,0 +1,7 @@ +# watch control file for uscan + +# Compulsory line, this is a version 3 file +version=3 + +opts=filenamemangle=s/.+\/v?(\d\S+)\.tar\.gz/gringo-$1\.tar\.gz/ \ + https://github.com/potassco/gringo/tags .*/v?(\d\S+)\.tar\.gz