Message Boards Message Boards

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

How do I make a Symbol Positive?

Posted 10 years ago

Hi, I want to make a Symbol, i.e. A, such that A>0 will return True. Of course, I want

  1. Positive[A] to return True, and
  2. Less[0,A] to return True,
  3. and so on, and so on.

There are a very large number of relations that could be tested and I want to make every one of them return the appropriate True or False depending upon the logical relationship. Trying to set up the upvalues of A for all relationships is mind-boggling. I can't even start to think of every one that could occur. I can't find any documentation on the Web when Google'ing Mathematica "Positive Symbol" or without quotes that is worth anything. Noting on the Wolfram site search and nothing here.

Are there any developers listening who must have dealt with this issue in the internals of MMA? How do I go about this? It seems like a reasonable request, or am I missing something really fundamental that would make this easy?

Thanks in advance/Cheers/Bob

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