Recent changes to 631: assume hard to use programmaticallyhttp://sourceforge.net/p/maxima/bugs/631/Recent changes to 631: assume hard to use programmaticallyenFri, 22 Oct 2004 18:33:32 -0000assume hard to use programmaticallyhttp://sourceforge.net/p/maxima/bugs/631/assume\(r>0 and r<1\)
works fine.
However, if I have a function
withassume\(pred,expr\) :=
\( assume\(pred\), expand\(expr\) \);
you get
withassume\(r>0 and r<1, abs\(r\)\)
=> ERROR: can't eval predicate r>0
Quoting doesn't help:
withassume\('\(r>0 and r<1\), abs\(r\)\) => error
withassume\('\('\(r>0\) and '\(r<1\)\), abs\(r\)\) => error
withassume\(\('"and"\)\(r>0\) and '\(r<1\)\), abs\(r\)\) => error
withassume\('\("and"\)\(r>0\) and '\(r<1\)\), abs\(r\)\) => error
There is a workaround, however:
withassume\(pred,expr\) :=
\( apply\('assume,\[pred\]\), expand\(expr\) \);
You still have to quote the argument, but it works now:
withassume\('\(r>0 and r<1\), abs\(r\)\) => r
Alternatively, you can use the noun form of AND:
withassume\('\("and"\)\(r>0,r<1\),abs\(r\)\) => r
Yuck in both cases.
\------------------------------
Discussion
The underlying problem is that "is", "assume",
"forget", etc. quote their arguments then depend on
their own little idiosyncratic evaluator....
Also that noun-form logical connectives \(and, or, if\)
aren't really supported.
Maxima version: 5.9.0.9beta2
Maxima build date: 10:50 7/27/2004
host type: i686-pc-mingw32
lisp-implementation-type: Kyoto Common Lisp
lisp-implementation-version: GCL 2.6.3
Stavros MacrakisFri, 22 Oct 2004 18:33:32 -0000http://sourceforge.net2b36e3f5db34a0dab879b9cb127115ec1f332a35