Hi All,

Newbie issue.

I'm new to Sage but was messing about with Westers logical inference
problem ( x>=y, y>=z, z>=z) and then using == and = by itself in the
bool function. I've simplified the logic and isolated what I believe
to be an error in behavior, perhaps designed but ought to be warned
against. I found no warning.

The function bool seems to always generate true when constructed as
"print bool( x= some variable)". Perhaps it is the global variable
usage. My work around is not to use the variable x within logical
constructs. It may or may not relate to the equivalence problem in
Wester.

sage: var('a, b, c, x, y, z')
(a, b, c, x, y, z)
sage: forget()
sage: assumptions()
[]
sage: assume (a<b, b<c, c<x, x<y, y<z)
sage: assumptions()
[a < b, b < c, c < x, x < y, y < z]
sage: print bool( a<x)
True
sage: print bool(x=a)
True
sage: print bool(a=x)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call
last)

/Users/Mike/<ipython console> in <module>()

TypeError: 'a' is an invalid keyword argument for this function
sage: print bool(a<b)
True
sage: print bool(a=b)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call
last)

/Users/Mike/<ipython console> in <module>()

TypeError: 'a' is an invalid keyword argument for this function
sage: print bool(x>b)
True
sage: print bool(b<x)
True
sage: print bool( x=b)
True
sage: print bool(x=y)
True
sage: print bool(x=z)
True
sage: print bool(x<y)
True
sage: print bool(x<z)
True
sage: print bool(z>x)
True
sage: print bool(y>x)
True
sage: assumptions()
[a < b, b < c, c < x, x < y, y < z]
sage: print bool(y=x)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call
last)

/Users/Mike/<ipython console> in <module>()

TypeError: 'y' is an invalid keyword argument for this function
sage: print bool(z=x)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call
last)

/Users/Mike/<ipython console> in <module>()

TypeError: 'z' is an invalid keyword argument for this function
sage:

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to