Progress, sort of



Well, with a little help from #lisp I have created what (I think) is a
reasonable lasteval function:

(defun lasteval (functionlist arg)
;; This function is intended to be a way for people to
;; add a final custom evaluation function (or functions)
;; that doesn't use any of the customary Maxima simplification
;; routines.
   (cond 
      ((null functionlist) arg)
      ((lasteval (cdr functionlist)(funcall (car functionlist) arg)))))

I then insert this in macsys.lisp - here's the diff:

diff ../../maxima/src/macsys.lisp macsys.lisp
39a40,50
> (defun lasteval (functionlist arg)
> ;; This function is intended to be a place for people to
> ;; add a final custom evaluation function (or functions)
> ;; that doesn't use any of the customary Maxima simplification
> ;; routines.
>    (cond 
>       ((null functionlist) arg)
>       ((lasteval (cdr functionlist)(funcall (car functionlist)
arg)))))
> 
> ;; define the default finalevallist - will start as nil
> (setf finalevallist '())
161a173
>       (setq totaleval (lasteval finalevallist (toplevel-macsyma-eval
$__)))
172c184,186
<       (set (setq d-tag (makelabel $outchar)) $%)
---
>       (set (setq d-tag (makelabel $outchar)) totaleval)
>       (format t "At insertion point #1 for totaleval - totaleval:
~S~%" totaleval)
>       (format t "At insertion point #1 for totaleval - $%: ~S~%" $%)
189c203,205
<           (displa `((mlable) ,d-tag ,$%)))
---
>           (displa `((mlable) ,d-tag ,totaleval)))
>          (format t "At insertion point #2 for totaleval - totaleval:
~S~%" totaleval)
>          (format t "At insertion point #2 for totaleval - $%: ~S~%"
$%)

As near as I can tell this should be harmless, but when I compile and
run make check a significant number of tests fail.  I do not understand
why, since if I did this right the lasteval command should be invisible
until finalevallist is not empty.  Anybody have an idea what I might
have missed?

Thanks,
CY


These are the full test results for anybody interested (sorry they are
so long.)


(%i1)                           run_testsuite()

Running tests in rtestnset.mac: 477/477 tests passed.
Running tests in rtest1.mac: 28/28 tests passed.
Running tests in rtest1a.mac: 23/23 tests passed.
Running tests in rtest2.mac: 47/47 tests passed.
Running tests in rtest4.mac: 82/82 tests passed.
Running tests in rtest5.mac: 51/51 tests passed.
Running tests in rtest6.mac: 4/4 tests passed.
Running tests in rtest6a.mac: 56/56 tests passed.
Running tests in rtest6b.mac: 16/16 tests passed.
Running tests in rtest7.mac: 41/41 tests passed.
Running tests in rtest9.mac: 77/77 tests passed.
Running tests in rtest9a.mac: 18/18 tests passed.
Running tests in rtest10.mac: 38/38 tests passed.
Running tests in rtest11.mac: 86/86 tests passed.
Running tests in rtest13.mac: 24/24 tests passed.
Running tests in rtest13s.mac: 16/16 tests passed.
Running tests in rtest14.mac: 93/93 tests passed.
Running tests in rtest15.mac: STYLE-WARNING: using deprecated EVAL-WHEN
situation names LOAD EVAL COMPILE
STYLE-WARNING: using deprecated EVAL-WHEN situation names LOAD EVAL
COMPILE
STYLE-WARNING: using deprecated EVAL-WHEN situation names LOAD EVAL
COMPILE
STYLE-WARNING: redefining $F in DEFUN
STYLE-WARNING: using deprecated EVAL-WHEN situation names LOAD EVAL
COMPILE
STYLE-WARNING: using deprecated EVAL-WHEN situation names LOAD EVAL
COMPILE
STYLE-WARNING: redefining $F in DEFUN
STYLE-WARNING: using deprecated EVAL-WHEN situation names LOAD EVAL
COMPILE
STYLE-WARNING: using deprecated EVAL-WHEN situation names LOAD EVAL
COMPILE
STYLE-WARNING: redefining $F in DEFUN
STYLE-WARNING: using deprecated EVAL-WHEN situation names LOAD EVAL
COMPILE
STYLE-WARNING: using deprecated EVAL-WHEN situation names LOAD EVAL
COMPILE
STYLE-WARNING: redefining $F in DEFUN
STYLE-WARNING: using deprecated EVAL-WHEN situation names LOAD EVAL
COMPILE
STYLE-WARNING: using deprecated EVAL-WHEN situation names LOAD EVAL
COMPILE
STYLE-WARNING: redefining $F in DEFUN
STYLE-WARNING: using deprecated EVAL-WHEN situation names LOAD EVAL
COMPILE
STYLE-WARNING: using deprecated EVAL-WHEN situation names LOAD EVAL
COMPILE
STYLE-WARNING: redefining $F in DEFUN
STYLE-WARNING: using deprecated EVAL-WHEN situation names LOAD EVAL
COMPILE
STYLE-WARNING: using deprecated EVAL-WHEN situation names LOAD EVAL
COMPILE
STYLE-WARNING: redefining $F in DEFUN
131/131 tests passed.
Running tests in rtest16.mac: 12/12 tests passed.
Running tests in rtestode.mac: 64/64 tests passed.
Running tests in rtestode_zp.mac: 30/30 tests passed.
Running tests in rtest3.mac: 94/94 tests passed.
Running tests in rtest8.mac: 50/50 tests passed.
Running tests in rtest12.mac: 74/74 tests passed.
Running tests in rexamples.mac: 136/136 tests passed.
Running tests in rtesthyp.mac: 103/103 tests passed.
Running tests in rtestmt19937.mac: 15/15 tests passed.

No unexpected errors found.
Evaluation took:
  8.713f0 seconds of real time
  8.152761f0 seconds of user run time
  0.351946f0 seconds of system run time
  0 page faults and
  159,509,544 bytes consed.

Running tests in rtestnset.mac: 
********************** Problem 33 ***************
Input:
union()


Result:
Too few arguments supplied to union(x, y):
[]
 -- an error.  Quitting.  To debug this try debugmode(true);
{{a, b}, z}

This differed from the expected result:
{}

********************** Problem 34 ***************
Input:
union({})


Result:
Too few arguments supplied to union(x, y):
[{}]
 -- an error.  Quitting.  To debug this try debugmode(true);
{{a, b}, z}

This differed from the expected result:
{}
#0: union(x=set(),y=set())(manual.demo line 1)

********************** Problem 35 ***************
Input:
union({}, {})


Result:
Argument to `first' is empty.
 -- an error.  Quitting.  To debug this try debugmode(true);
{{a, b}, z}

This differed from the expected result:
{}
#0: union(x=set(),y=set())(manual.demo line 1)
#1: union(x=set(false),y=set())(manual.demo line 2)

********************** Problem 36 ***************
Input:
union({false}, {})


Result:
Argument to `first' is empty.
 -- an error.  Quitting.  To debug this try debugmode(true);
{{a, b}, z}

This differed from the expected result:
{false}

********************** Problem 37 ***************
Input:
union({6})


Result:
Too few arguments supplied to union(x, y):
[{6}]
 -- an error.  Quitting.  To debug this try debugmode(true);
{{a, b}, z}

This differed from the expected result:
{6}

********************** Problem 38 ***************
Input:
union({8, 8, 1932})


Result:
Too few arguments supplied to union(x, y):
[{8, 1932}]
 -- an error.  Quitting.  To debug this try debugmode(true);
{{a, b}, z}

This differed from the expected result:
{8, 1932}

********************** Problem 39 ***************
Input:
union({a}, {a, b}, {a, b, c})


Result:
Too many arguments supplied to union(x, y):
errexp1
 -- an error.  Quitting.  To debug this try debugmode(true);
{{a, b}, z}

This differed from the expected result:
{a, b, c}
#0: union(x=set(),y=set(a))(manual.demo line 1)

********************** Problem 40 ***************
Input:
union({}, {a})


Result:
Argument to `first' is empty.
 -- an error.  Quitting.  To debug this try debugmode(true);
{{a, b}, z}

This differed from the expected result:
{a}

********************** Problem 41 ***************
Input:
union({a}, {b}, {c})


Result:
Too many arguments supplied to union(x, y):
[{a}, {b}, {c}]
 -- an error.  Quitting.  To debug this try debugmode(true);
{{a, b}, z}

This differed from the expected result:
{a, b, c}
#0: union(x=set(),y=set(a))(manual.demo line 1)
#1: union(x=set(set(a)),y=set(a))(manual.demo line 2)

********************** Problem 42 ***************
Input:
union({{a}}, {a})


Result:
Argument to `first' is empty.
 -- an error.  Quitting.  To debug this try debugmode(true);
{{a, b}, z}

This differed from the expected result:
{a, {a}}
#0: union(x=set(),y=set())(manual.demo line 1)
#1: union(x=set(a),y=set())(manual.demo line 2)

********************** Problem 44 ***************
Input:
union({a}, {})


Result:
Argument to `first' is empty.
 -- an error.  Quitting.  To debug this try debugmode(true);
[]

This differed from the expected result:
{a}
#0: union(x=set(),y=set(set()))(manual.demo line 1)

********************** Problem 45 ***************
Input:
union({}, {{}})


Result:
Argument to `first' is empty.
 -- an error.  Quitting.  To debug this try debugmode(true);
[]

This differed from the expected result:
{{}}
#0: union(x=set(),y=set())(manual.demo line 1)

********************** Problem 123 ***************
Input:
union({}, {})


Result:
Argument to `first' is empty.
 -- an error.  Quitting.  To debug this try debugmode(true);
{x}

This differed from the expected result:
{}
#0: union(x=set(),y=set(8))(manual.demo line 1)

********************** Problem 124 ***************
Input:
union({}, {8})


Result:
Argument to `first' is empty.
 -- an error.  Quitting.  To debug this try debugmode(true);
{x}

This differed from the expected result:
{8}
#0: union(x=set(),y=set())(manual.demo line 1)
#1: union(x=set(1932),y=set())(manual.demo line 2)

********************** Problem 125 ***************
Input:
union({1932}, {})


Result:
Argument to `first' is empty.
 -- an error.  Quitting.  To debug this try debugmode(true);
{x}

This differed from the expected result:
{1932}
#0: union(x=set(),y=set(8))(manual.demo line 1)
#1: union(x=set(set(8)),y=set(8))(manual.demo line 2)

********************** Problem 126 ***************
Input:
union({{8}}, {8})


Result:
Argument to `first' is empty.
 -- an error.  Quitting.  To debug this try debugmode(true);
{x}

This differed from the expected result:
{{8}, 8}

********************** Problem 127 ***************
Input:
is(union({a}, {b}, {c}) = {a, b, c})


Result:
Too many arguments supplied to union(x, y):
[{a}, {b}, {c}]
 -- an error.  Quitting.  To debug this try debugmode(true);
{x}

This differed from the expected result:
true

********************** Problem 128 ***************
Input:
is(union({{}}, {b}, {}) = {b, {}})


Result:
Too many arguments supplied to union(x, y):
[{{}}, {b}, {}]
 -- an error.  Quitting.  To debug this try debugmode(true);
{x}

This differed from the expected result:
true

********************** Problem 129 ***************
Input:
is(union({x = 6}, {y = 3}, {z = - 8}) = {z = - 8, y = 3, x = 6})


Result:
Too many arguments supplied to union(x, y):
errexp1
 -- an error.  Quitting.  To debug this try debugmode(true);
{x}

This differed from the expected result:
true
Odd function called with wrong number of arguments:
errexp1
 -- an error.  Quitting.  To debug this try debugmode(true);

********************** Problem 152 ***************
Input:
full_listify(f(a, {a}, [b + a]))


Result:
Odd function called with wrong number of arguments:
errexp1
 -- an error.  Quitting.  To debug this try debugmode(true);
f([[a]])

This differed from the expected result:
f(a, [a], [b + a])
#0: union(x=set(),y=set(y))(manual.demo line 1)
#1: union(x=set(x),y=set(y))(manual.demo line 2)

********************** Problem 170 ***************
Input:
union({x}, {y})


Result:
Argument to `first' is empty.
 -- an error.  Quitting.  To debug this try debugmode(true);
{x}

This differed from the expected result:
{x, y}
#0: union(x=set(),y=set())(manual.demo line 1)

********************** Problem 171 ***************
Input:
union({}, {})


Result:
Argument to `first' is empty.
 -- an error.  Quitting.  To debug this try debugmode(true);
{x}

This differed from the expected result:
{}
#0: union(x=set(),y=set(true))(manual.demo line 1)
#1: union(x=set(false),y=set(true))(manual.demo line 2)

********************** Problem 183 ***************
Input:
union({false}, {true})


Result:
Argument to `first' is empty.
 -- an error.  Quitting.  To debug this try debugmode(true);
false

This differed from the expected result:
{false, true}
#0: union(x=set(),y=set(x))(manual.demo line 1)
#1: union(x=set(true),y=set(x))(manual.demo line 2)
#2: union(x=set(false,true),y=set(x))(manual.demo line 2)

********************** Problem 184 ***************
Input:
union(setify([true, false]), {x})


Result:
Argument to `first' is empty.
 -- an error.  Quitting.  To debug this try debugmode(true);
false

This differed from the expected result:
{x, true, false}
Odd function called with wrong number of arguments:
f
 0, 1
 -- an error.  Quitting.  To debug this try debugmode(true);

********************** Problem 190 ***************
Input:
fullsetify(f    )
            0, 1


Result:
Odd function called with wrong number of arguments:
f
 0, 1
 -- an error.  Quitting.  To debug this try debugmode(true);
{a, {b}}

This differed from the expected result:
f
 0, 1
Improper name or value in functional position:
5 f
   1
 -- an error.  Quitting.  To debug this try debugmode(true);

********************** Problem 191 ***************
Input:
fullsetify(f (x))
            5


Result:
Improper name or value in functional position:
5 f
   1
 -- an error.  Quitting.  To debug this try debugmode(true);
{a, {b}}

This differed from the expected result:
f (x)
 5
Odd function called with wrong number of arguments:
f(a, b, c, d)
 -- an error.  Quitting.  To debug this try debugmode(true);

********************** Problem 220 ***************
Input:
flatten(f(f(a, b), f(c, d)))


Result:
Odd function called with wrong number of arguments:
f(a, b)
 -- an error.  Quitting.  To debug this try debugmode(true);
[a, b([c]), d]

This differed from the expected result:
f(a, b, c, d)
Odd function called with wrong number of arguments:
f(1, 2, 3, 4)
 -- an error.  Quitting.  To debug this try debugmode(true);

********************** Problem 424 ***************
Input:
flatten(rreduce(f, [1, 2, 3, 4]))


Result:
Odd function called with wrong number of arguments:
f(3, 4)
 -- an error.  Quitting.  To debug this try debugmode(true);
amh

This differed from the expected result:
f(1, 2, 3, 4)
Odd function called with wrong number of arguments:
f(1, 2, 3, 4)
 -- an error.  Quitting.  To debug this try debugmode(true);

********************** Problem 431 ***************
Input:
flatten(lreduce(f, [1, 2, 3, 4]))


Result:
Odd function called with wrong number of arguments:
f(1, 2)
 -- an error.  Quitting.  To debug this try debugmode(true);
amh

This differed from the expected result:
f(1, 2, 3, 4)

448/477 tests passed.
The following 29 problems failed: (431 424 220 191 190 184 183 171 170
152 129
                                   128 127 126 125 124 123 45 44 42 41
40 39 38
                                   37 36 35 34 33)
Running tests in rtest1.mac: 
********************** Problem 10 ***************
Input:
functions


Result:
[union(x, y), f(x), g(y, z), h(n)]

This differed from the expected result:
[f(x), g(y, z), h(n)]

27/28 tests passed.
The following 1 problem failed: (10)
Running tests in rtest1a.mac: 23/23 tests passed.
Running tests in rtest2.mac: 47/47 tests passed.
Running tests in rtest4.mac: 82/82 tests passed.
Running tests in rtest5.mac: 51/51 tests passed.
Running tests in rtest6.mac: 4/4 tests passed.
Running tests in rtest6a.mac: 56/56 tests passed.
Running tests in rtest6b.mac: 16/16 tests passed.
Running tests in rtest7.mac: 41/41 tests passed.
Running tests in rtest9.mac: 77/77 tests passed.
Running tests in rtest9a.mac: 18/18 tests passed.
Running tests in rtest10.mac: 38/38 tests passed.
Running tests in rtest11.mac: 86/86 tests passed.
Running tests in rtest13.mac: 24/24 tests passed.
Running tests in rtest13s.mac: 16/16 tests passed.
Running tests in rtest14.mac: 93/93 tests passed.
Running tests in rtest15.mac: 
********************** Problem 35 ***************
Input:
          sin(3 a)
trigrat(------------)
            %pi
        sin(--- + a)
             3


Result:
          sin(3 a)
trigrat(------------)
                %pi
        sin(a + ---)
                 3
This differed from the expected result:
- 1 + cos(2 a) + sqrt(3) sin(2 a)
STYLE-WARNING: using deprecated EVAL-WHEN situation names LOAD EVAL
COMPILE
STYLE-WARNING: using deprecated EVAL-WHEN situation names LOAD EVAL
COMPILE
STYLE-WARNING: using deprecated EVAL-WHEN situation names LOAD EVAL
COMPILE
STYLE-WARNING: redefining $F in DEFUN
STYLE-WARNING: using deprecated EVAL-WHEN situation names LOAD EVAL
COMPILE
STYLE-WARNING: using deprecated EVAL-WHEN situation names LOAD EVAL
COMPILE
STYLE-WARNING: redefining $F in DEFUN
STYLE-WARNING: using deprecated EVAL-WHEN situation names LOAD EVAL
COMPILE
STYLE-WARNING: using deprecated EVAL-WHEN situation names LOAD EVAL
COMPILE
STYLE-WARNING: redefining $F in DEFUN
STYLE-WARNING: using deprecated EVAL-WHEN situation names LOAD EVAL
COMPILE
STYLE-WARNING: using deprecated EVAL-WHEN situation names LOAD EVAL
COMPILE
STYLE-WARNING: redefining $F in DEFUN
STYLE-WARNING: using deprecated EVAL-WHEN situation names LOAD EVAL
COMPILE
STYLE-WARNING: using deprecated EVAL-WHEN situation names LOAD EVAL
COMPILE
STYLE-WARNING: redefining $F in DEFUN
STYLE-WARNING: using deprecated EVAL-WHEN situation names LOAD EVAL
COMPILE
STYLE-WARNING: using deprecated EVAL-WHEN situation names LOAD EVAL
COMPILE
STYLE-WARNING: redefining $F in DEFUN
STYLE-WARNING: using deprecated EVAL-WHEN situation names LOAD EVAL
COMPILE
STYLE-WARNING: using deprecated EVAL-WHEN situation names LOAD EVAL
COMPILE
STYLE-WARNING: redefining $F in DEFUN

130/131 tests passed.
The following 1 problem failed: (35)
Running tests in rtest16.mac: 12/12 tests passed.
Running tests in rtestode.mac: 64/64 tests passed.
Running tests in rtestode_zp.mac: 30/30 tests passed.
Running tests in rtest3.mac: 94/94 tests passed.
Running tests in rtest8.mac: 50/50 tests passed.
Running tests in rtest12.mac: 
********************** Problem 20 ***************
Input:
tellsimp(sin(%i x), %i sinh(x))


Result:
[sinrule3, simp-%sin]

This differed from the expected result:
[sinrule1, simp-%sin]

73/74 tests passed.
The following 1 problem failed: (20)
Running tests in rexamples.mac: 136/136 tests passed.
Running tests in rtesthyp.mac: 103/103 tests passed.
Running tests in rtestmt19937.mac: 15/15 tests passed.
Error summary:
Errors found in /home/user/maximabuild/tests/rtestnset.mac, problems:
(33 34 35 36 37 38 39 40 41 42 44 45 123 124 125 126 127 128 129 152
170 171
 183 184 190 191 220 424 431)
Error found in /home/user/maximabuild/tests/rtest1.mac, problem:
(10)
Error found in /home/user/maximabuild/tests/rtest15.mac, problem:
(35)
Error found in /home/user/maximabuild/tests/rtest12.mac, problem:
(20)
Evaluation took:
  12.076f0 seconds of real time
  7.981786f0 seconds of user run time
  0.32695f0 seconds of system run time
  0 page faults and
  161,859,272 bytes consed.
At insertion point #1 for totaleval - totaleval: NIL
At insertion point #1 for totaleval - $%: ((MLIST SIMP)
3378087623307407
                                           950036134838534144
                                           12401473179864865699790848
                                          
31898738619930029950889265274552320)
(%o0)                                false
At insertion point #2 for totaleval - totaleval: NIL
At insertion point #2 for totaleval - $%: ((MLIST SIMP)
3378087623307407
                                           950036134838534144
                                           12401473179864865699790848
                                           31898738619930029950889265274552320)


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/