Ticket #9821: trace_9821-replacement.patch

File trace_9821-replacement.patch, 3.5 KB (added by fwclarke, 11 years ago)

replaces previous patch

  • sage/rings/polynomial/infinite_polynomial_ring.py

    # HG changeset patch
    # User Francis Clarke <F.Clarke@Swansea.ac.uk>
    # Date 1283285886 -3600
    # Node ID 190abf64d492cccba5bec07b63b2ac8c852c1650
    # Parent  5b338f2e484f2065d3d30d47bc204d6e9ed13d12
    #9821: fix is_field and is_integral_domain for infinite polynomial rings
    
    diff -r 5b338f2e484f -r 190abf64d492 sage/rings/polynomial/infinite_polynomial_ring.py
    a b  
    11121112        """
    11131113        return False
    11141114
    1115     def is_field(self,**kwds):
    1116         """
    1117         Since Infinite Polynomial Rings must have at least one
    1118         generator, they have infinitely many variables and thus never
    1119         are fields.
    1120 
    1121         TESTS::
    1122 
    1123             sage: R = InfinitePolynomialRing(GF(2))
    1124             sage: R
    1125             Infinite polynomial ring in x over Finite Field of size 2
    1126             sage: R.is_field()
    1127             False
    1128 
    1129         """
    1130         return False
    1131 
    11321115    ## Auxiliary function for variable comparison
    11331116    def varname_cmp(self,x,y):
    11341117        """
     
    12871270        """
    12881271        return self._base.characteristic()
    12891272
    1290     def is_field(self):
     1273    def is_field(self, proof=True):
    12911274        """
    12921275        Return ``False``, since an infinite polynomial ring has at least one
    12931276        generator, hence, infinitely many variables.
     
    13001283        """
    13011284        return False
    13021285
    1303     def is_integral_domain(self):
     1286    def is_integral_domain(self, proof=True):
    13041287        """
    13051288        An infinite polynomial ring is an integral domain if and only if the
    13061289        base ring is.
     
    13101293            sage: R.<x, y> = InfinitePolynomialRing(QQ)
    13111294            sage: R.is_integral_domain()
    13121295            True
     1296
     1297        The proof parameter is passed to the base ring::
     1298
     1299            sage: R.<a, b> = ZZ[]
     1300            sage: InfinitePolynomialRing(R.quo(a)).is_integral_domain()
     1301            Traceback (most recent call last):
     1302            ...
     1303            NotImplementedError
     1304            sage: InfinitePolynomialRing(R.quo(a)).is_integral_domain(proof=False)
     1305            False
    13131306        """
    1314         return self._base.is_integral_domain()
     1307        return self._base.is_integral_domain(proof=proof)
    13151308
    13161309    def is_noetherian(self):
    13171310        """
  • sage/rings/quotient_ring.py

    diff -r 5b338f2e484f -r 190abf64d492 sage/rings/quotient_ring.py
    a b  
    438438        domain, of if Sage is unable to determine the answer.
    439439       
    440440        EXAMPLES::
    441        
    442             sage: R = Integers(8)
    443             sage: R.is_integral_domain()
    444             False
     441            sage: R.<x,y> = QQ[]
     442            sage: R.quo(x^2 - y).is_integral_domain()
     443            True
    445444            sage: R.<a,b,c> = ZZ['a','b','c']
    446445            sage: I = R.ideal(a,b)
    447446            sage: Q = R.quotient_ring(I)
     
    449448            Traceback (most recent call last):
    450449            ...
    451450            NotImplementedError
     451            sage: Q.is_integral_domain(proof=False)
     452            False
    452453        """
    453454        if proof:
    454455            return self.defining_ideal().is_prime()
    455456        else:
    456457            try:
    457                 return self.defining_ideal.is_prime()
     458                return self.defining_ideal().is_prime()
    458459            except AttributeError:
    459460                return False
    460461            except NotImplementedError: