[Maxima] Sanitize is not fool proof (yet) .Sanitize2 seems to work as advertized.

Michel Van den Bergh michel.vandenbergh at uhasselt.be
Mon Jan 1 16:45:23 CST 2007


Example

f(x):=oddp(x)$
f(1);
   true
sanitize(f);
   f(g32641) := false
f(1);
  false

However sanitize2 works correctly

f(x):=oddp(x)$
sanitize2(f);
   f(g32629) := oddp(g32629)
f(1);
   true;

Note: sanitize2 does not sanitize local variables

f(s):=block([t],local(t),t[4]:s[4],t[4]);
sanitize2(f);
    f(g34408):=block([t], local(t), t[4]: g34408[4], t[4] )

which has the usual problems (see the earlier discussion on the list)

I applied sanitize2 to the five (easy) functions  in levin and the test
script
still completed succesfully (after commenting out the initial
"kill(all)" of course).
sanitize did not work at all.


Michel


More information about the Maxima mailing list