Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

documentation and implementation disagree for BooleanPolynomialRing constructor #23312

Open
sagetrac-msaaltink mannequin opened this issue Jun 22, 2017 · 0 comments
Open

Comments

@sagetrac-msaaltink
Copy link
Mannequin

sagetrac-msaaltink mannequin commented Jun 22, 2017

sage: BooleanPolynomialRing?
Signature:      BooleanPolynomialRing(n=None, names=None, order='lex')
Docstring:     
   Construct a boolean polynomial ring with the following parameters:

   INPUT:

   * "n" -- number of variables (an integer > 1)

   * "names" -- names of ring variables, may be a string or
     list/tuple of strings

   * "order" -- term order (default: lex)

So we need n > 1. And the error message for n=0 agrees:

sage: B = BooleanPolynomialRing(0)
[...]
ValueError: Number of variables must be greater than 1.

However, the implementation allows n=1:

sage: B = BooleanPolynomialRing(1)
sage: B
Boolean PolynomialRing in None

and even negative n:

sage: B = BooleanPolynomialRing(-2)
sage: B
Boolean PolynomialRing in None

The n=1 case appears to work fine, so I do not know why it is called out in the documentation. The 'n<0' cases must be a missing error check in the code.

Component: algebra

Issue created by migration from https://trac.sagemath.org/ticket/23312

@sagetrac-msaaltink sagetrac-msaaltink mannequin added this to the sage-8.0 milestone Jun 22, 2017
@mkoeppe mkoeppe removed this from the sage-8.0 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant