# Revision history [back]

### Sage not detecting intergers in Boolean Polynomial Ring?

Hi all,

I'm trying to do a detecting system for terms in the equations used in a polynomial. I'm using Boolean Polynomials here.

Here's is my code. This prints all the terms of the equations.

P.<x,y,z> = BooleanPolynomialRing(3, order = 'lex')
equations = [x+y+z-1, y*z, x+z]
for i in range(len(equations)):
for j in equations[i]:
print j

Output:
x
y
z
1
y*z
x
z


As you can see, 1 appears in the output. However, when I implement this logic onto it, the output is empty.

for i in range(len(equations)):
for j in equations[i]:
if j == 1:
print 'true'


It's not like the logic doesn't work, if I change '1' to 'x', my logic works.

for i in range(len(equations)):
for j in equations[i]:
if j == x:
print 'true'

Output:
true
true


What am I doing wrong here?

### Sage not detecting intergers in Boolean Polynomial Ring?

Hi all,

I'm trying to do a detecting system for terms in the equations used in a polynomial. I'm using Boolean Polynomials here.

Here's is my code. This prints all the terms of the equations.

P.<x,y,z> = BooleanPolynomialRing(3, order = 'lex')
equations = [x+y+z-1, y*z, x+z]
for i in range(len(equations)):
for j in equations[i]:
print j

Output:
x
y
z
1
y*z
x
z


As you can see, 1 appears in the output. However, when I implement this logic onto it, the output is empty.

for i in range(len(equations)):
for j in equations[i]:
if j == 1:
print 'true'


It's not like the logic doesn't work, if I change '1' to 'x', my logic works.

for i in range(len(equations)):
for j in equations[i]:
if j == x:
print 'true'

Output:
true
true


What am I doing wrong here?

 3 retagged tmonteil 22218 ●25 ●158 ●409 http://wiki.sagemath.o...

### Sage not detecting intergers in Boolean Polynomial Ring?

Hi all,

I'm trying to do a detecting system for terms in the equations used in a polynomial. I'm using Boolean Polynomials here.

Here's is my code. This prints all the terms of the equations.

P.<x,y,z> = BooleanPolynomialRing(3, order = 'lex')
equations = [x+y+z-1, y*z, x+z]
for i in range(len(equations)):
for j in equations[i]:
print j

Output:
x
y
z
1
y*z
x
z


As you can see, 1 appears in the output. However, when I implement this logic onto it, the output is empty.

for i in range(len(equations)):
for j in equations[i]:
if j == 1:
print 'true'


It's not like the logic doesn't work, if I change '1' to 'x', my logic works.

for i in range(len(equations)):
for j in equations[i]:
if j == x:
print 'true'

Output:
true
true


What am I doing wrong here?

 4 retagged FrédéricC 2919 ●3 ●31 ●58

### Sage not detecting intergers in Boolean Polynomial Ring?

Hi all,

I'm trying to do a detecting system for terms in the equations used in a polynomial. I'm using Boolean Polynomials here.

Here's is my code. This prints all the terms of the equations.

P.<x,y,z> = BooleanPolynomialRing(3, order = 'lex')
equations = [x+y+z-1, y*z, x+z]
for i in range(len(equations)):
for j in equations[i]:
print j

Output:
x
y
z
1
y*z
x
z


As you can see, 1 appears in the output. However, when I implement this logic onto it, the output is empty.

for i in range(len(equations)):
for j in equations[i]:
if j == 1:
print 'true'


It's not like the logic doesn't work, if I change '1' to 'x', my logic works.

for i in range(len(equations)):
for j in equations[i]:
if j == x:
print 'true'

Output:
true
true


What am I doing wrong here?

 5 None FrédéricC 2919 ●3 ●31 ●58

### Sage not detecting intergers in Boolean Polynomial Ring?

Hi all,

I'm trying to do a detecting system for terms in the equations used in a polynomial. I'm using Boolean Polynomials here.

Here's is my code. This prints all the terms of the equations.

P.<x,y,z> = BooleanPolynomialRing(3, order = 'lex')
equations = [x+y+z-1, y*z, x+z]
for i in range(len(equations)):
for j in equations[i]:
print j

Output:
x
y
z
1
y*z
x
z


As you can see, 1 appears in the output. However, when I implement this logic onto it, the output is empty.

for i in range(len(equations)):
for j in equations[i]:
if j == 1:
print 'true'


It's not like the logic doesn't work, if I change '1' to 'x', my logic works.

for i in range(len(equations)):
for j in equations[i]:
if j == x:
print 'true'

Output:
true
true


What am I doing wrong here?