Post Reply 
Peculiar precedence
12-22-2015, 05:53 PM
Post: #5
RE: Peculiar precedence
I think it's probably impossible to have a bison/flex parser that correspond to what user expects (I mean if users do not read the documentation). For example look at
f(x+1)^2
x(x+1)^2
In the first example, you expect (f(x+1))^2 not f((x+1)^2). In the second example, x is almost certainly not a function because you apply it to something depending on x, and you would expect x*(x+1)^2. The precedence is not the same, but at parse time, f and x are both symbols, it is impossible for the grammar to make a difference. Therefore one must choose f(x+1)^2 precedence, because f() is the standard notation for a function, while x(x+1) is (non-standard) implicit multiplication.
Now, a highschool targetted CAS like the tinspire CAS has probably a homemade parser that applies a lot of special rules for implicit multiplication ... but on the other hand, the nspire CAS is not functional, you can not pass a function as argument to another function (the same is also true on the Prime in Home).
There is a learning curve to use a general purpose CAS like Giac. The first thing you should know is that implicit multiplication is not supported, except for the few shortcuts I recalled in my last post. The Xcas UI will give you a warning if you enter something like x(x+1)^2, I don't know why it's not displayed on the Prime, I think it would make things less confusing.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Peculiar precedence - cdecastro - 12-16-2015, 01:00 PM
RE: Peculiar precedence - parisse - 12-21-2015, 04:21 PM
RE: Peculiar precedence - cdecastro - 12-22-2015, 01:26 PM
RE: Peculiar precedence - Marcel - 12-22-2015, 02:34 PM
RE: Peculiar precedence - parisse - 12-22-2015 05:53 PM
RE: Peculiar precedence - cdecastro - 12-22-2015, 06:37 PM
RE: Peculiar precedence - parisse - 12-23-2015, 07:18 AM



User(s) browsing this thread: 2 Guest(s)