summarylogtreecommitdiffstats
path: root/sagemath-singular-4.3.1.p3.patch
blob: e30b92d5ffcdf2498869d3f36d46cc2b255e70be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
diff --git a/build/pkgs/singular/checksums.ini b/build/pkgs/singular/checksums.ini
index 2e33a405d3..313463d2fe 100644
--- a/build/pkgs/singular/checksums.ini
+++ b/build/pkgs/singular/checksums.ini
@@ -1,5 +1,5 @@
 tarball=singular-VERSION.tar.gz
-sha1=6c2b622d3681e2de3d58d30c654d43d3e32b720c
-md5=abb1e37c794472e7760655358ab66054
-cksum=17455733
+sha1=28bb3ee97ef48d04dfa96de182fd93eebe08426c
+md5=fc0a4f5720dadba45a52ee94324ce00c
+cksum=1573851737
 upstream_url=ftp://jim.mathematik.uni-kl.de/pub/Math/Singular/SOURCES/4-3-1/singular-VERSION.tar.gz
diff --git a/build/pkgs/singular/package-version.txt b/build/pkgs/singular/package-version.txt
index 11300c77e7..66e2bede53 100644
--- a/build/pkgs/singular/package-version.txt
+++ b/build/pkgs/singular/package-version.txt
@@ -1 +1 @@
-4.3.1p1
+4.3.1p3
diff --git a/src/sage/libs/singular/decl.pxd b/src/sage/libs/singular/decl.pxd
index 8e3ac314b6..747a6b1e2f 100644
--- a/src/sage/libs/singular/decl.pxd
+++ b/src/sage/libs/singular/decl.pxd
@@ -574,7 +574,7 @@ cdef extern from "singular/Singular/libsingular.h":
 
     # gets a component out of a polynomial vector
 
-    poly *pTakeOutComp1(poly **, int)
+    poly *pTakeOutComp(poly **, int)
 
     # deep copy p
 
diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singular.pyx
index d8ea7b07f3..368ee09d50 100644
--- a/src/sage/libs/singular/singular.pyx
+++ b/src/sage/libs/singular/singular.pyx
@@ -1726,20 +1726,17 @@ cdef int overflow_check(unsigned long e, ring *_ring) except -1:
 
     Whether an overflow occurs or not partially depends
     on the number of variables in the ring. See trac ticket
-    :trac:`11856`. With Singular 4, it is by default optimized
-    for at least 4 variables on 64-bit and 2 variables on 32-bit,
-    which in both cases makes a maximal default exponent of
-    2^16-1.
+    :trac:`11856`.
 
     EXAMPLES::
 
         sage: P.<x,y> = QQ[]
-        sage: y^(2^16-1)
-        y^65535
-        sage: y^2^16
+        sage: y^(2^30)
+        y^1073741824
+        sage: y^2^32
         Traceback (most recent call last):
         ...
-        OverflowError: exponent overflow (65536)
+        OverflowError: exponent overflow (4294967296)
     """
     if unlikely(e > _ring.bitmask):
         raise OverflowError("exponent overflow (%d)"%(e))
diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py
index 7dc058a22f..71494eddbc 100644
--- a/src/sage/rings/polynomial/multi_polynomial_ideal.py
+++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py
@@ -60,7 +60,7 @@ We compute in a quotient of a polynomial ring over `\ZZ/17\ZZ`::
 Note that the result of a computation is not necessarily reduced::
 
     sage: (a+b)^17
-    256*a*b^16 + 256*b^17
+    a*b^16 + b^17
     sage: S(17) == 0
     True
 
diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
index 4dad016b33..1003c45d97 100644
--- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
+++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
@@ -193,7 +193,7 @@ from sage.libs.singular.decl cimport (
     p_IsUnit, p_IsOne, 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,
+    p_LmIsConstant, pTakeOutComp, singclap_gcd, pp_Mult_qq, p_GetMaxExp,
     pLength, kNF, p_Neg, p_Minus_mm_Mult_qq, p_Plus_mm_Mult_qq,
     pDiff, singclap_resultant, p_Normalize,
     prCopyR, prCopyR_NoSort)
@@ -1587,7 +1587,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_base):
             9/4
 
             sage: P.monomial_quotient(x,y) # Note the wrong result
-            x*y^65535*z^65535
+            x*y^1048575*z^1048575
 
             sage: P.monomial_quotient(x,P(1))
             x
@@ -2247,7 +2247,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
             9/4*x^2 - 1/4*y^2 - y - 1
 
             sage: P.<x,y> = PolynomialRing(QQ,order='lex')
-            sage: (x^2^15) * x^2^15
+            sage: (x^2^32) * x^2^32
             Traceback (most recent call last):
             ...
             OverflowError: exponent overflow (...)
@@ -2371,7 +2371,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
             ValueError: not a 2nd power
 
             sage: P.<x,y> = PolynomialRing(QQ,order='lex')
-            sage: (x+y^2^15)^10
+            sage: (x+y^2^32)^10
             Traceback (most recent call last):
             ....
             OverflowError: exponent overflow (...)
@@ -3452,16 +3452,16 @@ cdef class MPolynomial_libsingular(MPolynomial):
         We are catching overflows::
 
             sage: R.<x,y> = QQ[]
-            sage: n=100; f = x^n
+            sage: n=10000; f = x^n
             sage: try:
             ....:     f.subs(x = x^n)
             ....:     print("no overflow")
             ....: except OverflowError:
             ....:     print("overflow")
-            x^10000
+            x^100000000
             no overflow
 
-            sage: n = 1000
+            sage: n = 100000
             sage: try:
             ....:     f = x^n
             ....:     f.subs(x = x^n)
@@ -4567,7 +4567,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
         l = []
         for i from 0 <= i < IDELEMS(res):
             for j from 1 <= j <= IDELEMS(_I):
-                l.append( new_MP(parent, pTakeOutComp1(&res.m[i], j)) )
+                l.append( new_MP(parent, pTakeOutComp(&res.m[i], 1)) )
 
         id_Delete(&fI, r)
         id_Delete(&_I, r)
@@ -4635,7 +4635,7 @@ cdef class MPolynomial_libsingular(MPolynomial):
 
             sage: f = 3*x
             sage: f.reduce([2*x,y])
-            3*x
+            x
 
         The reduction is not canonical when ``I`` is not a Groebner
         basis::
diff --git a/src/sage/rings/polynomial/plural.pyx b/src/sage/rings/polynomial/plural.pyx
index 1c9f35e56b..587511c388 100644
--- a/src/sage/rings/polynomial/plural.pyx
+++ b/src/sage/rings/polynomial/plural.pyx
@@ -1619,10 +1619,10 @@ cdef class NCPolynomial_plural(RingElement):
             sage: P = A.g_algebra(relations={y*x:-x*y + z},  order='lex')
             sage: P.inject_variables()
             Defining x, z, y
-            sage: (x^2^15) * x^2^15
+            sage: (x^2^31) * x^2^31
             Traceback (most recent call last):
             ...
-            OverflowError: exponent overflow (65536)
+            OverflowError: exponent overflow (2147483648)
         """
         # all currently implemented rings are commutative
         cdef poly *_p
@@ -1689,10 +1689,10 @@ cdef class NCPolynomial_plural(RingElement):
             sage: P = A.g_algebra(relations={y*x:-x*y + z},  order='lex')
             sage: P.inject_variables()
             Defining x, z, y
-            sage: (x+y^2^15)^10
+            sage: (x+y^2^31)^10
             Traceback (most recent call last):
             ....
-            OverflowError: exponent overflow (327680)
+            OverflowError: exponent overflow (2147483648)
         """
         if type(exp) is not Integer:
             try:
diff --git a/src/sage/structure/element.pyx b/src/sage/structure/element.pyx
index b5d83ef71b..f1dc37cad0 100644
--- a/src/sage/structure/element.pyx
+++ b/src/sage/structure/element.pyx
@@ -2705,10 +2705,10 @@ cdef class RingElement(ModuleElement):
         with Singular 4::
 
             sage: K.<x,y> = ZZ[]
-            sage: (x^12345)^54321
+            sage: (x^123456)^654321
             Traceback (most recent call last):
             ...
-            OverflowError: exponent overflow (670592745)
+            OverflowError: exponent overflow (80779853376)
         """
         return arith_generic_power(self, n)