The axiom command: axiom x^1 abc[y]
Type: Fraction(Polynomial(Integer))does not produce any syntax error while axiom x abc[y] does produce an error message. It seems that axiom 1 abc[y]
What is To explain this, you have to understand several syntax conventions in Axiom.
When two expressions are separated by a space, it means "apply" as in
So axiom abc [y]
Type: Symbolaxiom x [1,
Type: SymbolNow if axiom 1 (b::Symbol)
This is the same as axiom elt(1::UP(b,
The results reported above are therefore all obtained by the these rules. The input 'x abc[y]' produces an error because this apply can only take place in UP (the fact that UP has only one variable makes the substitution unambiguous) and although it actually makes sense under suitable domains, the interpreter is not smart enough to find it. axiom (x::UP(x,
and actually, the construction UP(x, POLY INT) is not kosher, but somehow the extra parentheses helped. axiom x::UP(x, Status was changed
by an anonymous user to `closed` without further discussion. Maybe
I would agree with a status of `pending` but I think it would
at least be courteous to identify oneself by clicking `preferences`
before changing a status. That way at least I know who to blame. ;)
Maybe we should make it so that a user id must be specified in order
to click the `Change` button?
Second, it is clear from the original description that it is
" Third most of your "explanation" is quite easy to find in the Axiom book (see page 818) "Univariate polynomials can also be used as if they were functions." but the fact that abc[y]? when appearing in a Type is displayed as
But I am not at all convinced that Axiom should behave in this strange manner. The idea that: 1 x[k] is the unit of the domain of univariate polynomials over the variable x[k]? is extraordinarily obscure and does not seem to have any obvious application to me. Further the fact that: 1 x is not defined (because the type of x is of type * I am not sure whether to blame the interpreter (which is apparently
only following a fairly well defined search strategy) or perhaps better
to blame the implementation of UnivariatePolynomial for allowing this
form of abbreviated [#99 x^1 abc[y]? should be a syntax error] annoying --William Sit, Thu, 17 Feb 2005 19:19:21 -0600 reply
Sorry, Bill. I was too hasty in closing it. But I don't see why anyone should be "annoyed". If you don't think it is right, just change it back to "open". Isn't that the reason for Wiki? - By the way, I did look all over to find where to login
- I advocated that --but
putting it under "preference" does not ring a bell (neither would "user
options"). Login and setting preferences are two distinct functions that should
not be put under one button. Preferences should be set once when one registers,
but login should done each time.
Second, it was clear from the original description that it is `not a syntax error` . The bug report said:**should be**a syntax error. So maybe you mean`should not be a syntax error` ?
Third most of your "explanation" is quite easy to find in the Axiom book (see page 818) "Univariate polynomials can also be used as if they were functions." I was at first very puzzled by how the outputs in the original post are obtained. Perhaps if whoever posted it knew how the outputs came about, that should be included in the post so others do not have to waste time figuring that out. I interpreted the heading (ok wrongly) as some of the expressions have syntax error. I figured that they do not. Rather, it is the inability of the interpreter to coerce some parameters to the "correct" type and find a reasonable signature. But this is nothing new and short of analyzing the interpreter code to make it even smarter, what can we do in the meantime? That is why I thought "case closed". but the fact that abd[y]? when appearing in a Type is displayed as I disagree with your objection to On the otherhand, one can use easily axiom t:=1 x[y[z]]
axiom dom:=typeOf t
Type: Typeaxiom h:dom:=monomial(2,
In fact, precisely because Axiom wants to preserve this structural information on the variable that it outputs it this way! Had it used a two dimensional method, it would not be able recapture the type information.
You must have a pretty bad day? (three "blame" words in one message? :-) I agree 100% with you that one should distinguish polynomials or expressions
from functions. But that is on the mathematics or theory level. In computing, we
need to be able to make substitutions (compose if you like under certain cases)
into the polynomials or expressions -- even if you use eval, you are still
considering the polynomials as functions While it may be unintuitive why anyone would perform an operation like The interpreter succeeds in seemingly more complicated The Wiki pages are supposed to be for experts as well as for novices. When simple input like this causes some apparent problem that is "unexpected", we should explain it. For some this may sound trivial, but for others, it may not. William axiom )clear all Today I felt like taking what I think might be the point of view of a new user of Axiom. I agree completely that the Wiki pages are supposed to be for experts as well as for novices and when simple input like this causes some apparent problem that is "unexpected", that we should explain it. I think you did a good job of that. But in my opinion the explanation is rather bizarre (especially from the point of view of a new user). So this is were the experts come in: How can we make Axiom's behaviour less bizarre to new users? I originally saw this behaviour in an simple test in the SandBox where a new user wrote something like this axiom integrate(z^2 ln[z],
Type: Union(Expression(Integer),I was quite sure that what they intended to compute was axiom integrate(z^2*log(z),
Type: Union(Expression(Integer),but I had a hard time understanding the original answer and I wondered why Axiom did not at least produce some kind of syntax error. About the status: Perhaps I was too direct in using the word "annoyed" since I am well aware that it is very hard to correctly interpret other peoples' motives and emotional state when reading what they wrote alone. I was annoyed :) but if you had seen me in person you would have noticed that I also smiled when I said that. Of course I used the word "blame" in the same way. I did not mean it to sound like I was "finding fault" with anyone, only that I wanted to identify what might be changed to make Axiom's behaviour more intuitive. About 'preferences': It seems that "wiki people" generally would
like to avoid any perceived "login barrier". Setting preferences
is just a matter of saying how you would like to be identified
(and a few other details) - it is not supposed to be like
"logging in". And you are right that in principle this only
needs to be done once. Setting preferences sends some cookies
to your browser which, depending on whether you have set your
browser security to permit it or not, will allow the system
to remember your preferences the next time you connect to the
wiki. But maybe you are right that there might be a better
label than About the use of axiom 1 t[x,
but I still don't see why, if there is a need for some linear syntax, there would be any objection to using the same syntax as the input. Surely: Type: UnivariatePolynomial(t[x,y,z], Integer) would be self explanatory, no? About functions and expressions. There is no problem making substitutions into polynomials like this: axiom subst((1+b^2)::UP(b,
or even this axiom subst((1+c*b^2)::MPOLY([b,
We can also explicitly use Finally, could you explain further your reasoning about why the
interpreter should not coerce Or is it the case that the interpreter never tries harder than just one coercion? BTW, I tried specifying axiom )expose Variable but I did not see any change in Axiom's behaviour. axiom 1 x --------- Bill Page - Bill Page wrote:
**[#99 x^1 abc[y]? should be a syntax error] badday? not really :)**--William Sit, Mon, 21 Feb 2005 01:30:46 -0600 reply - Today I felt like taking what I think might be the point of view of a new user of Axiom. I agree completely that the Wiki pages are supposed to be for experts as well as for novices and when simple input like this causes some apparent problem that is "unexpected", that we should explain it. I think you did a good job of that. But in my opinion the explanation is rather bizarre (especially from the point of view of a new user). So this is were the experts come in: How can we make Axiom's behaviour less bizarre to new users?
This is a tall order even though I would agree that such bizarre results may drive many away.
I originally saw this behaviour in an simple test in the SandBox where a new user wrote something like this A new user has to learn the basic operations and syntax. The above user may be used to Mathematica and Maple or just simply use intuition. I have the same experience myself: I am used to Mathematica and I can't stand the syntax and especially the worksheet interface of Maple (my prejudice). I made so many mistakes and got frustrated every time. But this is not to say Maple is not great for a lot of other people. I was quite sure that what they intended to compute was I did not find it easy either. Just because it can be explained does not mean the problem is not there. On the other hand, Axiom was designed for mathematicians and perhaps there is some assumption built in that the users would follow the rules and would realize what their mistakes are. This "apply" notion permeates all levels of Axiom and I believe it would be impossible to modify it without causing a lot of other failures, creating more problems. About the status: Agreed. I will not close any discussion from now on. One cannot foresee the implications sometimes when the examples illustrating the bugs are already traced to such a low level. I decided to close it because the example x^1 abc[y]? was clearly artificial; had I seen this one on integration, I probably wouldn't have. Perhaps in addition to a pin-point example, there should also be the other examples on a more complex level to illustrate the implications. For example, I would classify the problem with '1 x[y]?' as not a severe problem, but 'integrate(z^2 ln[z]?, z)' as severe, even though the cause is the same. And the two should be combined into one page, may be with a heading: Beware of Functional Applications. Perhaps I was too direct in using the word "annoyed" since I am well aware that it is very hard to correctly interpret other peoples' motives and emotional state when reading what they wrote alone. I was annoyed :) but if you had seen me in person you would have noticed that I also smiled when I said that. Of course I used the word "blame" in the same way. I did not mean it to sound like I was "finding fault" with anyone, only that I wanted to identify what might be changed to make Axiom's behaviour more intuitive. While this is a worthwhile goal, it may be too late in the game because these issues should have been resolved from the moment the system was designed. The interpreter is already quite different from the compiler in its handling of user input. Increasing its user friendliness will only make it even harder to learn to use the compiler, especially if the grammar is changed. Right now, I think all the interpreter does is performing coercions, lifting domains, and matching signatures. I don't believe you would get any of these problems with a compiled package because one is forced by the compiler to know exactly what one is computing. So if the "behavior" of Axiom is to be changed, one has to rewrite the interpreter, making Axiom even more different than the compiler version. It is probably easier to change user behavior :-). I remember how new students
using Mathematica forget to start the trig functions (or any built-in function)
with a capital letter and enter On the other hand, I think no software system can stand a deliberate scrutiny on all possible input errors (not to mention those that are syntactically correct but with wishful semantics). It is similar to anticipating all student errors in mathematics or their wishful laws on algebraic operations. We can't and instead we teach students the correct ways. I recommend strongly that when users find "strange behavior" in the interpreter
version that they try to analyse it by using About 'preferences': It seems that "wiki people" generally would like to avoid any perceived "login barrier". Setting preferences is just a matter of saying how you would like to be identified (and a few other details) - it is not supposed to be like "logging in". And you are right that in principle this only needs to be done once. Setting preferences sends some cookies to your browser which, depending on whether you have set your browser security to permit it or not, will allow the system to remember your preferences the next time you connect to the wiki. But maybe you are right that there might be a better label than That sounds like a better label. May be "Who Are You"? "whoami" is a Unix command for a different purpose. But of course, I know now where to do it. For new comers, that would certainly help. About the use of I suppose, I was only guessing at some logic behind this "design". And actually Axiom does use your suggested notation too (indeed, mixed), and so it is again not that consistent. axiom integrate(z^2*x[z],
Type: Polynomial(Fraction(Integer))axiom 1 x[%]
Here in the Type message, x(z) is used instead of *01x z. You will see Axiom
tries very hard to work out the type of the last one if you had
Univariate polynomials are just like finite sequences (streams would be infinite
sequences) and all are just functions in the sense the domain is the set of
indices (subscripts, exponents or more complicated scripting at times). Axiom is
just treating them uniformly. In using axiom )clear all
Type: Expression(Integer)axiom subst(1+c(b^2), whereas in Mathematica, Finally, could you explain further your reasoning about why the interpreter should not coerce Nope, because I was wrong! I thought it might create an infinite mutual coercion, but that is apparently not the case. I don't have any documentation on the interpreter. Like what physicists practice, the theory must follow the experiments and will change when new evidence shows up. So I now find out a situation where the interpreter actually does the coercion from Variable(x) to Symbol. (So my previous statement that claim the interpreter does not do this conversion in my last message is wrong -- I was misguided by the hyperdoc documentation that the convert and variable functions are unexposed, even if Variable() is). ## See IssueTracker #110.
Or is it the case that the interpreter never tries harder than just one coercion? No, the interpreter tries very hard sometimes. See above symbol with a complicated subscript. BTW, I tried specifying I don't know. According to hyperdoc, even if Variable() is exposed, the two operations convert and variable are still unexposed. But I now do not think that is the problem. Apparently, the interpreter is able to use them when it wants to. --------- Bill Page -- forwarded from "99X1AbcYShouldBeASyntaxError#msg20050217221454-0600@page.axiom-developer.org:99X1AbcYShouldBeASyntaxError#msg20050217221454-0600@page.axiom-developer.org William |

Not a syntax error