From: Nasser M. A. <nm...@12...> - 2024-01-05 18:10:13
|
On 1/5/2024 10:29 AM, Francis Wright wrote: > Hi, Nasser > > I think this strange line breaking is at least partly a consequence of using write to output a list. I'm working on an alternative version of the code you sent me that doesn't use a list and also doesn't produce the strange line breaks. I'll let you have a copy once I have made a bit more progress. > > Do you want the "{" and "}" characters and the final "$" in the output? Actually, I do not. I was thinking istead of using fprintf to write formatted output to file (like I do with other CAS systems), which reduce does not have, is to just use WRITE to print to the screen each record (i.e. list) and pipe that to a file. Each line (i.e list) contains the result of running one integral by Reduce. It has fields that show the inegral number, CPU time used, leaf count, result (0 or 1 for failed or passed) the actual integral, the anti-derivative, latex for the anti, command used, etc... So if there are 10 integrals, there will be 10 lines. Each field is comma separated. There are 14 fields. This is what I do now in the script I send in last email in the list I called M. Here is description of each line <https://12000.org/my_notes/CAS_integration_tests/indexsection4.htm> Which I emailed you directly before. The script also describes each field type. It is CSV file. It has strings and integers with comma separated. I attach an actual such CSV generated by Mathematica for a test file I have of only 6 integrals called m_listA.txt I still need to convert the anti-derivative generated by Reduce to Latex then convert that to string. Also the anti-derivative as is (no Latex conversion) but convert to string. If I can figure how to convert an symbolic expression to string in Reduce, that will go long way. I also attached the script for sympy using python showing the formatting of output. You can't run this, but this shows you how it is done using python's write() command. (Incidentally, the final "$" is caused by using "off nat".) And shouldall the mathematical output be in the form of LaTeX, or do you want some of it in the form of normal REDUCE input? > Some are normal Reduce input. But encoded as string as you see in the attached file example for Mathematica. There is a an SQL database based on free databse SQLite3 which any one can download and look at other CAS system result here <https://12000.org/my_notes/CAS_integration_tests/reports/summer_2023_Rubi_4_17_3/DATA_BASE/index.htm> If I can get the output I need from Reduce, I will be able to add Reduce to the independent CAS integration test for the next version. If not, then will not be able to do it. > I'm still not convinced that string concatenation is necessary, but if it is then I'll show you how to do it. I do not need string concatenation actually, if I can figure how to convert reduce to string directly. Thanks for help. Feel free to let me know if you need any other info. I'd like to add Reduce, but I never used it before in my life. Just found it is at sourceforge last week. It will good to see how its integrate compare to the other CAS systems if possible. --Nasser > > Francis > > ________________________________ > From: Nasser M. Abbasi <nm...@12...> > Sent: 05 January 2024 9:49 AM > To: red...@li... <red...@li...> > Subject: [Reduce-algebra-developers] why command write of a list sometimes display the list on multiple lines on screen vs. all the list on same line? > > I have list, which in the attached script I print on to the terminal using > > write M; > > Where M is the list. > > Sometimes it displays on the terminal on one line as expected. > sometimes it displays each entry in the list on separate line. > > Here is screen shot attached. > > I added > > off output; > linelength(1000); > > At the top of my script in order to only see explicit output > from the "write" command and nothing else as the script runs. > > But I still see numbers 1: 2: 3: etc... print at the start of the > script. why is that? > > Please see the script file.red attached. > > I run it as follows > > redcsl < file.red > > I am using Reduce (CSL, rev 6657), 10-Dec-2023 on Linux > which I build from source code. (Thanks to Francis Wright for > sending me link to the source tar file as it was not easy to > find it at sourceforge). > > What do I need to change in the script so each list is printed > on one line, no matter how long it is? > > Thanks > --Nasser > |