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

BooleanPolynomial.variables() consider "1" as a variable #13104

Closed
sagetrac-Bouillaguet mannequin opened this issue Jun 11, 2012 · 8 comments
Closed

BooleanPolynomial.variables() consider "1" as a variable #13104

sagetrac-Bouillaguet mannequin opened this issue Jun 11, 2012 · 8 comments

Comments

@sagetrac-Bouillaguet
Copy link
Mannequin

sagetrac-Bouillaguet mannequin commented Jun 11, 2012

This is in contradiction with other functions (BooleanPolynomial.nvariables), and with the behavior of the "normal" class MPolynomial.

Example:

sage: R.<x,y,z> = BooleanPolynomialRing()
sage: p = R(1)
sage: p.variables()
(1,)
sage: p.nvariables()
0

Which differs from:

sage: R.<x,y,z> = GF(2)[]
sage: p = R(1)
sage: p.variables()
()
sage: p.nvariables()
0

CC: @malb @alexanderdreyer @sagetrac-PolyBoRi

Component: commutative algebra

Keywords: BooleanPolynomial

Author: Charles Bouillaguet

Reviewer: Alexander Dreyer, Martin Albrecht

Merged: sage-5.1.beta6

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

@sagetrac-Bouillaguet sagetrac-Bouillaguet mannequin added this to the sage-5.1 milestone Jun 11, 2012
@sagetrac-Bouillaguet
Copy link
Mannequin Author

sagetrac-Bouillaguet mannequin commented Jun 11, 2012

Attachment: pbori_variables.patch.gz

patch that fixes the problem

@malb
Copy link
Member

malb commented Jun 11, 2012

comment:2

Hi, can you add a doctest that shows that the issue is resolved? I also CCed the PolyBoRi developers to make sure there isn't some obscure reason for this behaviour.

@sagetrac-Bouillaguet
Copy link
Mannequin Author

sagetrac-Bouillaguet mannequin commented Jun 11, 2012

comment:3

Hi,

I actually did, in fact. I modified the existing docstring to verify that:

sage: P.one_element().variables()  
()

Should I add anything else?

@malb
Copy link
Member

malb commented Jun 11, 2012

comment:4

Sorry, my bad!

@alexanderdreyer
Copy link
Mannequin

alexanderdreyer mannequin commented Jun 11, 2012

comment:5

p.variables() is a Sage extension (see #1715), the corresponding p.vars_as_monomial() () already behaves like this. (I think in early versions of PolyBoRi p.vars_as_monomial() could become 0, but this was a design error.) So I can clearly give a positive review.

@malb
Copy link
Member

malb commented Jun 11, 2012

Author: Charles Bouillaguet

@malb
Copy link
Member

malb commented Jun 11, 2012

Reviewer: Alexander Dreyer, Martin Albrecht

@jdemeyer
Copy link

Merged: sage-5.1.beta6

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

2 participants