[arch-commits] Commit in sagemath/trunk (4 files)

Antonio Rojas arojas at archlinux.org
Sat Jun 3 13:56:51 UTC 2017


    Date: Saturday, June 3, 2017 @ 13:56:50
  Author: arojas
Revision: 233756

pynac 0.7.8 rebuild, fix build with singular 4.1.0.p3

Added:
  sagemath/trunk/sagemath-singular-4.1.0.p3.patch
    (from rev 218951, sagemath/trunk/sagemath-singular-4.1.0.p2.patch)
Modified:
  sagemath/trunk/PKGBUILD
  sagemath/trunk/sagemath-singular-4.1.0.p2.patch
Deleted:
  sagemath/trunk/is-package-installed.patch

----------------------------------+
 PKGBUILD                         |   17 
 is-package-installed.patch       |  328 ----------------
 sagemath-singular-4.1.0.p2.patch |  758 ++++++++++++++++++++++++++++++++++++-
 sagemath-singular-4.1.0.p3.patch |  118 +++++
 4 files changed, 877 insertions(+), 344 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2017-06-03 13:56:43 UTC (rev 233755)
+++ PKGBUILD	2017-06-03 13:56:50 UTC (rev 233756)
@@ -10,7 +10,7 @@
 pkgbase=sagemath
 pkgname=(sagemath sagemath-jupyter)
 pkgver=7.6
-pkgrel=4
+pkgrel=5
 pkgdesc="Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab"
 arch=(i686 x86_64)
 url="http://www.sagemath.org"
