CAS command question
|
01-14-2017, 12:25 PM
Post: #92
|
|||
|
|||
RE: CAS command question
I don't understand your explanations, remember I'm not a native English speaker.
To clarify, there is no concept of relation or predicate or whatever in the CAS, just expressions (1+x is an expression like x>2 like sin(x+1) or like 1+(x>2)). Expressions have a rootnode and argument(s) (0, 1 or several, in the last case they are grouped in one argument of type vector and subtype sequence), each argument being either atomic (like integer or floats or fractions or variable names or even CAS commands) or themselve expressions. The rootnode of an expression is a CAS command, there is no difference between +, > or left or any CAS command. All CAS command are functions taking 0, 1 or several arguments and returning one value. Therefore x<2 is just an expression, and it is rewritten by evaluation to the equivalent expression 2>x. left() works on expression and follows the normal rule of evaluation. The members of the initial predicate/relation/whatever you call what you entered may be reversed because of evaluation, but you do not have to check for < or <= because they will never happen after evaluation, that's why I say that programming with evaluated expressions is not harder. But if you are programming with CAS expressions, you must take in account how the CAS was designed. You might think the CAS is wrong designed because it does not correspond to your expectations, but you can not expect that I will redesign the CAS (17 years of work) just because you want left and right to match your expectations for arguments that are not supported in the documentation. So left(x<2) returning 2 is *definitively not* a bug. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)