4 ms·
The information on the pretty website is spare. However, there are a few issues which give me pause. The integral example already given is one. One must wond
by clintonc 12y ago
The information on the pretty website is spare. However, there are a few issues which give me pause.
The integral example already given is one. One must wonder what is going on "under the hood" to give such a result. My hypothesis is that Riemann sums are what's going on, and that the integral uses 0 as a sample point. An interesting point is that this is one of the unit tests. https://github.com/gogotanaka/Hilbert/blob/master/test/interpreter/test_integral.rb#L9 https://github.com/gogotanaka/Hilbert/blob/master/test/inter...
Another is the example of lim[x->0] 1/x => oo. This is not true; the limit does not exist. If one said lim[x->0+] => oo there would be a better case. Also a unit test. https://github.com/gogotanaka/Hilbert/blob/master/test/interpreter/test_limit.rb#L11 https://github.com/gogotanaka/Hilbert/blob/master/test/inter...
(1 2 3; 4 5 6) * (1 2 3) => (14 32) is not how matrix multiplication is normally done. ( (1 2 3) would need to be (1; 2; 3).)
All in all, the grammar seems to be quite irregular; it seems to be the result of a sequence of wanting to solve one very particular kind of problem (take a limit, differentiate a function, take a sum) and cludging it into the parser.
https://github.com/gogotanaka/Hilbert/blob/master/lib/hilbert/world.rb#L50 https://github.com/gogotanaka/Hilbert/blob/master/lib/hilber... has seven exclamation marks in a row. That's amusing... I don't know anything about Ruby, but I feel that it must be a joke.
- gus_massa 12y agolim[x->0] 1/x => oo This is one of the grey areas of the mathematical notation. When you are teaching this, you should confirm that the other teachers are using the same notation. I usually use oo as "I don't care about the sign infinity", so with the notation I use this is correct. For the positive infinity I use +oo and for the negative infinity I use -oo. So lim[x->0+] => +oo lim[x->0-] => -oo Nevertheless, I don't know if the difference between oo, +oo and -oo is implemented in this language.
- jackmaney 12y agoCan you point to a single reference anywhere dealing with calculus on the reals that is lazy enough to use infinity as "meh, I don't care if it's positive or negative infinity"? Even one? I've never seen it, and I've taught calculus to college students for nine years.
- pfortuny 12y agoOn the limit issue: you are assuming the x is real. In the complex domain inf has no sign and the limit is pretty correct. But yes, this depends on assumptions.
- jackmaney 12y agoThis is a possible loophole, yes. However, if the repo author intended to work with functions of a complex variable, then why aren't the integrals in the README contour integrals?