@@ -34,14 +34,13 @@
 makedepends=(cython2 boost ratpoints symmetrica python2-jinja coin-or-cbc libhomfly libbraiding
   mcqd coxeter3 cryptominisat2 modular_decomposition bliss-graphs tdlib python2-pkgconfig meataxe libfes)
 source=("$pkgname-$pkgver.tar.gz::https://github.com/sagemath/sage/archive/$pkgver.tar.gz"
-        env.patch skip-check.patch cython-sys-path.patch is-package-installed.patch package.patch latte-count.patch
+        env.patch skip-check.patch cython-sys-path.patch package.patch latte-count.patch
         jupyter-path.patch sagemath-python3-notebook.patch test-optional.patch ecm-7.patch increase-rtol.patch r-no-readline.patch
-        sagemath-planarity3.patch fes02.patch sagemath-singular-4.1.0.p2.patch sagemath-pynac-0.7.6.patch)
+        sagemath-planarity3.patch fes02.patch sagemath-singular-4.1.0.p2.patch sagemath-singular-4.1.0.p3.patch sagemath-pynac-0.7.6.patch)
 sha256sums=('e6e0729ab25446e7c922058db0eee4b0b294b32c196e34842e843ea9fae41423'
             'dc0a92b81e9e2faab05cf8a5adb40ae7010be74446bc80d5aea15f59706f2cff'
             'b02b3d2d5620ca20f96adb62b6fef05e4676c0a60983310a1450fdf3d923cb04'
             'ff7e034d08ab084fdb193484f7fe3a659ebcd8ab33a2b7177237d65b26de7872'
-            'd60fb0fbd27991ce9496ca035a54b03334b5b53f244227a8d6e13f3327ce75d2'
             '4a2297e4d9d28f0b3a1f58e1b463e332affcb109eafde44837b1657e309c8212'
             'b816c71d345fb1188c3faa01c4e75cfa04ba6506080231d5d2c303a2288e9b50'
             '775051aa9076ebf631c8a291af38b6ec4a13c904740dc9da831641d592d8bcd8'
@@ -52,7 +51,8 @@
             'ef9f401fa84fe1772af9efee6816643534f2896da4c23b809937b19771bdfbbf'
             'a1c562ebe4538d672404ca3ac2e954a3c955afeb7463f7b4fe6eaa6fa74fe5c7'
             'a39da083c038ada797ffc5bedc9ba47455a3f77057d42f86484ae877ef9172ea'
-            'e1912afec58b834fac3b9161c2d5a1794bb618126c6bd7a4be85c834231360e7'
+            'e2980048e51a81a8f60761c0ea66c81b4e36d75198de2f4e5f0d5e4fd5ef5172'
+            '18ea03c046435693a9008329bb725a9cf2ed0d88a0d731bc71b5586bf84dfddf'
             '42d6549d9a07bcea9fa79bb63961ebbfaaa4ca64e9c6a402ae90d559bb256c12')
 
 prepare(){
@@ -79,8 +79,9 @@
   patch -p1 -i ../r-no-readline.patch
 # fix build with planarity 3 (Debian)
   patch -p2 -i ../sagemath-planarity3.patch
-# fix build with Singular 4.1.0-p2
-  patch -p0 -i ../sagemath-singular-4.1.0.p2.patch
+# fix build with Singular 4.1.0-p3
+  patch -p1 -i ../sagemath-singular-4.1.0.p2.patch
+  patch -p1 -i ../sagemath-singular-4.1.0.p3.patch
 # use correct latte-count binary name
   patch -p1 -i ../latte-count.patch
 # make 'sage -notebook=jupyter' work with our python3 jupyter-notebook package
@@ -89,8 +90,6 @@
 # Upstream patches  
 # fix build against libfes 0.2 http://trac.sagemath.org/ticket/15209
   patch -p1 -i ../fes02.patch
-# replace is_package_installed usage http://trac.sagemath.org/ticket/20377
-  patch -p1 -i ../is-package-installed.patch
 # port to pynac 0.7.6 https://trac.sagemath.org/ticket/22838
   patch -p1 -i ../sagemath-pynac-0.7.6.patch
 

Deleted: is-package-installed.patch
===================================================================
--- is-package-installed.patch	2017-06-03 13:56:43 UTC (rev 233755)
+++ is-package-installed.patch	2017-06-03 13:56:50 UTC (rev 233756)
@@ -1,328 +0,0 @@
-diff --git a/src/sage/databases/cremona.py b/src/sage/databases/cremona.py
-index 0a5f794..2969d92 100644
---- a/src/sage/databases/cremona.py
-+++ b/src/sage/databases/cremona.py
-@@ -53,7 +53,6 @@ from sage.misc.prandom import randint
- 
- import sage.schemes.elliptic_curves.constructor as elliptic
- from .sql_db import SQLDatabase, verify_column
--from sage.misc.package import is_package_installed
- from sage.env import SAGE_SHARE
- from sage.misc.all import walltime
- 
-@@ -824,7 +823,7 @@ class MiniCremonaDatabase(SQLDatabase):
-             if N < self.largest_conductor():
-                 message = "There is no elliptic curve with label " + label \
-                     + " in the database"
--            elif is_package_installed('database_cremona_ellcurve'):
-+            elif os.path.isfile(os.path.join(SAGE_SHARE, "cremona", "cremona.db")):
-                 message = "There is no elliptic curve with label " + label \
-                     + " in the currently available databases"
-             else:
-@@ -1673,7 +1672,7 @@ def CremonaDatabase(name=None,mini=None,set_global=None):
-     if name is None and not set_global:
-         return _db
-     if set_global and name is None:
--        if is_package_installed('database_cremona_ellcurve'):
-+        if os.path.isfile(os.path.join(SAGE_SHARE, "cremona", "cremona.db")):
-             name = 'cremona'
-         else:
-             name = 'cremona mini'
-diff --git a/src/sage/game_theory/normal_form_game.py b/src/sage/game_theory/normal_form_game.py
-index b917d2a..80fb20c 100644
---- a/src/sage/game_theory/normal_form_game.py
-+++ b/src/sage/game_theory/normal_form_game.py
-@@ -614,8 +614,9 @@ from sage.rings.all import QQ
- from sage.structure.sage_object import SageObject
- from sage.matrix.constructor import matrix
- from sage.matrix.constructor import vector
--from sage.misc.package import is_package_installed
- from sage.misc.temporary_file import tmp_filename
-+import os
-+from sage.env import SAGE_LOCAL
- 
- try:
-     from gambit import Game
-@@ -1317,13 +1318,13 @@ class NormalFormGame(SageObject, MutableMapping):
-             raise ValueError("utilities have not been populated")
- 
-         if not algorithm:
--            if is_package_installed('lrslib'):
-+            if os.path.isfile(os.path.join(SAGE_LOCAL, 'bin', 'lrs')):
-                 algorithm = "lrs"
-             else:
-                 algorithm = "enumeration"
- 
-         if algorithm == "lrs":
--            if not is_package_installed('lrslib'):
-+            if not os.path.isfile(os.path.join(SAGE_LOCAL, 'bin', 'lrs')):
-                 raise NotImplementedError("lrslib is not installed")
- 
-             return self._solve_lrs(maximization)
-diff --git a/src/sage/geometry/polyhedron/base.py b/src/sage/geometry/polyhedron/base.py
-index 2f58d8b..eb519a2 100644
---- a/src/sage/geometry/polyhedron/base.py
-+++ b/src/sage/geometry/polyhedron/base.py
-@@ -21,7 +21,6 @@ import six
- from sage.structure.element import Element, coerce_binop, is_Vector
- 
- from sage.misc.all import cached_method, prod
--from sage.misc.package import is_package_installed
- 
- from sage.rings.all import QQ, ZZ
- from sage.rings.real_double import RDF
-@@ -3691,7 +3690,9 @@ class Polyhedron_base(Element):
- 
-              David Avis's lrs program.
-         """
--        if not is_package_installed('lrslib'):
-+        import os
-+        from sage.env import SAGE_LOCAL
-+        if os.path.isfile(os.path.join(SAGE_LOCAL, 'bin', 'lrs')) != True:
-             raise NotImplementedError('You must install the optional lrslib package '
-                                        'for this function to work')
- 
-diff --git a/src/sage/graphs/generators/classical_geometries.py b/src/sage/graphs/generators/classical_geometries.py
-index e80f2a5..04cd9ce 100644
---- a/src/sage/graphs/generators/classical_geometries.py
-+++ b/src/sage/graphs/generators/classical_geometries.py
-@@ -1287,10 +1287,9 @@ def CossidentePenttilaGraph(q):
-         raise ValueError('q(={}) must be an odd prime power'.format(q))
- 
-     from sage.libs.gap.libgap import libgap
--    from sage.misc.package import is_package_installed, PackageNotFoundError
-+    from sage.interfaces.gap import gap
- 
--    if not is_package_installed('gap_packages'):
--        raise PackageNotFoundError('gap_packages')
-+    gap.load_package("grape")
- 
-     adj_list=libgap.function_factory("""function(q)
-         local z, e, so, G, nu, G1, G0, B, T, s, O1, O2, x;
-diff --git a/src/sage/graphs/generic_graph.py b/src/sage/graphs/generic_graph.py
-index 252984f..ce19682 100644
---- a/src/sage/graphs/generic_graph.py
-+++ b/src/sage/graphs/generic_graph.py
-@@ -7858,7 +7858,6 @@ class GenericGraph(GenericGraph_pyx):
-            sage: abs(flow_ff-flow_igraph) < 0.00001         # optional python_igraph
-            True
-         """
--        from sage.misc.package import is_package_installed
-         self._scream_if_not_simple(allow_loops=True)
-         if vertex_bound and algorithm in ["FF", "igraph"]:
-             raise ValueError("This method does not support both " +
-@@ -7876,10 +7875,12 @@ class GenericGraph(GenericGraph_pyx):
-         if algorithm is None:
-             if vertex_bound:
-                 algorithm = "LP"
--            elif is_package_installed("python_igraph"):
--                algorithm = "igraph"
-             else:
--                algorithm = "FF"
-+                algorithm = "igraph"
-+                try:
-+                    import igraph
-+                except ImportError:
-+                    algorithm = "FF"
- 
-         if (algorithm == "FF"):
-             return self._ford_fulkerson(x,y, value_only=value_only, integer=integer, use_edge_labels=use_edge_labels)
-diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py
-index 5919ab3..1766796 100644
---- a/src/sage/graphs/graph_generators.py
-+++ b/src/sage/graphs/graph_generators.py
-@@ -1195,8 +1195,9 @@ class GraphGenerators():
-         .. [buckygen] \G. Brinkmann, J. Goedgebeur and B.D. McKay, Generation of Fullerenes,
-           Journal of Chemical Information and Modeling, 52(11):2910-2918, 2012.
-         """
--        from sage.misc.package import is_package_installed
--        if not is_package_installed("buckygen"):
-+        import os
-+        from sage.env import SAGE_LOCAL
-+        if not os.path.isfile(os.path.join(SAGE_LOCAL, 'bin', 'buckygen')):
-             raise TypeError("the optional buckygen package is not installed")
- 
-         # number of vertices should be positive
-@@ -1280,8 +1281,9 @@ class GraphGenerators():
-         .. [benzene] \G. Brinkmann, G. Caporossi and P. Hansen, A Constructive Enumeration of Fusenes and Benzenoids,
-           Journal of Algorithms, 45:155-166, 2002.
-         """
--        from sage.misc.package import is_package_installed
--        if not is_package_installed("benzene"):
-+        import os
-+        from sage.env import SAGE_LOCAL
-+        if not os.path.isfile(os.path.join(SAGE_LOCAL, 'bin', 'benzene')):
-             raise TypeError("the optional benzene package is not installed")
- 
-         # number of hexagons should be positive
-@@ -1433,8 +1435,9 @@ class GraphGenerators():
-         .. [plantri] \G. Brinkmann and B.D. McKay, Fast generation of planar graphs,
-            MATCH-Communications in Mathematical and in Computer Chemistry, 58(2):323-357, 2007.
-         """
--        from sage.misc.package import is_package_installed
--        if not is_package_installed("plantri"):
-+        import os
-+        from sage.env import SAGE_LOCAL
-+        if not os.path.isfile(os.path.join(SAGE_LOCAL, 'bin', 'plantri')):
-             raise TypeError("the optional plantri package is not installed")
- 
-         # number of vertices should be positive
-@@ -1632,8 +1635,9 @@ class GraphGenerators():
-             sage: [g.size() for g in graphs.triangulations(6, minimum_connectivity=3)] # optional plantri
-             [12, 12]
-         """
--        from sage.misc.package import is_package_installed
--        if not is_package_installed("plantri"):
-+        import os
-+        from sage.env import SAGE_LOCAL
-+        if not os.path.isfile(os.path.join(SAGE_LOCAL, 'bin', 'plantri')):
-             raise TypeError("the optional plantri package is not installed")
- 
-         # number of vertices should be positive
-@@ -1786,8 +1790,9 @@ class GraphGenerators():
-             sage: [len(g) for g in graphs.quadrangulations(12, no_nonfacial_quadrangles=True, dual=True)]  # optional plantri
-             [10, 10]
-         """
--        from sage.misc.package import is_package_installed
--        if not is_package_installed("plantri"):
-+        import os
-+        from sage.env import SAGE_LOCAL
-+        if not os.path.isfile(os.path.join(SAGE_LOCAL, 'bin', 'plantri')):
-             raise TypeError("the optional plantri package is not installed")
- 
-         # number of vertices should be positive
-diff --git a/src/sage/graphs/lovasz_theta.py b/src/sage/graphs/lovasz_theta.py
-index 0d345c9..60948d2 100644
---- a/src/sage/graphs/lovasz_theta.py
-+++ b/src/sage/graphs/lovasz_theta.py
-@@ -65,10 +65,9 @@ def lovasz_theta(graph):
-     from sage.misc.temporary_file import tmp_filename
-     import os, subprocess
-     from sage.env import SAGE_LOCAL
--    from sage.misc.package import is_package_installed, PackageNotFoundError
- 
--    if not is_package_installed('csdp'):
--        raise PackageNotFoundError("csdp")
-+    if not os.path.isfile(os.path.join(SAGE_LOCAL, 'bin', 'theta')):
-+        raise NotImplementedError("You must install csdp before using this function")
- 
-     g = graph.relabel(inplace=False, perm=range(1,n+1)).networkx_graph()
-     tf_name = tmp_filename()
-diff --git a/src/sage/groups/generic.py b/src/sage/groups/generic.py
-index c801636..f43e6d9 100644
---- a/src/sage/groups/generic.py
-+++ b/src/sage/groups/generic.py
-@@ -1400,15 +1400,15 @@ def structure_description(G, latex=False):
-         sage: groups.matrix.GL(4,2).structure_description() # optional - database_gap
-         'A8'
-     """
--    import re
--    from sage.misc.package import is_package_installed
-+    import re, os
-+    from sage.env import SAGE_LOCAL
-     def correct_dihedral_degree(match):
-         return "%sD%d" % (match.group(1), int(match.group(2))/2)
- 
-     try:
-         description = str(G._gap_().StructureDescription())
-     except RuntimeError:
--        if not is_package_installed('database_gap'):
-+	if not os.path.isfile(os.path.join(SAGE_LOCAL, "lib", "gap", "small", "readsml.g")):
-             raise RuntimeError("You must install the optional database_gap package first.")
-         raise
- 
-diff --git a/src/sage/groups/perm_gps/permgroup.py b/src/sage/groups/perm_gps/permgroup.py
-index e42db61..d4d5684 100644
---- a/src/sage/groups/perm_gps/permgroup.py
-+++ b/src/sage/groups/perm_gps/permgroup.py
-@@ -145,7 +145,6 @@ from sage.groups.perm_gps.permgroup_element import PermutationGroupElement, stan
- from sage.groups.abelian_gps.abelian_group import AbelianGroup
- from sage.misc.cachefunc import cached_method
- from sage.groups.class_function import ClassFunction
--from sage.misc.package import is_package_installed
- from sage.sets.finite_enumerated_set import FiniteEnumeratedSet
- from sage.categories.all import FiniteEnumeratedSets
- from sage.groups.conjugacy_classes import ConjugacyClassGAP
-@@ -190,8 +189,6 @@ def hap_decorator(f):
-     """
-     @wraps(f)
-     def wrapped(self, n, p=0):
--        if not is_package_installed('gap_packages'):
--            raise RuntimeError("You must install the optional gap_packages package.")
-         load_hap()
-         from sage.arith.all import is_prime
-         if not (p == 0 or is_prime(p)):
-@@ -1682,9 +1679,7 @@ class PermutationGroup_generic(group.FiniteGroup):
-         try:
-             return [Integer(n) for n in self._gap_().IdGroup()]
-         except RuntimeError:
--            if not is_package_installed('database_gap'):
--                raise RuntimeError("You must install the optional database_gap package first.")
--            raise
-+            raise RuntimeError("You must install the optional gap_packages package.")
- 
-     def id(self):
-         """
-@@ -1735,9 +1730,7 @@ class PermutationGroup_generic(group.FiniteGroup):
-         try:
-             return Integer(self._gap_().PrimitiveIdentification())
-         except RuntimeError:
--            if not is_package_installed('database_gap'):
--                raise RuntimeError("You must install the optional database_gap package first.")
--            raise
-+            raise RuntimeError("You must install the optional gap_packages package.")
- 
-     def center(self):
-         """
-@@ -4113,8 +4106,6 @@ class PermutationGroup_generic(group.FiniteGroup):
-         - David Joyner and Graham Ellis
- 
-         """
--        if not is_package_installed('gap_packages'):
--            raise RuntimeError("You must install the optional gap_packages package.")
-         load_hap()
-         from sage.arith.all import is_prime
-         if not (p == 0 or is_prime(p)):
-diff --git a/src/sage/misc/all.py b/src/sage/misc/all.py
-index 90e6985..21daeb0 100644
---- a/src/sage/misc/all.py
-+++ b/src/sage/misc/all.py
-@@ -53,10 +53,6 @@ from fpickle import pickle_function, unpickle_function
- 
- from .dist import install_scripts
- 
--from .package import (installed_packages, is_package_installed,
--        standard_packages, optional_packages, experimental_packages,
--        package_versions)
--
- from .pager import pager
- 
- lazy_import('sage.misc.sagedoc', ['browse_sage_doc',
-diff --git a/src/sage/rings/polynomial/multi_polynomial_sequence.py b/src/sage/rings/polynomial/multi_polynomial_sequence.py
-index da41cb0..49cae0b 100644
---- a/src/sage/rings/polynomial/multi_polynomial_sequence.py
-+++ b/src/sage/rings/polynomial/multi_polynomial_sequence.py
-@@ -163,7 +163,6 @@ from sage.misc.cachefunc import cached_method
- 
- from types import GeneratorType
- from sage.misc.converting_dict import KeyConvertingDict
--from sage.misc.package import is_package_installed
- 
- from sage.structure.sequence import Sequence, Sequence_generic
- 
-@@ -1433,10 +1432,11 @@ class PolynomialSequence_gf2(PolynomialSequence_generic):
- 
-         if S != []:
-             if algorithm == "exhaustive_search":
--                if not is_package_installed('fes'):
--                    from sage.misc.package import PackageNotFoundError
--                    raise PackageNotFoundError("fes")
--                from sage.libs.fes import exhaustive_search
-+                try:
-+                    from sage.libs.fes import exhaustive_search
-+                except ImportError:
-+                    raise RuntimeError("You must install the optional fes package.")
-+
-                 solutions = exhaustive_search(S, max_sols=n, verbose=verbose, **kwds)
- 
-             elif algorithm == "polybori":

Modified: sagemath-singular-4.1.0.p2.patch
===================================================================
--- sagemath-singular-4.1.0.p2.patch	2017-06-03 13:56:43 UTC (rev 233755)
+++ sagemath-singular-4.1.0.p2.patch	2017-06-03 13:56:50 UTC (rev 233756)
@@ -1,7 +1,310 @@
---- src/sage/libs/singular/decl.pxd.orig	2017-02-21 07:58:27.088118954 +0000
-+++ src/sage/libs/singular/decl.pxd	2017-02-21 07:59:01.794846500 +0000
-@@ -484,8 +484,8 @@
+diff --git a/src/doc/de/tutorial/interfaces.rst b/src/doc/de/tutorial/interfaces.rst
+index edc59c5..83a8a8b 100644
+--- a/src/doc/de/tutorial/interfaces.rst
++++ b/src/doc/de/tutorial/interfaces.rst
+@@ -198,7 +198,7 @@ Sages Singular-Schnittstelle (ohne die ``....:``):
+     sage: R1 = singular.ring(0, '(x,y)', 'dp')
+     sage: R1
+     polynomial ring, over a field, global ordering
+-    //   characteristic : 0
++    //   coefficients: QQ
+     //   number of vars : 2
+     //        block   1 : ordering dp
+     //                  : names    x y
+diff --git a/src/doc/en/constructions/algebraic_geometry.rst b/src/doc/en/constructions/algebraic_geometry.rst
+index f7e663d..a312548 100644
+--- a/src/doc/en/constructions/algebraic_geometry.rst
++++ b/src/doc/en/constructions/algebraic_geometry.rst
+@@ -164,7 +164,7 @@ Other methods
+        sage: klein1 = f.Adj_div(); print(klein1)
+        [1]:
+           [1]:
+-             //   characteristic : 2
++             //   coefficients: ZZ/2
+        //   number of vars : 2
+        //        block   1 : ordering lp
+        //                  : names    x y
+@@ -187,13 +187,13 @@ Other methods
+        sage: print(klein1)
+        [1]:
+           [1]:
+-             //   characteristic : 2
++             //   coefficients: ZZ/2
+        //   number of vars : 2
+        //        block   1 : ordering lp
+        //                  : names    x y
+        //        block   2 : ordering C
+           [2]:
+-             //   characteristic : 2
++             //   coefficients: ZZ/2
+        //   number of vars : 3
+        //        block   1 : ordering lp
+        //                  : names    x y z
+@@ -210,7 +210,7 @@ Other methods
+        [5]:
+           [1]:
+              [1]:
+-                //   characteristic : 2
++                //   coefficients: ZZ/2
+        //   number of vars : 3
+        //        block   1 : ordering ls
+        //                  : names    x y t
+@@ -325,7 +325,7 @@ Singular itself to help an understanding of how the wrapper works.
+        sage: X = Curve(f); pts = X.rational_points()
+        sage: D = X.divisor([ (3, pts[0]), (-1,pts[1]), (10, pts[5]) ])
+        sage: X.riemann_roch_basis(D)
+-       [(-2*x + y)/(x + y), (-x + z)/(x + y)]
++       [(-x - 2*y)/(-2*x - 2*y), (-x + z)/(x + y)]
  
+ -  Using Singular's ``BrillNoether`` command (for details see the section
+    Brill-Noether in the Singular online documentation
+diff --git a/src/doc/en/constructions/rings.rst b/src/doc/en/constructions/rings.rst
+index 58abf8a..076184e 100644
+--- a/src/doc/en/constructions/rings.rst
++++ b/src/doc/en/constructions/rings.rst
+@@ -57,7 +57,7 @@ Here's an example using the Singular interface:
+     sage: I = singular.ideal(['a+b+c+d', 'ab+ad+bc+cd', 'abc+abd+acd+bcd', 'abcd-1'])
+     sage: R
+     polynomial ring, over a field, global ordering
+-    //   characteristic : 97
++    //   coefficients: ZZ/97
+     //   number of vars : 4
+     //        block   1 : ordering lp
+     //                  : names    a b c d
+diff --git a/src/doc/en/developer/coding_in_other.rst b/src/doc/en/developer/coding_in_other.rst
+index 640c8ac..b1728ea 100644
+--- a/src/doc/en/developer/coding_in_other.rst
++++ b/src/doc/en/developer/coding_in_other.rst
+@@ -402,7 +402,7 @@ interface to Singular::
+     sage: singular.LIB("brnoeth.lib")
+     sage: singular.ring(5,'(x,y)','lp')
+         polynomial ring, over a field, global ordering
+-        //   characteristic : 5
++        //   coefficients: ZZ/5
+         //   number of vars : 2
+         //        block   1 : ordering lp
+         //                  : names    x y
+diff --git a/src/doc/en/tutorial/interfaces.rst b/src/doc/en/tutorial/interfaces.rst
+index 5a27631..ca7ae7a 100644
+--- a/src/doc/en/tutorial/interfaces.rst
++++ b/src/doc/en/tutorial/interfaces.rst
+@@ -197,7 +197,7 @@ Singular (do not type the ``....:``):
+     sage: R1 = singular.ring(0, '(x,y)', 'dp')
+     sage: R1
+     polynomial ring, over a field, global ordering
+-    //   characteristic : 0
++    //   coefficients: QQ
+     //   number of vars : 2
+     //        block   1 : ordering dp
+     //                  : names    x y
+diff --git a/src/doc/fr/tutorial/interfaces.rst b/src/doc/fr/tutorial/interfaces.rst
+index 75f36a4..8109a67 100644
+--- a/src/doc/fr/tutorial/interfaces.rst
++++ b/src/doc/fr/tutorial/interfaces.rst
+@@ -199,7 +199,7 @@ fournie par Sage (n'entrez pas les ``....:``) :
+     sage: R1 = singular.ring(0, '(x,y)', 'dp')
+     sage: R1
+     polynomial ring, over a field, global ordering
+-    //   characteristic : 0
++    //   coefficients: QQ
+     //   number of vars : 2
+     //        block   1 : ordering dp
+     //                  : names    x y
+diff --git a/src/doc/ja/tutorial/interfaces.rst b/src/doc/ja/tutorial/interfaces.rst
+index 560032a..6438103 100644
+--- a/src/doc/ja/tutorial/interfaces.rst
++++ b/src/doc/ja/tutorial/interfaces.rst
+@@ -173,7 +173,7 @@ Singularは,グレブナー基底,多変数多項式のgcd,平面曲線の
+     sage: R1 = singular.ring(0, '(x,y)', 'dp')
+     sage: R1
+     polynomial ring, over a field, global ordering
+-    //   characteristic : 0
++    //   coefficients: QQ
+     //   number of vars : 2
+     //        block   1 : ordering dp
+     //                  : names    x y
+diff --git a/src/doc/pt/tutorial/interfaces.rst b/src/doc/pt/tutorial/interfaces.rst
+index 5f611f8..4539bf6 100644
+--- a/src/doc/pt/tutorial/interfaces.rst
++++ b/src/doc/pt/tutorial/interfaces.rst
+@@ -197,7 +197,7 @@ digite ``...``):
+     sage: R1 = singular.ring(0, '(x,y)', 'dp')
+     sage: R1
+     polynomial ring, over a field, global ordering
+-    //   characteristic : 0
++    //   coefficients: QQ
+     //   number of vars : 2
+     //        block   1 : ordering dp
+     //                  : names    x y 
+diff --git a/src/doc/ru/tutorial/interfaces.rst b/src/doc/ru/tutorial/interfaces.rst
+index 234731a..bc2983c 100644
+--- a/src/doc/ru/tutorial/interfaces.rst
++++ b/src/doc/ru/tutorial/interfaces.rst
+@@ -191,7 +191,7 @@ Singular предоставляет массивную и продуманную
+     sage: R1 = singular.ring(0, '(x,y)', 'dp')
+     sage: R1
+     polynomial ring, over a field, global ordering
+-    //   characteristic : 0
++    //   coefficients: QQ
+     //   number of vars : 2
+     //        block   1 : ordering dp
+     //                  : names    x y
+diff --git a/src/sage/categories/pushout.py b/src/sage/categories/pushout.py
+index cd8b9db..cccc344 100644
+--- a/src/sage/categories/pushout.py
++++ b/src/sage/categories/pushout.py
+@@ -3202,7 +3202,7 @@ class BlackBoxConstructionFunctor(ConstructionFunctor):
+         Gap
+         sage: FS(QQ['t'])
+         polynomial ring, over a field, global ordering
+-        //   characteristic : 0
++        //   coefficients: QQ
+         //   number of vars : 1
+         //        block   1 : ordering lp
+         //                  : names    t
+diff --git a/src/sage/interfaces/expect.py b/src/sage/interfaces/expect.py
+index 6a44b29..9a9ed5e 100644
+--- a/src/sage/interfaces/expect.py
++++ b/src/sage/interfaces/expect.py
+@@ -1216,7 +1216,7 @@ If this all works, you can then make calls like:
+             sage: R.<x> = QQ[]; f = x^3 + x + 1;  g = x^3 - x - 1; r = f.resultant(g); gap(ZZ); singular(R)
+             Integers
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+diff --git a/src/sage/interfaces/interface.py b/src/sage/interfaces/interface.py
+index e4cfe51..2865c70 100644
+--- a/src/sage/interfaces/interface.py
++++ b/src/sage/interfaces/interface.py
+@@ -735,7 +735,7 @@ class InterfaceElement(Element):
+             sage: S = singular.ring(0, ('x'))
+             sage: loads(dumps(S))
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+diff --git a/src/sage/interfaces/singular.py b/src/sage/interfaces/singular.py
+index 2af7bc1..43745a2 100644
+--- a/src/sage/interfaces/singular.py
++++ b/src/sage/interfaces/singular.py
+@@ -65,7 +65,7 @@ factorization::
+     sage: R1 = singular.ring(0, '(x,y)', 'dp')
+     sage: R1
+     polynomial ring, over a field, global ordering
+-    //   characteristic : 0
++    //   coefficients: QQ
+     //   number of vars : 2
+     //        block   1 : ordering dp
+     //                  : names    x y
+@@ -243,7 +243,7 @@ Groebner basis for some ideal, using Singular through Sage.
+     sage: singular.lib('poly.lib')
+     sage: singular.ring(32003, '(a,b,c,d,e,f)', 'lp')
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 32003
++            //   coefficients: ZZ/32003
+             //   number of vars : 6
+             //        block   1 : ordering lp
+             //                        : names    a b c d e f
+@@ -1000,7 +1000,7 @@ class Singular(ExtraTabCompletion, Expect):
+             sage: R = singular.ring(0, '(x,y,z)', 'dp')
+             sage: R
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 3
+             //        block   1 : ordering dp
+             //                  : names    x y z
+@@ -1080,7 +1080,7 @@ class Singular(ExtraTabCompletion, Expect):
+             sage: S = singular.ring('real', '(a,b)', 'lp')
+             sage: singular.current_ring()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0 (real)
++            //   coefficients: float
+             //   number of vars : 2
+             //        block   1 : ordering lp
+             //                  : names    a b
+@@ -1088,7 +1088,7 @@ class Singular(ExtraTabCompletion, Expect):
+             sage: singular.set_ring(R)
+             sage: singular.current_ring()
+             polynomial ring, over a field, local ordering
+-            //   characteristic : 7
++            //   coefficients: ZZ/7
+             //   number of vars : 2
+             //        block   1 : ordering ds
+             //                  : names    a b
+@@ -1130,14 +1130,14 @@ class Singular(ExtraTabCompletion, Expect):
+             sage: r = PolynomialRing(GF(127),3,'xyz', order='invlex')
+             sage: r._singular_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 127
++            //   coefficients: ZZ/127
+             //   number of vars : 3
+             //        block   1 : ordering rp
+             //                  : names    x y z
+             //        block   2 : ordering C
+             sage: singular.current_ring()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 127
++            //   coefficients: ZZ/127
+             //   number of vars : 3
+             //        block   1 : ordering rp
+             //                  : names    x y z
+@@ -1360,7 +1360,7 @@ class SingularElement(ExtraTabCompletion, ExpectElement):
+             sage: cpQ.set_ring()
+             sage: cpQ
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -1911,7 +1911,7 @@ class SingularElement(ExtraTabCompletion, ExpectElement):
+ 
+             sage: singular('basering')
+             polynomial ring, over a domain, global ordering
+-            //   coeff. ring is : ZZ
++            //   coefficients: ZZ
+             //   number of vars : 3
+             //        block   1 : ordering lp
+             //                  : names    x y z
+@@ -1996,7 +1996,7 @@ class SingularElement(ExtraTabCompletion, ExpectElement):
+             sage: S = singular.ring('real', '(a,b)', 'lp')
+             sage: singular.current_ring()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0 (real)
++            //   coefficients: float
+             //   number of vars : 2
+             //        block   1 : ordering lp
+             //                  : names    a b
+@@ -2004,7 +2004,7 @@ class SingularElement(ExtraTabCompletion, ExpectElement):
+             sage: R.set_ring()
+             sage: singular.current_ring()
+             polynomial ring, over a field, local ordering
+-            //   characteristic : 7
++            //   coefficients: ZZ/7
+             //   number of vars : 2
+             //        block   1 : ordering ds
+             //                  : names    a b
+@@ -2260,7 +2260,7 @@ def reduce_load():
+ 
+         sage: loads(dumps(singular.ring()))
+         polynomial ring, over a field, global ordering
+-        //   characteristic : 0
++        //   coefficients: QQ
+         //   number of vars : 1
+         //        block   1 : ordering lp
+         //                  : names    x
+diff --git a/src/sage/libs/singular/decl.pxd b/src/sage/libs/singular/decl.pxd
+index 4afc0cc..2dec5d8 100644
+--- a/src/sage/libs/singular/decl.pxd
++++ b/src/sage/libs/singular/decl.pxd
+@@ -484,8 +484,8 @@ cdef extern from "singular/Singular/libsingular.h":
+ 
      ring *rDefault(int char , int nvars, char **names)
      ring *rDefault(const n_Procs_s* cf, int nvars, char **names)
 -    ring *rDefault(int ch             , int nvars, char **names,int ord_size, int *ord, int *block0, int *block1, int **wvhdl)
@@ -11,9 +314,24 @@
  
  
  
---- src/sage/libs/singular/ring.pyx.orig	2017-02-21 07:24:23.197906897 +0000
-+++ src/sage/libs/singular/ring.pyx	2017-02-21 07:29:23.731763098 +0000
-@@ -21,7 +21,7 @@
+diff --git a/src/sage/libs/singular/function.pyx b/src/sage/libs/singular/function.pyx
+index 2813a6f..0f3b76f 100644
+--- a/src/sage/libs/singular/function.pyx
++++ b/src/sage/libs/singular/function.pyx
+@@ -282,7 +282,7 @@ cdef class RingWrap:
+             sage: l = ringlist(P)
+             sage: ring = singular_function("ring")
+             sage: ring(l, ring=P)._output()
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 3
+             //        block   1 : ordering dp
+             //                  : names    x y z
+diff --git a/src/sage/libs/singular/ring.pyx b/src/sage/libs/singular/ring.pyx
+index 4a6e167..f221132 100644
+--- a/src/sage/libs/singular/ring.pyx
++++ b/src/sage/libs/singular/ring.pyx
+@@ -21,7 +21,7 @@ from sage.libs.gmp.mpz cimport mpz_init_set_ui, mpz_init_set
  from sage.libs.singular.decl cimport number, poly, ring, currRing
  from sage.libs.singular.decl cimport rChangeCurrRing, rCopy0, rComplete, rDelete, idInit
  from sage.libs.singular.decl cimport omAlloc0, omStrDup, omAlloc, omAlloc0Bin,  sip_sring_bin, rnumber_bin
@@ -22,7 +340,7 @@
  from sage.libs.singular.decl cimport p_Copy, prCopyR
  from sage.libs.singular.decl cimport n_unknown,  n_Zp,  n_Q,   n_R,   n_GF,  n_long_R,  n_algExt,n_transExt,n_long_C,   n_Z,   n_Zn,  n_Znm,  n_Z2m,  n_CF
  from sage.libs.singular.decl cimport n_coeffType, cfInitCharProc
-@@ -165,7 +165,7 @@
+@@ -165,7 +165,7 @@ cdef ring *singular_ring_new(base_ring, n, names, term_order) except NULL:
      ##         q    q : GF(q=p^n)       *names         TRUE              (todo)
  
      _wvhdl  = <int **>omAlloc0((nblcks + 2) * sizeof(int *))
@@ -31,3 +349,429 @@
      _block0 = <int *>omAlloc0((nblcks + 2) * sizeof(int))
      _block1 = <int *>omAlloc0((nblcks + 2) * sizeof(int))
  
+diff --git a/src/sage/rings/polynomial/multi_polynomial_element.py b/src/sage/rings/polynomial/multi_polynomial_element.py
+index eeafd87..c79ff28 100644
+--- a/src/sage/rings/polynomial/multi_polynomial_element.py
++++ b/src/sage/rings/polynomial/multi_polynomial_element.py
+@@ -1994,7 +1994,7 @@ def degree_lowest_rational_function(r,x):
+     ::
+ 
+         sage: r = f/g; r
+-        (-2*b*c^2 - 1)/(2*a*b^3*c^6 + a*c)
++        (-b*c^2 + 2)/(a*b^3*c^6 - 2*a*c)
+         sage: degree_lowest_rational_function(r,a)
+         (-1, 3)
+         sage: degree_lowest_rational_function(r,b)
+diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py
+index 06ffc67..21f60c0 100644
+--- a/src/sage/rings/polynomial/multi_polynomial_ideal.py
++++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py
+@@ -190,7 +190,7 @@ when the system has no solutions over the rationals.
+     The Groebner basis modulo any product of the prime factors is also non-trivial::
+ 
+         sage: I.change_ring(P.change_ring( IntegerModRing(2*7) )).groebner_basis()
+-        [x + 3*y + 11*z, y^2 + 3*y, y*z + 11*y + 4, 2*y + 6, z^2 + 3, 2*z + 10]
++        [x + 9*y + 13*z, y^2 + 3*y, y*z + 7*y + 6, 2*y + 6, z^2 + 3, 2*z + 10]
+ 
+     Modulo any other prime the Groebner basis is trivial so there are
+     no other solutions. For example::
+@@ -3646,11 +3646,13 @@ class MPolynomialIdeal( MPolynomialIdeal_singular_repr, \
+             sage: P.<a,b,c> = PolynomialRing(Zmod(1000),3)
+             sage: I = P * (a + 2*b + 2*c - 1, a^2 - a + 2*b^2 + 2*c^2, 2*a*b + 2*b*c - b)
+             sage: I.groebner_basis()
+-            [b*c^2 + 992*b*c + 712*c^2 + 332*b + 96*c,
+-             2*c^3 + 214*b*c + 862*c^2 + 762*b + 268*c,
++            [b*c^2 + 732*b*c + 808*b,
++             2*c^3 + 884*b*c + 666*c^2 + 320*b,
+              b^2 + 438*b*c + 281*b,
+              5*b*c + 156*c^2 + 112*b + 948*c,
+-             50*c^2 + 600*b + 650*c, a + 2*b + 2*c + 999, 125*b]
++             50*c^2 + 600*b + 650*c,
++             a + 2*b + 2*c + 999,
++             125*b]
+ 
+         ::
+ 
+diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
+index 947eeb2..220e4d3 100644
+--- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
++++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
+@@ -594,7 +594,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+ 
+             sage: P._singular_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 3
+             //        block   1 : ordering dp
+             //                  : names    x y z
+@@ -1182,7 +1182,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: P.<x,y,z> = QQ[]
+             sage: P._singular_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 3
+             //        block   1 : ordering dp
+             //                  : names    x y z
+@@ -1198,9 +1198,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: P.<x,y,z> = PolynomialRing(k,3)
+             sage: P._singular_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 3
+-            //   1 parameter    : a
+-            //   minpoly        : (a^3-a+1)
++            //   coefficients: ZZ/3[a]/(a^3-a+1)
+             //   number of vars : 3
+             //        block   1 : ordering dp
+             //                  : names    x y z
+@@ -1216,7 +1214,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: P.<x> = QQ[]
+             sage: P._singular_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+@@ -1256,7 +1254,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: P.<x,y,z> = QQ[]
+             sage: P._singular_init_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 3
+             //        block   1 : ordering dp
+             //                  : names    x y z
+@@ -1271,9 +1269,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R.<x,y> = PolynomialRing(NumberField(w^2+1,'s'))
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
+-            //   1 parameter    : s
+-            //   minpoly        : (s^2+1)
++            //   coefficients: QQ[s]/(s^2+1)
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -1282,9 +1278,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R = PolynomialRing(GF(2**8,'a'),10,'x', order='invlex')
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 2
+-            //   1 parameter    : a
+-            //   minpoly        : (a^8+a^4+a^3+a^2+1)
++            //   coefficients: ZZ/2[a]/(a^8+a^4+a^3+a^2+1)
+             //   number of vars : 10
+             //        block   1 : ordering rp
+             //                  : names    x0 x1 x2 x3 x4 x5 x6 x7 x8 x9
+@@ -1293,7 +1287,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R = PolynomialRing(GF(127),2,'x', order='invlex')
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 127
++            //   coefficients: ZZ/127
+             //   number of vars : 2
+             //        block   1 : ordering rp
+             //                  : names    x0 x1
+@@ -1302,7 +1296,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R = PolynomialRing(QQ,2,'x', order='invlex')
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 2
+             //        block   1 : ordering rp
+             //                  : names    x0 x1
+@@ -1311,7 +1305,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R = PolynomialRing(QQ,2,'x', order='degneglex')
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 2
+             //        block   1 : ordering a
+             //                  : names    x0 x1
+@@ -1323,7 +1317,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R = PolynomialRing(QQ,'x')
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+@@ -1332,7 +1326,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R = PolynomialRing(GF(127),'x')
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 127
++            //   coefficients: ZZ/127
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+@@ -1341,7 +1335,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R = ZZ['x,y']
+             sage: singular(R)
+             polynomial ring, over a domain, global ordering
+-            //   coeff. ring is : ZZ
++            //   coefficients: ZZ
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -1350,7 +1344,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R = IntegerModRing(1024)['x,y']
+             sage: singular(R)
+             polynomial ring, over a ring (with zero-divisors), global ordering
+-            //   coeff. ring is : Z/2^10
++            //   coefficients: Z/2^10
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -1359,7 +1353,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R = IntegerModRing(15)['x,y']
+             sage: singular(R)
+             polynomial ring, over a ring (with zero-divisors), global ordering
+-            //   coeff. ring is : ZZ/15
++            //   coefficients: ZZ/bigint(15)
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -1370,7 +1364,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: P.<x> = QQ[]
+             sage: P._singular_init_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+diff --git a/src/sage/rings/polynomial/pbori.pyx b/src/sage/rings/polynomial/pbori.pyx
+index 23c346e..812f3b9 100644
+--- a/src/sage/rings/polynomial/pbori.pyx
++++ b/src/sage/rings/polynomial/pbori.pyx
+@@ -1410,7 +1410,7 @@ cdef class BooleanPolynomialRing(MPolynomialRing_generic):
+             sage: B.<x,y> = BooleanPolynomialRing(2)
+             sage: B._singular_() # indirect doctest
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 2
++            //   coefficients: ZZ/2
+             //   number of vars : 2
+             //        block   1 : ordering lp
+             //                  : names    x y
+diff --git a/src/sage/rings/polynomial/polynomial_quotient_ring.py b/src/sage/rings/polynomial/polynomial_quotient_ring.py
+index d5db40b..28fa62b 100644
+--- a/src/sage/rings/polynomial/polynomial_quotient_ring.py
++++ b/src/sage/rings/polynomial/polynomial_quotient_ring.py
+@@ -612,7 +612,7 @@ class PolynomialQuotientRing_generic(CommutativeRing):
+             sage: Q = P.quo([(x^2+1)])
+             sage: singular(Q)        # indirect doctest
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    xbar
+diff --git a/src/sage/rings/polynomial/polynomial_singular_interface.py b/src/sage/rings/polynomial/polynomial_singular_interface.py
+index 3f0d1d0..1230a5e 100644
+--- a/src/sage/rings/polynomial/polynomial_singular_interface.py
++++ b/src/sage/rings/polynomial/polynomial_singular_interface.py
+@@ -81,9 +81,7 @@ class PolynomialRing_singular_repr:
+             sage: R.<x,y> = PolynomialRing(CC,'x',2)
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0 (complex:15 digits, additional 0 digits)
+-            //   1 parameter    : I
+-            //   minpoly        : (I^2+1)
++            //   coefficients: float[I](complex:15 digits, additional 0 digits)/(I^2+1)
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -91,7 +89,7 @@ class PolynomialRing_singular_repr:
+             sage: R.<x,y> = PolynomialRing(RealField(100),'x',2)
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0 (real)
++            //   coefficients: float
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -101,9 +99,7 @@ class PolynomialRing_singular_repr:
+             sage: R.<x> = PolynomialRing(NumberField(w^2+1,'s'))
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
+-            //   1 parameter    : s
+-            //   minpoly        : (s^2+1)
++            //   coefficients: QQ[s]/(s^2+1)
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+@@ -112,7 +108,7 @@ class PolynomialRing_singular_repr:
+             sage: R = PolynomialRing(GF(127),1,'x')
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 127
++            //   coefficients: ZZ/127
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+@@ -121,7 +117,7 @@ class PolynomialRing_singular_repr:
+             sage: R = PolynomialRing(QQ,1,'x')
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+@@ -130,7 +126,7 @@ class PolynomialRing_singular_repr:
+             sage: R = PolynomialRing(QQ,'x')
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+@@ -139,7 +135,7 @@ class PolynomialRing_singular_repr:
+             sage: R = PolynomialRing(GF(127),'x')
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 127
++            //   coefficients: ZZ/127
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+@@ -148,9 +144,7 @@ class PolynomialRing_singular_repr:
+             sage: R = Frac(ZZ['a,b'])['x,y']
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
+-            //   2 parameter    : a b
+-            //   minpoly        : 0
++            //   coefficients: QQ(a, b)
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -160,7 +154,7 @@ class PolynomialRing_singular_repr:
+             sage: R = IntegerModRing(1024)['x,y']
+             sage: singular(R)
+             polynomial ring, over a ring (with zero-divisors), global ordering
+-            //   coeff. ring is : Z/2^10
++            //   coefficients: Z/2^10
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -169,7 +163,7 @@ class PolynomialRing_singular_repr:
+             sage: R = IntegerModRing(15)['x,y']
+             sage: singular(R)
+             polynomial ring, over a ring (with zero-divisors), global ordering
+-            //   coeff. ring is : ZZ/15
++            //   coefficients: ZZ/bigint(15)
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -178,7 +172,7 @@ class PolynomialRing_singular_repr:
+             sage: R = ZZ['x,y']
+             sage: singular(R)
+             polynomial ring, over a domain, global ordering
+-            //   coeff. ring is : ZZ
++            //   coefficients: ZZ
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -190,9 +184,7 @@ class PolynomialRing_singular_repr:
+             sage: S = K['y']
+             sage: singular(S)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 5
+-            //   1 parameter    : x
+-            //   minpoly        : 0
++            //   coefficients: ZZ/5(x)
+             //   number of vars : 2
+             //        block   1 : ordering lp
+             //                  : names    a y
+@@ -234,7 +226,7 @@ class PolynomialRing_singular_repr:
+ 
+             sage: PolynomialRing(QQ,'u_ba')._singular_init_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    u_ba
+diff --git a/src/sage/rings/polynomial/term_order.py b/src/sage/rings/polynomial/term_order.py
+index 213a36c..c169f33 100644
+--- a/src/sage/rings/polynomial/term_order.py
++++ b/src/sage/rings/polynomial/term_order.py
+@@ -1756,7 +1756,7 @@ class TermOrder(SageObject):
+             '(lp(3),Dp(5),lp(2))'
+             sage: P._singular_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 127
++            //   coefficients: ZZ/127
+             //   number of vars : 10
+             //        block   1 : ordering lp
+             //                  : names    x0 x1 x2
+@@ -1784,7 +1784,7 @@ class TermOrder(SageObject):
+             '(a(1:2),ls(2),a(1:2),ls(2))'
+             sage: P._singular_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 4
+             //        block   1 : ordering a
+             //                  : names    x0 x1
+diff --git a/src/sage/rings/quotient_ring.py b/src/sage/rings/quotient_ring.py
+index a670513..d78fb70 100644
+--- a/src/sage/rings/quotient_ring.py
++++ b/src/sage/rings/quotient_ring.py
+@@ -1174,7 +1174,7 @@ class QuotientRing_nc(ring.Ring, sage.structure.parent_gens.ParentWithGens):
+             sage: S = R.quotient_ring(x^2+y^2)
+             sage: S._singular_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+diff --git a/src/sage/rings/quotient_ring_element.py b/src/sage/rings/quotient_ring_element.py
+index e6565a7..d5bd037 100644
+--- a/src/sage/rings/quotient_ring_element.py
++++ b/src/sage/rings/quotient_ring_element.py
+@@ -786,7 +786,7 @@ class QuotientRingElement(RingElement):
+             sage: Q = P.quo(I)
+             sage: Q._singular_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 2
++            //   coefficients: ZZ/2
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+diff --git a/src/sage/schemes/affine/affine_morphism.py b/src/sage/schemes/affine/affine_morphism.py
+index d061b40..611b274 100644
+--- a/src/sage/schemes/affine/affine_morphism.py
++++ b/src/sage/schemes/affine/affine_morphism.py
+@@ -670,7 +670,7 @@ class SchemeMorphism_polynomial_affine_space(SchemeMorphism_polynomial):
+             sage: H = Hom(A,A)
+             sage: F = H([1/2*x^2 + sqrt(3)])
+             sage: F.dynatomic_polynomial([1,1])
+-            (2.00000000000000*x^4 + 5.85640646055102*x^2 + 24.0000000000000)/(x^2 + (-2.00000000000000)*x + 3.46410161513775)
++            (0.125000000000000*x^4 + 0.366025403784439*x^2 + 1.50000000000000)/(0.500000000000000*x^2 - x + 1.73205080756888)
+         """
+         if self.domain() != self.codomain():
+             raise TypeError("must have same domain and codomain to iterate")
+diff --git a/src/sage/schemes/curves/projective_curve.py b/src/sage/schemes/curves/projective_curve.py
+index e2de777..0e88d70 100644
+--- a/src/sage/schemes/curves/projective_curve.py
++++ b/src/sage/schemes/curves/projective_curve.py
+@@ -1830,7 +1830,7 @@ class ProjectivePlaneCurve_prime_finite_field(ProjectivePlaneCurve_finite_field)
+             sage: C = Curve(f); pts = C.rational_points()
+             sage: D = C.divisor([ (3, pts[0]), (-1,pts[1]), (10, pts[5]) ])
+             sage: C.riemann_roch_basis(D)
+-            [(-2*x + y)/(x + y), (-x + z)/(x + y)]
++            [(-x - 2*y)/(-2*x - 2*y), (-x + z)/(x + y)]
+ 
+ 
+         .. NOTE::

Copied: sagemath/trunk/sagemath-singular-4.1.0.p3.patch (from rev 218951, sagemath/trunk/sagemath-singular-4.1.0.p2.patch)
===================================================================
--- sagemath-singular-4.1.0.p3.patch	                        (rev 0)
+++ sagemath-singular-4.1.0.p3.patch	2017-06-03 13:56:50 UTC (rev 233756)
@@ -0,0 +1,118 @@
+diff --git a/src/sage/libs/singular/decl.pxd b/src/sage/libs/singular/decl.pxd
+index 2dec5d8..676544a 100644
+--- a/src/sage/libs/singular/decl.pxd
++++ b/src/sage/libs/singular/decl.pxd
+@@ -534,6 +534,9 @@ cdef extern from "singular/Singular/libsingular.h":
+ 
+     int rRing_has_Comp(ring *r)
+ 
++    int rHasGlobalOrdering(ring *r)
++    int rHasLocalOrMixedOrdering(ring *r)
++
+     # return new empty monomial
+ 
+     poly *p_Init(ring *r)
+@@ -598,7 +601,7 @@ cdef extern from "singular/Singular/libsingular.h":
+ 
+     # homogenizes p by multiplying certain powers of the varnum-th variable
+ 
+-    poly *pHomogen (poly *p, int varnum)
++    poly *p_Homogen (poly *p, int varnum, ring *r)
+ 
+     # return whether a polynomial is homogenous
+ 
+@@ -710,7 +713,7 @@ cdef extern from "singular/Singular/libsingular.h":
+ 
+     # inverse of poly, if possible
+ 
+-    poly *pInvers(int n, poly *, intvec *)
++    poly *p_Series(int n, poly *, poly *, intvec *, ring *r)
+ 
+     # gcd of f and g
+ 
+@@ -766,6 +769,10 @@ cdef extern from "singular/Singular/libsingular.h":
+     # Copy this number
+     number *n_Copy(number *n, ring* r)
+ 
++    # Invert this number
++    int n_IsUnit(number *n, const n_Procs_s *cf)
++    number *n_Invers(number *n, const n_Procs_s *cf)
++
+     # rational number from int
+ 
+     number *nlInit(int)
+diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
+index ffc6787..656acc9 100644
+--- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
++++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
+@@ -186,12 +186,13 @@ from sage.libs.singular.decl cimport n_unknown,  n_Zp,  n_Q,   n_R,   n_GF,  n_l
+ # singular functions
+ from sage.libs.singular.decl cimport (
+     errorreported,
++    n_IsUnit, n_Invers,
+     p_ISet, rChangeCurrRing, p_Copy, p_Init, p_SetCoeff, p_Setm, p_SetExp, p_Add_q,
+     p_NSet, p_GetCoeff, p_Delete, p_GetExp, pNext, rRingVar, omAlloc0, omStrDup,
+     omFree, pDivide, p_SetCoeff0, n_Init, p_DivisibleBy, pLcm, p_LmDivisibleBy,
+     pDivide, p_IsConstant, p_ExpVectorEqual, p_String, p_LmInit, n_Copy,
+-    p_IsUnit, pInvers, p_Head, idInit, fast_map_common_subexp, id_Delete,
+-    p_IsHomogeneous, pHomogen, p_Totaldegree,pLDeg1_Totaldegree, singclap_pdivide, singclap_factorize,
++    p_IsUnit, p_Series, p_Head, idInit, fast_map_common_subexp, id_Delete,
++    p_IsHomogeneous, p_Homogen, p_Totaldegree,pLDeg1_Totaldegree, singclap_pdivide, singclap_factorize,
+     idLift, IDELEMS, On, Off, SW_USE_CHINREM_GCD, SW_USE_EZGCD,
+     p_LmIsConstant, pTakeOutComp1, singclap_gcd, pp_Mult_qq, p_GetMaxExp,
+     pLength, kNF, p_Neg, p_Minus_mm_Mult_qq, p_Plus_mm_Mult_qq,
+@@ -1353,7 +1354,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R = IntegerModRing(1024)['x,y']
+             sage: singular(R)
+             polynomial ring, over a ring (with zero-divisors), global ordering
+-            //   coefficients: Z/2^10
++            //   coefficients: ZZ/(2^10)
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -3112,11 +3113,11 @@ cdef class MPolynomial_libsingular(sage.rings.polynomial.multi_polynomial.MPolyn
+         cdef ring *_ring = self._parent_ring
+         if(_ring != currRing): rChangeCurrRing(_ring)
+ 
+-        if not p_IsUnit(self._poly, _ring):
++        if not (p_IsUnit(self._poly,_ring)):
+             raise ArithmeticError("Element is not a unit.")
+ 
+         sig_on()
+-        cdef MPolynomial_libsingular r = new_MP(self._parent, pInvers(0, self._poly, NULL))
++        cdef MPolynomial_libsingular r = new_MP(self._parent, p_NSet(n_Invers(p_GetCoeff(self._poly, _ring),_ring.cf),_ring))
+         sig_off()
+         return r
+ 
+@@ -3171,14 +3172,17 @@ cdef class MPolynomial_libsingular(sage.rings.polynomial.multi_polynomial.MPolyn
+ 
+         SEE: ``self.homogenize``
+         """
++        cdef ring *_ring = self._parent_ring
+         cdef MPolynomialRing_libsingular parent = self._parent
+         cdef MPolynomial_libsingular f
+ 
+         if self.is_homogeneous():
+             return self
+ 
++        if(_ring != currRing): rChangeCurrRing(_ring)
++
+         if var < parent._ring.N:
+-            return new_MP(parent, pHomogen(p_Copy(self._poly, self._parent_ring), var+1))
++            return new_MP(parent, p_Homogen(self._poly, var+1, _ring))
+         else:
+             raise TypeError("var must be < self.parent().ngens()")
+ 
+diff --git a/src/sage/rings/polynomial/polynomial_singular_interface.py b/src/sage/rings/polynomial/polynomial_singular_interface.py
+index 1230a5e..1eb2566 100644
+--- a/src/sage/rings/polynomial/polynomial_singular_interface.py
++++ b/src/sage/rings/polynomial/polynomial_singular_interface.py
+@@ -154,7 +154,7 @@ class PolynomialRing_singular_repr:
+             sage: R = IntegerModRing(1024)['x,y']
+             sage: singular(R)
+             polynomial ring, over a ring (with zero-divisors), global ordering
+-            //   coefficients: Z/2^10
++            //   coefficients: ZZ/(2^10)
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y



More information about the arch-commits mailing list