newRPL - build 1255 released! [updated to 1299]
07-30-2019, 07:13 PM (This post was last modified: 07-30-2019 07:20 PM by JoJo1973.)
Post: #540
 JoJo1973 Member Posts: 104 Joined: Apr 2016
RE: newRPL - build 1255 released! [updated to 1282]
(07-30-2019 05:14 PM)Claudio L. Wrote:  I like it, let's say we use a string because it's easier to compare.
The string could be:
1 character for type (and parity): "R"=real, "I","O","E"=Integer/Odd/Even, "C"=complex, "M"=matrix, "?"=unknown (internal), "*"= No information given about this variable, it would remove all assumptions on the variable.
1 (optional) character for infinity bit: "∞" is present only if the variable can be infinite or NaN, otherwise is known to be finite.
2 (optional) characters related to sign: "≥0", "≠0", etc.

Noticed I merged the parity with the type information to make it more readable: A positive integer would be:
"I>0" (being an integer already implies it's a real number, so no need for a separate letter).
"C∞≠0" (a complex number that can be infinite but is known not to be zero)
"E∞≥0" (a positive even integer, counting from zero all the way up to infinity)

I think this will work!
Commands needed:
ASSUME to apply this to a variable in an expression
ASSGET to extract the assumptions made for a certain variable within an expression.
ASSCOMB to get the combined assumptions for a whole expression
ASSCMP to compare if a given assumption meets certain other assumptions (using the fancy text string).

For example you could do 'X^2' ASSCOMB (combine assumptions) and should return "R≥0" if X has default assumptions (when complex mode is disabled, default assumption is that variables are real and finite).
Then you could also check that result against some restrictions:
"R≥0" "R" ASSCMP would return true, since a real >=0 meets the minimum requirement of being a real.

I'm doing devil's advocate:

How would ASSCOMB work for more complicated expressions? For example if X is "R>=0" and Y is "O∞<0" then 'Y^2+SIN(X)' ASSCOMB gives what? I suppose there's an algorithmic way to solve this, but this would mean that internally each built-in function must provide its domain to the rules engine, not to mention the fact that some operations between sets are possible only in a certain order (matrix divided by scalar it's possible, scalar divided by matrix isn't)

Exciting feature, anyway!

P.S.: Using "Z" rather than "I" would be classy! « Next Oldest | Next Newest »