On Jul 27, 2009, at 2:50 AM, Vinzent Steinberg wrote:

>
> 2009/7/26 Aaron S. Meurer <asmeu...@gmail.com>:
>> It looks like they are:
>>  >>> Assume(integer=False, odd=True)
>> Traceback (most recent call last):
>>   File "<console>", line 1, in <module>
>>   File "./sympy/core/basic.py", line 305, in __new__
>>     obj._learn_new_facts(assumptions)
>>   File "./sympy/core/assumptions.py", line 336, in _learn_new_facts
>>     self._assume_rules.deduce_all_facts(facts, base)
>>   File "./sympy/core/facts.py", line 882, in deduce_all_facts
>>     assert new_facts[k] == v, ('inconsitency between
>> facts',new_facts,k,v)
>> AssertionError: ('inconsitency between facts', {'nonzero': True,
>> 'even': False, 'composite': False, 'prime': False, 'zero': False,
>> 'integer': False, 'odd': False}, 'odd', True)
>
> I meant the documentation. What do you think, should
>
>>>> Assume(x, integer=True, positive=True)
>
> raise an exception or should it return
>
> Assume(x, integer=True) & Assume(x, positive=True)?
>
>
> Vinzent

I see what you mean:

 >>> Assume(x, integer=True, positive=True)Traceback (most recent call  
last):
   File "<console>", line 1, in <module>
   File "./sympy/assumptions/__init__.py", line 55, in __init__
     raise ValueError('Wrong set of arguments')
ValueError: Wrong set of arguments

I think we should assume the and operator for multiple keyword  
arguments.  At any rate, I think "Wrong set of arguments" does not  
explain clearly enough what the error was.

I had been working under the assumption that multiple arguments worked  
like they do in the current assumptions system with my above example.   
Trying Assume(x, integer=False) & Assume(x, odd=True) just returns  
And(Assume(x, integer=False), Assume(x, odd=True)).

and Assume(x, integer=True, odd=True) just raises the same exception  
as the example you give.

Is there supposed to be a function or method to reduce something like  
And(Assume(x, integer=False), Assume(x, odd=True)) to an inconsistency  
or something like And(Assume(x, integer=True), Assume(x, odd=False))  
to Assume(x, even=True)?  I couldn't find one.

Aaron Meurer

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

Reply via email to