Message Boards Message Boards

0
|
5087 Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

How do I make a Symbol Positive?

Posted 10 years ago
POSTED BY: bob Korsan
4 Replies
Posted 10 years ago
POSTED BY: bob Korsan
Posted 10 years ago

I am not exactly sure of whether this will work for your purposes:

Refine[Positive[A], Assumptions -> {Element[A, real], A > 0}]

True

Refine[Negative[A], Assumptions -> {Element[A, real], A > 0}]

False

POSTED BY: Priyan Fernando
Posted 10 years ago

No, you completely misunderstand. I want to tell MMA that this Symbol (whatever it is) should be treated in all Logical tests as say a Positive, Real number. So, A>0 should return True, A>=0 should return False, Positive[A] should return True, Negative[A] should return False, etc for any and all possible tests that are syntactically correct logical statements that evaluate. Now, sometimes, e.g. 0<B<A will depend upon whether B has a value, upvalue, downvalue, etc. but I want MMA to infer that if A has an upvalue of Positive[A]=True, then every other relationship which is equivalent to this, such as Head[A] should return OR[Real,Integer,Rational], not Symbol.

Hope this helps. Cheers/Bob

POSTED BY: bob Korsan
Posted 10 years ago

Perhaps you can using something like: FindInstance[A > 5 && 0 < A, A]

This gives 6, one instance.

POSTED BY: Priyan Fernando
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract