Perhaps it has something to do with solve not taking into account that
Le() and friends evaluate themselves to a boolean in trivial cases:

In [1]: Le(3,4)
Out[1]: True

But the only way to really know for sure is to debug the code.

By the way, there's been some debate before on whether or not it is a
good idea for Le() to be doing this, so maybe now a working
implementation of an inequality solve can shed some more light on the
matter.

Aaron Meurer

On Wed, Nov 24, 2010 at 3:12 AM, Filip Dominec <filip.domi...@gmail.com> wrote:
> I am working on a new solve() routine to fix the issue discussed in my
> previous post.
>
> However, I observed a bug (?) that sticks deep in the code. I am using
> the "git clone https://matt...@github.com/mattpap/sympy-polys.git; cd
> sympy-polys ; git checkout polys11" version.
>
>
>
>
> In [388]: solve([Le(3,0), Assume(x,Q.real)],x,relational=False)
> Out[388]: False
>
> In [389]: solve([Le(3,4), Assume(x,Q.real)],x,relational=False)
> ---------------------------------------------------------------------------
> UnboundLocalError                         Traceback (most recent call
> last)
>
> /home/filip/<ipython console> in <module>()
>
> /home/filip/bin/sympy101118/sympy-polys/sympy/solvers/solvers.pyc in
> solve(f, *symbols, **flags)
>    153
>    154     if any(isinstance(fi, bool) or (fi.is_Relational and not
> fi.is_Equality) for fi in f):
> --> 155         return solve_poly_inequalities(f,
> relational=relational)
>    156
>    157     for i, fi in enumerate(f):
>
> /home/filip/bin/sympy101118/sympy-polys/sympy/solvers/inequalities.pyc
> in solve_poly_inequalities(inequalities, relational)
>    152         results[gen] = result
>    153
> --> 154     if relational or not real:
>    155         solution = And(*results.values())
>    156     else:
>
> UnboundLocalError: local variable 'real' referenced before assignment
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To post to this group, send email to sy...@googlegroups.com.
> To unsubscribe from this group, send email to 
> sympy+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/sympy?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sy...@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to