From: Ben H. <bdv...@us...> - 2010-11-22 23:06:24
|
Update of /cvsroot/stack/stack-dev/maxima In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv29766/maxima Modified Files: Tag: question_reporting maximafun.php initMaxima.php complexi.lisp stackmaxima.mac stacktex.lisp unittests.mac complexj.lisp noun_arith.mac Added Files: Tag: question_reporting stackmaxima_5.20.1.bat Removed Files: Tag: question_reporting stackmaxima_5.13.0.bat stackmaxima_5.11.0.bat stackmaxima_5.15.0.bat stackmaxima_5.12.0.bat Log Message: Merging from the current HEAD into question_reporting. Apologies in advance if this all goes horribly wrong. Index: stackmaxima.mac =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/stackmaxima.mac,v retrieving revision 1.65 retrieving revision 1.65.2.1 diff -C2 -d -r1.65 -r1.65.2.1 *** stackmaxima.mac 15 Oct 2009 15:28:18 -0000 1.65 --- stackmaxima.mac 22 Nov 2010 23:05:44 -0000 1.65.2.1 *************** *** 3,7 **** /* ********************************** */ ! stack_reset(ex):= block( kill(allbut [functions]), kill(trigsimp), --- 3,7 ---- /* ********************************** */ ! stack_reset(rand_seed):= block( kill(allbut [functions]), [...1753 lines suppressed...] --- 1871,1878 ---- /* If ok, we perform the test */ if cont then ret:ATEquationfun(SA,SB,var,AT), ! ret:StackReturnOb(string(ret[2]),ret[3],ret[4]), return(ret) )$ /* Description : forme echelonne par lignes d'une matrice rectangulaire *************** *** 2034,2037 **** /* Stack expects some output */ ! print("[ Stack-Maxima started V2.0 dev ]"); --- 1956,1959 ---- /* Stack expects some output */ ! print("[ Stack-Maxima started V2.0 ]"); --- stackmaxima_5.11.0.bat DELETED --- --- NEW FILE: stackmaxima_5.20.1.bat --- @echo off set arg0=%0 set arg1=%1 set arg2=%2 set arg3=%3 set arg4=%4 set arg5=%5 set arg6=%6 set arg7=%7 set arg8=%8 set arg9=%9 rem Uncomment the line below and set required value to MAXIMA_LANG_SUBDIR rem to get localized describe in command line Maxima rem set MAXIMA_LANG_SUBDIR=es set lisp=gcl set version=5.20.1 set prefix=C:/maxima set maxima_prefix=C:\PROGRA~1\MAXIMA~1.1 set package=maxima set verbose=false set mingw_gccver=3.3.1 set path=%maxima_prefix%\bin;%maxima_prefix%\lib\gcc-lib\mingw32\3.3.1;%path% if "%USERPROFILE%" == "" goto win9x if "%MAXIMA_USERDIR%" == "" set MAXIMA_USERDIR=%USERPROFILE%\maxima if "%MAXIMA_TEMPDIR%" == "" set MAXIMA_TEMPDIR=%USERPROFILE% goto startparseargs :win9x if "%MAXIMA_USERDIR%" == "" set MAXIMA_USERDIR=%maxima_prefix%\user if "%MAXIMA_TEMPDIR%" == "" set MAXIMA_TEMPDIR=%maxima_prefix% :startparseargs if x%1 == x-l goto foundlisp if x%1 == x--lisp goto foundlisp if x%1 == x-u goto foundversion if x%1 == x--use-version goto foundversion if x%1 == x-v goto foundverbose if x%1 == x--verbose goto foundverbose :continueparseargs shift if not x%1 == x goto startparseargs goto endparseargs :foundlisp set lisp=%2 shift goto continueparseargs :foundversion set version=%2 shift goto continueparseargs :foundverbose set verbose=true goto continueparseargs :endparseargs if "%MAXIMA_LAYOUT_AUTOTOOLS%" == "" goto defaultlayout set layout_autotools=true goto endlayout :defaultlayout set layout_autotools=true :endlayout if "%MAXIMA_PREFIX%" == "" goto defaultvars if "%layout_autotools%" == "true" goto maxim_autotools set maxima_imagesdir=%MAXIMA_PREFIX%\src goto endsetupvars :maxim_autotools set maxima_imagesdir=%MAXIMA_PREFIX%\lib\%package%\%version% goto endsetupvars :defaultvars if "%layout_autotools%" == "true" goto defmaxim_autotools set maxima_imagesdir=%prefix%\src goto endsetupvars :defmaxim_autotools set maxima_imagesdir=%prefix%\lib\%package%\%version% goto endsetupvars :endsetupvars set maxima_image_base=%maxima_imagesdir%\binary-%lisp%\maxima if "%verbose%" == "true" @echo on if "%lisp%" == "gcl" goto dogcl if "%lisp%" == "clisp" goto doclisp if "%lisp%" == "ecl" goto doecl @echo Maxima error: lisp %lisp% not known. goto end :dogcl %maxima_imagesdir%\binary-gcl\maxima.exe -eval "(cl-user::run)" -f -- %arg1% %arg2% %arg3% %arg4% %arg5% %arg6% %arg7% %arg8% %arg9% goto end :doclisp if "%layout_autotools%" == "true" goto clisp_autotools clisp -q -M %maxima_image_base%.mem "" -- %arg1% %arg2% %arg3% %arg4% %arg5% %arg6% %arg7% %arg8% %arg9% goto end :clisp_autotools %maxima_imagesdir%\binary-clisp\lisp.exe -q -M %maxima_image_base%.mem "" -- %arg1% %arg2% %arg3% %arg4% %arg5% %arg6% %arg7% %arg8% %arg9% goto end :doecl ecl -load %maxima_image_base%.fas -eval "(user::run)" -- "%arg1%" "%arg2%" "%arg3%" "%arg4%" "%arg5%" "%arg6%" "%arg7%" "%arg8%" "%arg9%" goto end :end --- stackmaxima_5.15.0.bat DELETED --- Index: maximafun.php =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/maximafun.php,v retrieving revision 1.6 retrieving revision 1.6.12.1 diff -C2 -d -r1.6 -r1.6.12.1 *** maximafun.php 3 Oct 2007 12:24:17 -0000 1.6 --- maximafun.php 22 Nov 2010 23:05:44 -0000 1.6.12.1 *************** *** 19,22 **** --- 19,25 ---- $maxima_cmd['%enumer']['use'] = 't'; + $maxima_cmd['%f']['urls'][] = 'maxima_16.html#IDX636'; + $maxima_cmd['%f']['use'] = 't'; + $maxima_cmd['%gamma']['urls'][] = 'maxima_31.html#IDX1065'; $maxima_cmd['%gamma']['use'] = 's'; *************** *** 46,49 **** [...13412 lines suppressed...] ! $maxima_cmd['zlabel']['urls'][] = 'maxima_48.html#IDX1868'; ! $maxima_cmd['zlabel']['use'] = ''; ! ! $maxima_cmd['zlange']['urls'][] = 'maxima_58.html#IDX2297'; ! $maxima_cmd['zlange']['use'] = ''; ! ! $maxima_cmd['zrange']['urls'][] = 'maxima_48.html#IDX1855'; $maxima_cmd['zrange']['use'] = ''; ! $maxima_cmd['ztics']['urls'][] = 'maxima_48.html#IDX1873'; $maxima_cmd['ztics']['use'] = ''; + $maxima_cmd['ztics_axis']['urls'][] = 'maxima_48.html#IDX1884'; + $maxima_cmd['ztics_axis']['use'] = ''; + + $maxima_cmd['ztics_rotate']['urls'][] = 'maxima_48.html#IDX1879'; + $maxima_cmd['ztics_rotate']['use'] = ''; ?> \ No newline at end of file Index: complexj.lisp =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/complexj.lisp,v retrieving revision 1.1 retrieving revision 1.1.12.1 diff -C2 -d -r1.1 -r1.1.12.1 *** complexj.lisp 23 Mar 2007 10:51:43 -0000 1.1 --- complexj.lisp 22 Nov 2010 23:05:44 -0000 1.1.12.1 *************** *** 6,10 **** ;; \Maxima-5.9.0\share\maxima\5.9.0\src\mactex.lisp ! (defprop $%i "j" texword) (defprop $%i "<mi>j</mi> " mathmlword) --- 6,10 ---- ;; \Maxima-5.9.0\share\maxima\5.9.0\src\mactex.lisp ! (defprop $%i "\\mathrm{j}" texword) (defprop $%i "<mi>j</mi> " mathmlword) Index: complexi.lisp =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/complexi.lisp,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** complexi.lisp 23 Jun 2009 14:39:36 -0000 1.2 --- complexi.lisp 22 Nov 2010 23:05:44 -0000 1.2.4.1 *************** *** 6,10 **** ;; \Maxima-5.9.0\share\maxima\5.9.0\src\mactex.lisp ! (defprop $%i "i" texword) (defprop $%i "<mi>i</mi> " mathmlword) --- 6,10 ---- ;; \Maxima-5.9.0\share\maxima\5.9.0\src\mactex.lisp ! (defprop $%i "\\mathrm{i}" texword) (defprop $%i "<mi>i</mi> " mathmlword) Index: noun_arith.mac =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/noun_arith.mac,v retrieving revision 1.3 retrieving revision 1.3.10.1 diff -C2 -d -r1.3 -r1.3.10.1 *** noun_arith.mac 19 Nov 2008 15:37:03 -0000 1.3 --- noun_arith.mac 22 Nov 2010 23:05:44 -0000 1.3.10.1 *************** *** 8,11 **** --- 8,12 ---- Chris Sangwin 21 Oct 2005. + Chris Sangwin 7 Nov 2009, with help from JHD. */ *************** *** 37,40 **** --- 38,42 ---- infix("noun/",122,123); infix("noun^",140,139); + prefix("UNARY_RECIP",100); /* (2) */ *************** *** 65,69 **** ex:subst(STACK_DIV_OP,"noun/",ex), ex:subst("^","noun^",ex), ! ev(ex))$ --- 67,73 ---- ex:subst(STACK_DIV_OP,"noun/",ex), ex:subst("^","noun^",ex), ! define(UNARY_RECIP a, a^(-1)), ! ex:ev(ex,UNARY_MINUS=-1), ! remfunction("noun+","noun*","noun/","noun^","noun-"),ex)$ *************** *** 78,82 **** define(a noun/ b, a/b), define(a noun^ b, a^b), ! define(n- a, -1*a), ex:ev(ex,nouns), remfunction("noun+","noun*","noun/","noun^","noun-"),ex)$ --- 82,86 ---- define(a noun/ b, a/b), define(a noun^ b, a^b), ! define(noun- a, -1*a), ex:ev(ex,nouns), remfunction("noun+","noun*","noun/","noun^","noun-"),ex)$ *************** *** 87,92 **** ex:subst("noun+","+",ex), ex:subst("noun*","*",ex), ! ex:subst("noun-","-",ex), ! ex:subst("noun/",STACK_DIV_OP,ex), ex:subst("noun^","^",ex), ev(ex))$ --- 91,96 ---- ex:subst("noun+","+",ex), ex:subst("noun*","*",ex), ! ex:subst(lambda([ex],UNARY_MINUS noun* ex),"-",ex), /* Unary minus really communtes with multipication*/ ! ex:subst(lambda([ex1,ex2], ex1 noun* (UNARY_RECIP ex2)),STACK_DIV_OP,ex), /* Turn 1/x into x^(-1), in a special form */ ex:subst("noun^","^",ex), ev(ex))$ *************** *** 119,131 **** /* An answer test in the context of commutative+associative addition and multiplication.*/ ATEqual_com_ass(sa,sb) := ! block([RawMark,FeedBack,AnswerNote,ret], RawMark:0, FeedBack:"", AnswerNote:"", /* We need to check things are of the same type */ ret:ATSameTypefun(sa,sb), if ret[2]=0 then ! (ret[3]:concat("ATEqual_com_ass:",ret[3]), return(StackReturnOb(string(false),string(ret[2]),ret[3],ret[4])) ), ret:block([simp:true,ret],ATAlgEquivfun(sa,sb)), if ret[2]=0 then ! (ret[3]:concat("ATEqual_com_ass: (not AlgEquiv) ",ret[3]), return(StackReturnOb(string(ret[1]),string(ret[2]),ret[3],"")) ), /* Now actually apply this test */ if equals_commute_associate(sa,sb) then --- 123,139 ---- /* An answer test in the context of commutative+associative addition and multiplication.*/ ATEqual_com_ass(sa,sb) := ! block([RawMark,FeedBack,AnswerNote,ret,SAA,SBB], RawMark:0, FeedBack:"", AnswerNote:"", + SAA:errcatch(ev(sa,simp,fullratsimp,nouns)), + if (is(SAA=[STACKERROR]) or is(SAA=[])) then return(StackReturnOb("0","ATEqual_com_ass_STACKERROR_SAns","")), + SBB:errcatch(ev(sb,simp,fullratsimp,nouns)), + if (is(SBB=[STACKERROR]) or is(SBB=[])) then return(StackReturnOb("0","ATEqual_com_ass_STACKERROR_TAns","")), /* We need to check things are of the same type */ ret:ATSameTypefun(sa,sb), if ret[2]=0 then ! (ret[3]:concat("ATEqual_com_ass:",ret[3]), return(StackReturnOb(string(ret[2]),ret[3],ret[4])) ), ret:block([simp:true,ret],ATAlgEquivfun(sa,sb)), if ret[2]=0 then ! (ret[3]:concat("ATEqual_com_ass: (not AlgEquiv) ",ret[3]), return(StackReturnOb(string(ret[2]),ret[3],"")) ), /* Now actually apply this test */ if equals_commute_associate(sa,sb) then *************** *** 133,137 **** else (RawMark:0, AnswerNote:"AlgEquiv, but not equal"), ! return(StackReturnOb("true",string(RawMark),AnswerNote,FeedBack)) )$ --- 141,145 ---- else (RawMark:0, AnswerNote:"AlgEquiv, but not equal"), ! return(StackReturnOb(string(RawMark),AnswerNote,FeedBack)) )$ *************** *** 161,162 **** --- 169,179 ---- + /* Things to consider: 7/11/9 + + (1) What about pushing -1 thorugh /, + eg x*(-y) vs -(x*y) + + (2) What about even powers? + e.g. (1-x)^2 vs (x-1)^2 + + */ --- stackmaxima_5.12.0.bat DELETED --- Index: initMaxima.php =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/initMaxima.php,v retrieving revision 1.5 retrieving revision 1.5.4.1 diff -C2 -d -r1.5 -r1.5.4.1 *** initMaxima.php 23 Jun 2009 14:39:36 -0000 1.5 --- initMaxima.php 22 Nov 2010 23:05:44 -0000 1.5.4.1 *************** *** 172,175 **** --- 172,182 ---- // Exceptions: Maxima variable names which are allowed to be variable names as part of STACK. + // Enable students to use any Greek letters as part of an answer. + + $greek = array(alpha,nu,beta,xi,gamma,omicron,delta,pi,epsilon,rho,zeta,sigma,eta,tau,theta,upsilon,iota,phi,kappa,chi,lambda,psi,mu,omega); + foreach ($greek as $gl) { + $gl = strtoupper($gl); + $sA .= ", '$gl' "; + } --- stackmaxima_5.13.0.bat DELETED --- Index: stacktex.lisp =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/stacktex.lisp,v retrieving revision 1.4 retrieving revision 1.4.4.1 diff -C2 -d -r1.4 -r1.4.4.1 *** stacktex.lisp 23 Jun 2009 14:39:36 -0000 1.4 --- stacktex.lisp 22 Nov 2010 23:05:44 -0000 1.4.4.1 *************** *** 1,13 **** ;; Customize Maxima's TEX() function. To give better control to the output. ! ;; Chris Sangwin 21 Jan 2009. ! ;; Useful files: ! ;; \Maxima-5.9.0\share\maxima\5.9.0\share\utils\mactex-utilities.lisp ! ;; \Maxima-5.9.0\share\maxima\5.9.0\src\mactex.lisp ;; Additional mactex utilities taken from the distributed file ;; mactex-utilities.lisp ! ;; Based on code by Richard J. Fateman, copyright 1987. ! ;; Fateman's code was ported to Common Lisp by William ! ;; Schelter. ;; If you want LaTeX style quotients, first load mactex and second --- 1,13 ---- ;; Customize Maxima's TEX() function. To give better control to the output. ! ;; Chris Sangwin 27 Sept 2010. ! ;; Useful files: ! ;; \Maxima-5.21.1\share\maxima\5.21.1\share\utils\mactex-utilities.lisp ! ;; \Maxima-5.21.1\share\maxima\5.21.1\src\mactex.lisp ;; Additional mactex utilities taken from the distributed file ;; mactex-utilities.lisp ! ;; Based on code by Richard J. Fateman, copyright 1987. ! ;; Fateman's code was ported to Common Lisp by William ! ;; Schelter. ;; If you want LaTeX style quotients, first load mactex and second *************** *** 39,46 **** (defun tex-matrix (x l r) ;; matrix looks like ((mmatrix)((mlist) a b) ...) ! (append l `("\\left[\\begin{array}{") (tex-matrix-col-count x "c") ; Replace every column with a "c" `("} ") ! ; Below is the bit we need - forms the array (mapcan #'(lambda(y) (tex-list (cdr y) nil (list " \\\\ ") " & ")) (cdr x)) '("\\end{array}\\right]") r) --- 39,46 ---- (defun tex-matrix (x l r) ;; matrix looks like ((mmatrix)((mlist) a b) ...) ! (append l `("\\left[\\begin{array}{") (tex-matrix-col-count x "c") ; Replace every column with a "c" `("} ") ! ; Below is the bit we need - forms the array (mapcan #'(lambda(y) (tex-list (cdr y) nil (list " \\\\ ") " & ")) (cdr x)) '("\\end{array}\\right]") r) *************** *** 62,68 **** (defun tex-prefix-unaryminus (x l r) ! (tex (cadr x) (append l (texsym (caar x))) r 'mparen 'mparen)) ! (defprop &? ("?") texsym) --- 62,70 ---- (defun tex-prefix-unaryminus (x l r) ! (tex (cadr x) (append l (texsym (caar x))) r (caar x) rop)) ! ! ! ;; Display question marks correctly (defprop &? ("?") texsym) *************** *** 133,134 **** --- 135,153 ---- ;(%laplace "{\\cal L}") )) ;; etc + + ;; Remove un-needed {}s from string output + ;; Chris Sangwin, 28/10/2009 + + (defun tex-string (x) + (cond ((equal x "") "") + ((eql (elt x 0) #\\) x) + (t (concatenate 'string "\\mbox{" x "}")))) + + + ;; Sort out display on inequalitis + ;; Chris Sangwin, 21/9/2010 + + (defprop mlessp (" < ") texsym) + (defprop mgreaterp (" > ") texsym) + + Index: unittests.mac =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/unittests.mac,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -C2 -d -r1.11 -r1.11.2.1 *** unittests.mac 25 Sep 2009 17:22:37 -0000 1.11 --- unittests.mac 22 Nov 2010 23:05:44 -0000 1.11.2.1 *************** *** 18,21 **** --- 18,23 ---- )$ + UT('all_listp(real_numberp,[1,e^(%i*%pi),1+sqrt(2),sin(1)]),true)$ + UT('any_listp(real_numberp,[%i,1+%i,x+3,1+sqrt(-3)]),false)$ UT('expandp( (x-1)*(x+1)),false)$ *************** *** 23,26 **** --- 25,31 ---- UT('expandp( 2*x-1),true)$ UT('expandp( x-1),true)$ + UT('expandp( (p-1)*(p+1)),false)$ + UT('expandp( 2*(p-1)),false)$ + UT('expandp( 6*p+3*y),true)$ UT('factorp( x),true)$ *************** *** 158,160 **** --- 163,203 ---- UT('subst_equiv(x^2+y+v+u+w,a^2+b+y+v+w),[u=b,x=a]); + UT('exdowncase(X^2+X+1),x^2+x+1); + UT('exdowncase(X-x),0); /* Watch out for this case when using in anger! */ + UT('exdowncase(%pi),%pi); + + UT('stack_assignmentp(x=1),true); + UT('stack_assignmentp(x=sqrt(2)),true); + UT('stack_assignmentp(3=1),false); + UT('stack_assignmentp(d=v*t),false); + UT('stack_assignmentp(1=x),false); + + UT('stack_op(1),""); + UT('stack_op(x),""); + UT('stack_op(%pi),""); + UT('stack_op(3+z),"+"); + UT('stack_op(3*z),"*"); + UT('stack_op(3^z),"^"); + UT('stack_op(3/z),STACK_DIV_OP); + UT('stack_op(sin(3*z)),"sin"); + UT('stack_op((-1)/(x^2+1)),"/"); + UT('stack_op(1-x),"+"); + UT('stack_op(x-1),"+"); + UT('stack_op("-"(x-1)),"+"); + UT('stack_op("-"(1/(x^2+1))),STACK_DIV_OP); + UT('stack_op("-"(2*x)),"*"); + + UT('StackDISP(a/b,""),"\\frac{a}{b}"); + UT('StackDISP(-27,""),"-27"); + UT('StackDISP(-(x-1),""),"-\\left(x-1\\right)"); + UT('StackDISP(-sin(x^2),""),"-\\sin \\left( x^2 \\right)"); + UT('StackDISP(asin(x),""),"\\sin^{-1} \\left( x \\right)"); + UT('StackDISP(log(x),""),"\\ln \\left( x \\right)"); + + UT('strip_int_const(x+k,x),x); + UT('strip_int_const(x+1+k,x),x+1); + UT('strip_int_const((x-1)^2+k^2,x),(x-1)^2); + UT('strip_int_const((t-1)^4/4+c,x),(t-1)^4/4); + + |