Re: Issue 1894 in sympy: Xor(x, 1/y) doesn't work

2010-05-20 Thread sympy
Comment #5 on issue 1894 by asmeurer: Xor(x, 1/y) doesn't work http://code.google.com/p/sympy/issues/detail?id=1894 I agree with Mateusz about the automatic rewriting. And(True, False) turning into False and even And(x, y) turning into And(y, x) is fine. But I think that Implies(x, y)

Re: Issue 1894 in sympy: Xor(x, 1/y) doesn't work

2010-04-11 Thread sympy
Comment #3 on issue 1894 by mattpap: Xor(x, 1/y) doesn't work http://code.google.com/p/sympy/issues/detail?id=1894 how do you compute 1/True and 1/False? In [1]: 1/True Out[1]: 1.0 In [2]: 1/False ZeroDivisionError: float division I just expect this two inputs should give the same result:

Re: Issue 1894 in sympy: Xor(x, 1/y) doesn't work

2010-04-11 Thread sympy
Comment #4 on issue 1894 by ronan.l...@gmail.com: Xor(x, 1/y) doesn't work http://code.google.com/p/sympy/issues/detail?id=1894 The same operator can have different meanings depending on the context. In '1 2', '' means bitwise-and, not boolean-and as in 'x y'. In contrast, 'And' can only

Issue 1894 in sympy: Xor(x, 1/y) doesn't work

2010-04-09 Thread sympy
Status: New Owner: Labels: Type-Defect Priority-Medium Logic Milestone-Release0.7.0 New issue 1894 by mattpap: Xor(x, 1/y) doesn't work http://code.google.com/p/sympy/issues/detail?id=1894 In [6]: Xor(x, 1/y) ---

Re: Issue 1894 in sympy: Xor(x, 1/y) doesn't work

2010-04-09 Thread sympy
Comment #1 on issue 1894 by mattpap: Xor(x, 1/y) doesn't work http://code.google.com/p/sympy/issues/detail?id=1894 I encountered this when working on pretty printers for logic operators, e.g.: In [1]: Equivalent(Implies(Or(Not(x), y, z), And(x, 1/y)), Ne(x, y)) Out[1]: ⎛

Re: Issue 1894 in sympy: Xor(x, 1/y) doesn't work

2010-04-09 Thread sympy
Comment #2 on issue 1894 by ronan.l...@gmail.com: Xor(x, 1/y) doesn't work http://code.google.com/p/sympy/issues/detail?id=1894 The problem with Xor(x, 1/y) is that its meaning is undefined: how do you compute 1/True and 1/False? Nevertheless, And(x, 1/y) works, so this should too. All that