From: Eduardo O. <edu...@gm...> - 2022-01-13 04:48:24
|
Hi Richard and Stavros, I made some progress on the questions that I asked here, https://sourceforge.net/p/maxima/mailman/message/37415334/ https://sourceforge.net/p/maxima/mailman/message/37415708/ but I need to ask more questions, and I felt that it was better to create a new thread. I am reading about expressions, simplification, evaluation, and the internal representation mainly in these places: (info "(maxima)Expressions") (info "(maxima)Evaluation") (info "(maxima)Simplification") (info "(maxima)Lisp and Maxima") https://people.eecs.berkeley.edu/~fateman/papers/intro5.txt The first two sentences of (info "(maxima)Introduction to Simplification") are: Maxima performs a cycle of actions in response to each new user-typed command. This consists of four steps: reading or "parsing" the input, evaluation, simplification and output. I am still in a stage in which the rules for evaluation and simplification feel overwhelming, so I'm trying to understand parsing, evaluation, simplification, and output separately... The second part of https://people.eecs.berkeley.edu/~fateman/papers/intro5.txt has a table with "Input String"s in the left column and "Parser Output"s in the right column. The most obvious - and naïve - way to transform that table into a series of executable examples/tests is to wrap each "Input String" in a ":lisp #$___$"; I found that if I run a "simp:false;" before the tests then all these tests yield essentially the same results as in the paper (obs: I had to fix some typos - or scanos - in the .txt... Richard, do you want a list of the typos/scanos?): simp:false; :lisp #$a$ :lisp #$?a$ :lisp #$"a"$ :lisp #$x+y$ :lisp #$x-y$ :lisp #$x*y$ :lisp #$a(x)$ :lisp #$a[1,2]$ :lisp #$a[1,2](x)$ :lisp #$sin(x)$ :lisp #$x/y$ :lisp #$x.y$ :lisp #$x^2$ :lisp #$x^^2$ :lisp #$[a,b,c]$ :lisp #$if a then b$ :lisp #$if a then b else c$ :lisp #$'diff(y,x)$ :lisp #$'integrate(a,b,c,d)$ :lisp #$not a$ :lisp #$a or b$ :lisp #$a and b$ :lisp #$a=b$ :lisp #$a>b$ :lisp #$a>=b$ :lisp #$a<b$ :lisp #$a<=b$ :lisp #$a#b$ but these entries give outputs that are very wrong: :lisp #$'a$ :lisp #$(a,b,c)$ :lisp #$for i:a thru b step c unless q do f(i)$ :lisp #$for i:a next n unless q do f(i)$ :lisp #$for i in L do f(i)$ :lisp #$diff(y,x)$ :lisp #$diff(y,x,2,z,1)$ :lisp #$integrate(a,b,c,d)$ :lisp #$block([l1,l2], s1,s2)$ :lisp #$block(s1,s2)$ :lisp #$a:b$ :lisp #$a::b$ :lisp #$a(x):f$ it seems that there is some kind of evaluation that is still going on. How can I run just the parser? I guess that it would be something like this, to_lisp(); (mread-raw "a<b") but using another function, as mread-raw expects a stream... Thanks in advance =), Eduardo Ochs http://angg.twu.net/eev-maxima.html http://angg.twu.net/e/maxima.e.html#input-string-parser-output |